Source Code Cross Referenced for BEC2.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » jtests » beans » relation » dass » 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.relation.dass 
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: BEC2.java 5009 2004-06-25 09:18:28Z durieuxp $
023:         * --------------------------------------------------------------------------
024:         */
025:
026:        package org.objectweb.jonas.jtests.beans.relation.dass;
027:
028:        import org.objectweb.util.monolog.api.Logger;
029:        import org.objectweb.util.monolog.api.BasicLevel;
030:        import org.objectweb.jonas.common.Log;
031:
032:        import javax.ejb.EntityContext;
033:        import javax.ejb.CreateException;
034:        import javax.ejb.DuplicateKeyException;
035:        import javax.ejb.RemoveException;
036:
037:        /**
038:         * @author Ph Durieux
039:         */
040:        public abstract class BEC2 implements  javax.ejb.EntityBean {
041:
042:            // ------------------------------------------------------------------
043:            // Get and Set accessor methods of the bean's abstract schema
044:            // ------------------------------------------------------------------
045:            public abstract String getId();
046:
047:            public abstract void setId(String id);
048:
049:            // ------------------------------------------------------------------
050:            // EntityBean implementation
051:            // ------------------------------------------------------------------
052:
053:            static protected Logger logger = null;
054:            EntityContext ejbContext;
055:
056:            /**
057:             * The Entity bean can define 0 or more ejbCreate methods.
058:             *
059:             * @throws CreateException Failure to create an entity EJB object.
060:             * @throws DuplicateKeyException An object with the same key already exists.
061:             */
062:            public String ejbCreate(String id) throws CreateException,
063:                    DuplicateKeyException {
064:                logger.log(BasicLevel.DEBUG, "");
065:
066:                // Init here the bean fields
067:                setId(id);
068:
069:                // In CMP, should return null.
070:                return null;
071:            }
072:
073:            /**
074:             * There must be an ejbPostCreate par ejbCreate method
075:             *
076:             * @throws CreateException Failure to create an entity EJB object.
077:             */
078:            public void ejbPostCreate(String id) throws CreateException {
079:                logger.log(BasicLevel.DEBUG, "id=" + id);
080:            }
081:
082:            /**
083:             * Set the associated entity context. The container invokes this method
084:             * on an instance after the instance has been created.
085:             * This method is called in an unspecified transaction context.
086:             *
087:             * @param ctx - An EntityContext interface for the instance. The instance
088:             * should store the reference to the context in an instance variable.
089:             * @throws EJBException Thrown by the method to indicate a failure caused by a
090:             * system-level error.
091:             */
092:            public void setEntityContext(EntityContext ctx) {
093:                if (logger == null)
094:                    logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
095:                logger.log(BasicLevel.DEBUG, "");
096:                ejbContext = ctx;
097:            }
098:
099:            /**
100:             * Unset the associated entity context. The container calls this method
101:             * before removing the instance.
102:             * This is the last method that the container invokes on the instance.
103:             * The Java garbage collector will eventually invoke the finalize() method
104:             * on the instance.
105:             * This method is called in an unspecified transaction context.
106:             *
107:             * @throws EJBException Thrown by the method to indicate a failure caused by a
108:             * system-level error.
109:             */
110:            public void unsetEntityContext() {
111:                logger.log(BasicLevel.DEBUG, "");
112:                ejbContext = null;
113:            }
114:
115:            /**
116:             * A container invokes this method before it removes the EJB object
117:             * that is currently associated with the instance. This method is
118:             * invoked when a client invokes a remove operation on the enterprise Bean's
119:             * home interface or the EJB object's remote interface. This method
120:             * transitions the instance from the ready state to the pool of available
121:             * instances.
122:             *
123:             * This method is called in the transaction context of the remove operation.
124:             * @throws RemoveException  The enterprise Bean does not allow destruction of the object.
125:             * @throws EJBException - Thrown by the method to indicate a failure caused by a system-level
126:             * error.
127:             */
128:            public void ejbRemove() throws RemoveException {
129:                logger.log(BasicLevel.DEBUG, "");
130:            }
131:
132:            /**
133:             * A container invokes this method to instruct the instance to synchronize
134:             * its state by loading it state from the underlying database.
135:             * This method always executes in the proper transaction context.
136:             *
137:             * @throws EJBException Thrown by the method to indicate a failure caused by
138:             * a system-level error.
139:             */
140:            public void ejbLoad() {
141:                logger.log(BasicLevel.DEBUG, "");
142:            }
143:
144:            /**
145:             * A container invokes this method to instruct the instance to synchronize
146:             * its state by storing it to the underlying database.
147:             * This method always executes in the proper transaction context.
148:             *
149:             * @throws EJBException Thrown by the method to indicate a failure caused by
150:             * a system-level error.
151:             */
152:            public void ejbStore() {
153:                logger.log(BasicLevel.DEBUG, "");
154:            }
155:
156:            /**
157:             * A container invokes this method on an instance before the instance
158:             * becomes disassociated with a specific EJB object.
159:             */
160:            public void ejbPassivate() {
161:                logger.log(BasicLevel.DEBUG, "");
162:            }
163:
164:            /**
165:             * A container invokes this method when the instance is taken out of
166:             * the pool of available instances to become associated with a specific
167:             * EJB object.
168:             */
169:            public void ejbActivate() {
170:                logger.log(BasicLevel.DEBUG, "");
171:            }
172:
173:        }
ww_w.__ja___v__a__2___s_.__c_o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.