Source Code Cross Referenced for RelativeEC2.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » jtests » beans » relatives » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.jtests.beans.relatives 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 1999 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: RelativeEC2.java 4406 2004-03-19 11:57:20Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */
025:
026:        // PersonneEC2.java
027:        package org.objectweb.jonas.jtests.beans.relatives;
028:
029:        import java.util.Date;
030:        import java.util.Set;
031:
032:        import javax.ejb.CreateException;
033:        import javax.ejb.DuplicateKeyException;
034:        import javax.ejb.EntityBean;
035:        import javax.ejb.EntityContext;
036:        import javax.ejb.RemoveException;
037:
038:        import org.objectweb.jonas.common.Log;
039:        import org.objectweb.util.monolog.api.BasicLevel;
040:        import org.objectweb.util.monolog.api.Logger;
041:
042:        /**
043:         * This is an entity bean with "container managed persistence version 2.x".
044:         * @author  Christophe Ney - cney@batisseurs.com
045:         */
046:        public abstract class RelativeEC2 implements  EntityBean {
047:
048:            static protected Logger logger = null;
049:            EntityContext ejbContext;
050:
051:            // ------------------------------------------------------------------
052:            // Get and Set accessor methods of the bean's abstract schema
053:            // ------------------------------------------------------------------
054:            public abstract String getFullName();
055:
056:            public abstract void setFullName(String name);
057:
058:            public abstract int getLuckyNumber();
059:
060:            public abstract void setLuckyNumber(int age);
061:
062:            public abstract Date getBirthdate();
063:
064:            public abstract void setBirthdate(Date birthdate);
065:
066:            public abstract RelativeLocal getSpouse();
067:
068:            public abstract void setSpouse(RelativeLocal spouse);
069:
070:            public abstract Set getSibblings();
071:
072:            public abstract void setSibblings(Set sibblings);
073:
074:            public abstract Set getVisitedRelatives();
075:
076:            public abstract void setVisitedRelatives(Set sibblings);
077:
078:            public abstract boolean getIsMale();
079:
080:            public abstract void setIsMale(boolean isMale);
081:
082:            public abstract double getAverageAnnualVisits();
083:
084:            public abstract void setAverageAnnualVisits(
085:                    double averageAnnualVisits);
086:
087:            // ------------------------------------------------------------------
088:            // EntityBean implementation
089:            // ------------------------------------------------------------------
090:
091:            /**
092:             * Set the associated entity context.
093:             */
094:            public void setEntityContext(EntityContext ctx) {
095:                if (logger == null)
096:                    logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
097:                logger.log(BasicLevel.DEBUG, "");
098:                ejbContext = ctx;
099:            }
100:
101:            /**
102:             * Unset the associated entity context.
103:             */
104:            public void unsetEntityContext() {
105:                logger.log(BasicLevel.DEBUG, "");
106:                ejbContext = null;
107:            }
108:
109:            /**
110:             * A container invokes this method before it removes the EJB object
111:             * that is currently associated with the instance.
112:             */
113:            public void ejbRemove() throws RemoveException {
114:                logger.log(BasicLevel.DEBUG, "");
115:            }
116:
117:            /**
118:             * A container invokes this method to instruct the instance to synchronize
119:             * its state by loading it state from the underlying database.
120:             */
121:            public void ejbLoad() {
122:                logger.log(BasicLevel.DEBUG, "");
123:            }
124:
125:            /**
126:             * A container invokes this method to instruct the instance to synchronize
127:             * its state by storing it to the underlying database.
128:             */
129:            public void ejbStore() {
130:                logger.log(BasicLevel.DEBUG, "");
131:            }
132:
133:            /**
134:             * A container invokes this instance before creating the EJBObject
135:             */
136:            public String ejbCreate(String fullName, Date birthdate,
137:                    int luckyNumber) throws CreateException,
138:                    DuplicateKeyException {
139:                logger.log(BasicLevel.DEBUG, "");
140:
141:                setFullName(fullName);
142:                setBirthdate(birthdate);
143:                setLuckyNumber(luckyNumber);
144:
145:                // In CMP, should return null.
146:                return null;
147:            }
148:
149:            /**
150:             * There must be an ejbPostCreate par ejbCreate method
151:             *
152:             * @throws CreateException Failure to create an entity EJB object.
153:             */
154:            public void ejbPostCreate(String fullName, Date birthdate,
155:                    int luckyNumber) throws CreateException {
156:                logger.log(BasicLevel.DEBUG, "");
157:            }
158:
159:            /**
160:             * This method is called before the instance enters the "passive" state.
161:             * The instance should release any resources that it can re-acquire later in the
162:             * ejbActivate() method.
163:             * After the passivate method completes, the instance must be in a state that
164:             * allows the container to use the Java Serialization protocol to externalize
165:             * and store away the instance's state.
166:             * This method is called with no transaction context.
167:             *
168:             * @exception EJBException - Thrown if the instance could not perform the
169:             * function requested by the container
170:             */
171:            public void ejbPassivate() {
172:                logger.log(BasicLevel.DEBUG, "");
173:            }
174:
175:            /**
176:             * This method is called when the instance is activated from its "passive" state.
177:             * The instance should acquire any resource that it has released earlier in the
178:             * ejbPassivate() method.
179:             * This method is called with no transaction context.
180:             *
181:             * @exception EJBException - Thrown if the instance could not perform the
182:             * function requested by the container
183:             */
184:            public void ejbActivate() {
185:                logger.log(BasicLevel.DEBUG, "");
186:            }
187:
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.