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


001:        // CustomerEC2R.java
002:        package org.objectweb.jonas.stests.appli;
003:
004:        import org.objectweb.jonas.common.Log;
005:        import org.objectweb.util.monolog.api.Logger;
006:        import org.objectweb.util.monolog.api.BasicLevel;
007:
008:        /**
009:         *
010:         */
011:        public abstract class CustomerEC2R implements  javax.ejb.EntityBean {
012:
013:            static private Logger logger = null;
014:            javax.ejb.EntityContext ejbContext;
015:
016:            /**
017:             * Create a new Customer with minimal information.
018:             * <p>
019:             * @param id Customer ID for the customer being created, must be unique
020:             * @param fN First name of the customer
021:             * @param lN Last name of the customer
022:             * @param phone Phone number of the customer
023:             * @return Customer
024:             * @exception javax.ejb.CreateException Creation Exception
025:             * @exception java.rmi.RemoteException Remote Exception
026:             */
027:
028:            public String ejbCreate(Integer custID, String fN, String lN,
029:                    String phone) throws javax.ejb.CreateException {
030:                setCustomerID(custID);
031:                setFirstName(fN);
032:                setLastName(lN);
033:                setPhone(phone);
034:                setAddressLine1("unknown");
035:                setAddressLine2("unknown");
036:                setCity("unknown");
037:                setState("unknown");
038:                setZip("unknown");
039:                setCreditLimit(0);
040:                setBalance(0);
041:                setYearToDateBalance(0);
042:                return null;
043:            }
044:
045:            /**
046:             * Create a new Customer with all parameters, except balances which will automatically
047:             * be initialized to zero
048:             * <p>
049:             * @param id Customer ID for the customer being created, must be unique
050:             * @param fN First name of the customer
051:             * @param lN Last name of the customer
052:             * @param inits Middle initials of the customer
053:             * @param phone Phone number of the customer
054:             * @param addr1 First address line of the customer
055:             * @param addr2 Second address line of the customer
056:             * @param city City of the customer's mailing address
057:             * @param state State of the customer's mailing address
058:             * @param zip Zip code of the customer's mailing address
059:             * @param creditLimit Credit limit allowed for this cusomter
060:             * @return Customer
061:             * @exception javax.ejb.CreateException Creation Exception
062:             * @exception java.rmi.RemoteException Remote Exception
063:             */
064:            public String ejbCreate(Integer Id, String fN, String lN,
065:                    String inits, String addr1, String addr2, String city,
066:                    String state, String zip, String phone, float creditLimit)
067:                    throws javax.ejb.CreateException {
068:                logger.log(BasicLevel.DEBUG, "");
069:
070:                // Init here the bean fields
071:                setCustomerID(Id);
072:                setFirstName(fN);
073:                setLastName(lN);
074:                setPhone(phone);
075:                setAddressLine1(addr1);
076:                setAddressLine2(addr2);
077:                setCity(city);
078:                setState(state);
079:                setZip(zip);
080:                setCreditLimit(creditLimit);
081:                setBalance(0);
082:                setYearToDateBalance(0);
083:                return null;
084:            }
085:
086:            public void ejbPostCreate(Integer custID, String fN, String lN,
087:                    String phone) {
088:                logger.log(BasicLevel.DEBUG, "");
089:            }
090:
091:            public void ejbPostCreate(Integer Id, String fN, String lN,
092:                    String inits, String addr1, String addr2, String city,
093:                    String state, String zip, String phone, float creditLimit) {
094:                logger.log(BasicLevel.DEBUG, "");
095:            }
096:
097:            // ------------------------------------------------------------------
098:            // Persistent fields
099:            // 
100:            // ------------------------------------------------------------------
101:            public abstract Integer getCustomerID();
102:
103:            public abstract void setCustomerID(Integer id);
104:
105:            public abstract String getFirstName();
106:
107:            public abstract void setFirstName(String fn);
108:
109:            public abstract String getLastName();
110:
111:            public abstract void setLastName(String ln);
112:
113:            public abstract String getMiddleInitials();
114:
115:            public abstract void setMiddleInitials(String mi);
116:
117:            public abstract String getPhone();
118:
119:            public abstract void setPhone(String phone);
120:
121:            public abstract String getAddressLine1();
122:
123:            public abstract void setAddressLine1(String line);
124:
125:            public abstract String getAddressLine2();
126:
127:            public abstract void setAddressLine2(String line);
128:
129:            public abstract String getCity();
130:
131:            public abstract void setCity(String city);
132:
133:            public abstract String getState();
134:
135:            public abstract void setState(String state);
136:
137:            public abstract String getZip();
138:
139:            public abstract void setZip(String zip);
140:
141:            public abstract float getBalance();
142:
143:            public abstract void setBalance(float balance);
144:
145:            public abstract float getYearToDateBalance();
146:
147:            public abstract void setYearToDateBalance(float ytdBalance);
148:
149:            public abstract float getCreditLimit();
150:
151:            public abstract void setCreditLimit(float limit);
152:
153:            // ------------------------------------------------------------------
154:            // Standard call back methods
155:            // ------------------------------------------------------------------
156:
157:            public void setEntityContext(javax.ejb.EntityContext ctx) {
158:                if (logger == null) {
159:                    logger = Log.getLogger("org.objectweb.jonas_tests");
160:                }
161:                logger.log(BasicLevel.DEBUG, "");
162:                ejbContext = ctx;
163:            }
164:
165:            public void unsetEntityContext() {
166:                logger.log(BasicLevel.DEBUG, "");
167:                ejbContext = null;
168:            }
169:
170:            public void ejbRemove() throws javax.ejb.RemoveException {
171:                logger.log(BasicLevel.DEBUG, "");
172:            }
173:
174:            public void ejbLoad() {
175:                logger.log(BasicLevel.DEBUG, "");
176:            }
177:
178:            public void ejbStore() {
179:                logger.log(BasicLevel.DEBUG, "");
180:            }
181:
182:            public void ejbPassivate() {
183:                logger.log(BasicLevel.DEBUG, "");
184:            }
185:
186:            public void ejbActivate() {
187:                logger.log(BasicLevel.DEBUG, "");
188:            }
189:
190:            /**
191:             * Update the balance and year to date balance with the total amount from an order.
192:             * <p>
193:             * @param orderAmount Order amount to update the balances with <i>(Mandatory)</i>
194:             * @return void
195:             * @exception java.rmi.RemoteException Remote exception
196:             */
197:            /*------------------------------------------------------------------*/
198:            public void updateBalance(float orderAmount) {
199:                float ytd = getYearToDateBalance();
200:                setYearToDateBalance(ytd + orderAmount);
201:                float balance = getBalance();
202:                setBalance(balance + orderAmount);
203:            }
204:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.