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