Source Code Cross Referenced for BankAccountECL.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » clusterDemo » 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.clusterDemo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // BankAccountECL.java
002:
003:        package org.objectweb.clusterDemo;
004:
005:        import javax.ejb.CreateException;
006:        import javax.ejb.DuplicateKeyException;
007:        import javax.ejb.EntityBean;
008:        import javax.ejb.EntityContext;
009:        import javax.ejb.RemoveException;
010:
011:        import org.objectweb.jonas.common.Log;
012:        import org.objectweb.util.monolog.api.Logger;
013:        import org.objectweb.util.monolog.api.BasicLevel;
014:
015:        /**
016:         *
017:         */
018:        public abstract class BankAccountECL implements  EntityBean {
019:
020:            static private Logger logger = null;
021:
022:            EntityContext ejbContext;
023:
024:            // ------------------------------------------------------------------
025:            // EntityBean implementation
026:            // ------------------------------------------------------------------
027:
028:            /**
029:             * Set the associated entity context. The container invokes this method on
030:             * an instance after the instance has been created. This method is called in
031:             * an unspecified transaction context.
032:             * @param ctx - An EntityContext interface for the instance. The instance
033:             *        should store the reference to the context in an instance variable.
034:             * @throws EJBException Thrown by the method to indicate a failure caused by
035:             *         a system-level error.
036:             */
037:            public void setEntityContext(EntityContext ctx) {
038:                if (logger == null) {
039:                    logger = Log.getLogger("org.objectweb.jonas_tests");
040:                }
041:                logger.log(BasicLevel.DEBUG, "");
042:                ejbContext = ctx;
043:            }
044:
045:            /**
046:             * Unset the associated entity context. The container calls this method
047:             * before removing the instance. This is the last method that the container
048:             * invokes on the instance. The Java garbage collector will eventually
049:             * invoke the finalize() method on the instance. This method is called in an
050:             * unspecified transaction context.
051:             * @throws EJBException Thrown by the method to indicate a failure caused by
052:             *         a system-level error.
053:             */
054:            public void unsetEntityContext() {
055:                logger.log(BasicLevel.DEBUG, "");
056:                ejbContext = null;
057:            }
058:
059:            /**
060:             * A container invokes this method before it removes the EJB object that is
061:             * currently associated with the instance. This method is invoked when a
062:             * client invokes a remove operation on the enterprise Bean's home interface
063:             * or the EJB object's remote interface. This method transitions the
064:             * instance from the ready state to the pool of available instances. This
065:             * method is called in the transaction context of the remove operation.
066:             * @throws RemoveException The enterprise Bean does not allow destruction of
067:             *         the object.
068:             * @throws EJBException - Thrown by the method to indicate a failure caused
069:             *         by a system-level error.
070:             */
071:            public void ejbRemove() throws RemoveException {
072:                logger.log(BasicLevel.DEBUG, "");
073:            }
074:
075:            /**
076:             * A container invokes this method to instruct the instance to synchronize
077:             * its state by loading it state from the underlying database. This method
078:             * always executes in the proper transaction context.
079:             * @throws EJBException Thrown by the method to indicate a failure caused by
080:             *         a system-level error.
081:             */
082:            public void ejbLoad() {
083:                logger.log(BasicLevel.DEBUG, "");
084:            }
085:
086:            /**
087:             * A container invokes this method to instruct the instance to synchronize
088:             * its state by storing it to the underlying database. This method always
089:             * executes in the proper transaction context.
090:             * @throws EJBException Thrown by the method to indicate a failure caused by
091:             *         a system-level error.
092:             */
093:            public void ejbStore() {
094:                logger.log(BasicLevel.DEBUG, "");
095:            }
096:
097:            /**
098:             * There must be an ejbPostCreate par ejbCreate method
099:             * @throws CreateException Failure to create an entity EJB object.
100:             */
101:            public void ejbPostCreate(int b, String n) throws CreateException {
102:                logger.log(BasicLevel.DEBUG, "");
103:            }
104:
105:            /**
106:             * The Entity bean can define 0 or more ejbCreate methods.
107:             * @throws CreateException Failure to create an entity EJB object.
108:             * @throws DuplicateKeyException An object with the same key already exists.
109:             */
110:            public java.lang.String ejbCreate(int b, String n)
111:                    throws CreateException, DuplicateKeyException {
112:                logger.log(BasicLevel.DEBUG, "");
113:
114:                // Init here the bean fields
115:                setBalance(b);
116:                setName(n);
117:
118:                // In CMP, should return null.
119:                return null;
120:            }
121:
122:            /**
123:             * A container invokes this method on an instance before the instance
124:             * becomes disassociated with a specific EJB object.
125:             */
126:            public void ejbPassivate() {
127:                logger.log(BasicLevel.DEBUG, "");
128:            }
129:
130:            /**
131:             * A container invokes this method when the instance is taken out of the
132:             * pool of available instances to become associated with a specific EJB
133:             * object.
134:             */
135:            public void ejbActivate() {
136:                logger.log(BasicLevel.DEBUG, "");
137:            }
138:
139:            // ------------------------------------------------------------------
140:            // BankAccount implementation
141:            // ------------------------------------------------------------------
142:
143:            /**
144:             * credit method
145:             */
146:            public void putMoney(int value) {
147:                logger.log(BasicLevel.DEBUG, "");
148:                setBalance(getBalance() + value);
149:            }
150:
151:            /**
152:             * credit method
153:             */
154:            public void getMoney(int value) {
155:                logger.log(BasicLevel.DEBUG, "");
156:                setBalance(getBalance() - value);
157:            }
158:
159:            public abstract String getName();
160:
161:            public abstract void setName(String name);
162:
163:            public abstract double getBalance();
164:
165:            public abstract void setBalance(double balance);
166:
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.