Source Code Cross Referenced for BnAgentBean.java in  » Workflow-Engines » bonita-v3.1 » hero » entity » 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 » Workflow Engines » bonita v3.1 » hero.entity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package hero.entity;
002:
003:        import hero.interfaces.BnAgentLightValue;
004:        import hero.interfaces.BnAgentPK;
005:        import hero.interfaces.BnAgentValue;
006:        import hero.interfaces.BnProjectLocal;
007:        import hero.interfaces.BnUserLocal;
008:        import hero.interfaces.InvalidValueException;
009:
010:        import java.util.Date;
011:        import java.util.Collection;
012:
013:        import javax.ejb.CreateException;
014:        import javax.ejb.EJBException;
015:        import javax.ejb.EntityBean;
016:        import javax.ejb.EntityContext;
017:        import javax.ejb.RemoveException;
018:
019:        /**
020:         * The Entity bean represents a BnUser
021:         *
022:         * @author Miguel Valdes
023:         * @version $Revision: 1.10 $
024:         *
025:         * @ejb:bean name="BnAgent"
026:         *           display-name="BnAgent Entity"
027:         *           type="CMP"
028:         *           jndi-name="ejb/hero/BnAgent"
029:         *           local-jndi-name="ejb/hero/BnAgent_L"
030:         *           view-type="both"
031:         *           cmp-version="2.x"
032:         *           reentrant="true"
033:         *
034:         * @ejb:transaction type="Supports"
035:         *
036:         * @ejb.pk method-intf="both"
037:         *
038:         * @jonas.bean
039:         * 	   lock-policy="container-read-committed"
040:         * @jonas.jdbc-mapping
041:         *     jndi-name="bonita"
042:         *     jdbc-table-name="BnAgent"
043:         *
044:         * @jonas.shared false
045:         *
046:         * @ejb:finder signature="java.util.Collection findAll()"
047:         *     query="SELECT object(a) FROM BnAgent a"
048:         *     transaction-type="Supports"
049:         *
050:         * @ejb:finder signature="hero.interfaces.BnAgent findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Remote"
051:         *     query="SELECT OBJECT(a) FROM BnAgent a WHERE a.name = ?1 AND a.bnProject.id = ?2"
052:         *     transaction-type="Supports"
053:         * @ejb:finder signature="hero.interfaces.BnAgentLocal findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Local"
054:         *     query="SELECT OBJECT(a) FROM BnAgent a WHERE a.name = ?1 AND a.bnProject.id = ?2"
055:         *     transaction-type="Supports"
056:         *
057:         *
058:         * @ejb.value-object
059:         *    match="*"
060:         *    name="BnAgent"
061:         *
062:         * @ejb.value-object
063:         *    match="light"
064:         *    name="BnAgentLight"
065:         *
066:         * @jboss.persistence
067:         *    table-name="BnAgent"
068:         *    create-table="true"
069:         *    remove-table="false"
070:         * 
071:         * @jboss.container-configuration name="Standard CMP 2.x EntityBean for Bonita"
072:         **/
073:
074:        public abstract class BnAgentBean implements  EntityBean {
075:
076:            // -------------------------------------------------------------------------
077:            // Members
078:            // -------------------------------------------------------------------------
079:
080:            public EntityContext mContext;
081:
082:            // -------------------------------------------------------------------------
083:            // Methods
084:            // -------------------------------------------------------------------------
085:
086:            // -------------------------------------------------------------------------
087:            // Properties (Getters/Setters)
088:            // -------------------------------------------------------------------------
089:
090:            /**
091:             * Retrieve the BnAgent's id.
092:             *
093:             * @return Returns an int representing the id of this BnAgent.
094:             *
095:             * @ejb:pk-field
096:             * @ejb.value-object
097:             *    match="light"
098:             *
099:             * @ejb:persistence column-name="id"
100:             * @ejb:interface-method view-type="local"
101:             * @jonas.cmp-field-jdbc-mapping
102:             *    field-name="id"
103:             *    jdbc-field-name="id"
104:             * @ejb:transaction type="Supports"
105:             **/
106:            public abstract String getId();
107:
108:            /**
109:             * Set the BnAgent's id.
110:             *
111:             * @param pId The id of this BnAgent. Is set at creation time.
112:             * @ejb:transaction type="Required"
113:             **/
114:            public abstract void setId(String pId);
115:
116:            /**
117:             * Retrieve the BnAgent's state.
118:             *
119:             * @return Returns an int representing the state of this BnAgent.
120:             *
121:             * @ejb:interface-method view-type="both"
122:             * @ejb.value-object
123:             *    match="light"
124:             *
125:             * @ejb:persistence column-name="state"
126:             * @ejb:transaction type="Supports"
127:             **/
128:            public abstract int getState();
129:
130:            /**
131:             * Set the BnAgent's state.
132:             *
133:             * @param pState The state of this BnAgent. Is set at creation time.
134:             * @ejb:interface-method view-type="both"
135:             * @ejb:transaction type="Required"
136:             **/
137:            public abstract void setState(int pState);
138:
139:            /**
140:             * Retrieve the BnAgent's type.
141:             *
142:             * @return Returns the type of this BnAgent.
143:             *
144:             * @ejb:interface-method view-type="both"
145:             * @ejb.value-object
146:             *    match="light"
147:             *
148:             * @ejb:persistence column-name="type"
149:             **/
150:            //   public abstract AgentType getType();
151:            /**
152:             * Set the BnAgent's type.
153:             *
154:             * @param type The type of this BnAgent. Is set at creation time.
155:             * @ejb:interface-method view-type="both"
156:             * @ejb:transaction type="Required"
157:             **/
158:            //   public abstract void setType( AgentType type );
159:            /**
160:             * Retrieve the BnAgent's Name.
161:             *
162:             * @return Returns an int representing the Name of this BnAgent.
163:             *
164:             * @ejb:interface-method view-type="both"
165:             * @ejb.value-object
166:             *    match="light"
167:             *
168:             * @ejb:persistence column-name="name"
169:             * @ejb:transaction type="Supports"
170:             **/
171:            public abstract String getName();
172:
173:            /**
174:             * Set the BnAgent's Name.
175:             *
176:             * @param pName The Name of this BnAgent.  Is set at creation time.
177:             * @ejb:transaction type="Required"
178:             **/
179:            public abstract void setName(String pName);
180:
181:            /**
182:             * Retrieve the BnAgent's Description.
183:             *
184:             * @return Returns the description of the BnAgent
185:             *
186:             * @ejb:interface-method view-type="both"
187:             * @ejb.value-object
188:             *    match="light"
189:             *
190:             * @ejb:persistence column-name="description"
191:             * @ejb:transaction type="Supports"
192:             **/
193:            public abstract String getDescription();
194:
195:            /**
196:             * Set the BnAgent's Description.
197:             *
198:             * @param pDescription The Description of this BnAgent.
199:             * @ejb:interface-method view-type="both"
200:             * @ejb:transaction type="Required"
201:             **/
202:            public abstract void setDescription(String pDescription);
203:
204:            /** Retrieve the BnAgent's Creator.
205:             *
206:             * @return Returns a String representing the Name of the BnAgent Creator.
207:             * @ejb:interface-method view-type="local"
208:             * @ejb:relation name="AgentCreator" role-name="created-by"
209:             *
210:             * @ejb:value-object match="*"
211:             *       relation="external"
212:             *       aggregate="hero.interfaces.BnUserLightValue"
213:             *       aggregate-name="Creator"
214:             * @ejb:transaction type="Supports"
215:             * @jboss.relation
216:             *    related-pk-field = "id"
217:             *    fk-column = "AgentUserIdFK"
218:             **/
219:            public abstract BnUserLocal getCreator();
220:
221:            /**
222:             * Set the BnAgent's Creator.
223:             *
224:             * @param pCreator The creator of this BnAgent.
225:             * @ejb:interface-method view-type="local"
226:             * @ejb:transaction type="Required"
227:             **/
228:            public abstract void setCreator(BnUserLocal pCreator);
229:
230:            /**
231:             * @return  the project of the BnAgent
232:             * @ejb:interface-method view-type="local"
233:             * @ejb:relation name="Agents" role-name="is-agent-of" cascade-delete="yes"
234:             * @ejb:transaction type="Supports"
235:             * @jboss.relation
236:             *    related-pk-field = "id"
237:             *    fk-column = "agentProjectIdFK"
238:             **/
239:            public abstract BnProjectLocal getBnProject();
240:
241:            /**
242:             * Set the BnProject BnAgent.
243:             *
244:             * @param pProject The Name of this BnAgent.  Is set at creation time.
245:             * @ejb:transaction type="Required"
246:             *
247:             **/
248:            public abstract void setBnProject(BnProjectLocal pProject);
249:
250:            /**
251:             * @return  the outgoing edges of the agent
252:             * @ejb:interface-method view-type="local"
253:             * @ejb:relation name="InAgent" role-name="has-edges-in" target-multiple="yes"
254:             * @ejb:transaction type="Supports"
255:             * @jboss.relation-table create-table="true" remove-table="false"
256:             *
257:             **/
258:            public abstract Collection getOutEdges();
259:
260:            /**
261:             * Set the Outgoing edges of the BnAgent
262:             *
263:             * @param pEdges the outgoing edges of the BnAgent
264:             * @ejb:transaction type="Required"
265:             **/
266:            public abstract void setOutEdges(Collection pEdges);
267:
268:            /**
269:             * @return Return the creation date of the BnAgent
270:             * @ejb:interface-method view-type="both"
271:             * @ejb:persistence column-name="creationdate"
272:             * @ejb:transaction type="Supports"
273:             *
274:             **/
275:            public abstract Date getCreationDate();
276:
277:            /**
278:             * @param pDate the creation date of the BnAgent
279:             * @ejb:interface-method view-type="both"
280:             * @ejb:transaction type="Required"
281:             *
282:             **/
283:            public abstract void setCreationDate(Date pDate);
284:
285:            /**
286:             * @ejb.interface-method
287:             * @ejb:transaction type="Supports"
288:             */
289:            public abstract BnAgentValue getBnAgentValue();
290:
291:            /**
292:             * @ejb.interface-method
293:             * @ejb:transaction type="Required"
294:             */
295:            public abstract void setBnAgentValue(BnAgentValue v);
296:
297:            /**
298:             * @ejb.interface-method
299:             * @ejb:transaction type="Supports"
300:             */
301:            public abstract BnAgentLightValue getBnAgentLightValue();
302:
303:            /**
304:             * @return true if the BnAgent is active
305:             * @ejb.interface-method view-type="local"
306:             */
307:            public boolean isActive() {
308:                return (this .getState() == hero.interfaces.Constants.Ag.ACTIVE);
309:            }
310:
311:            // -------------------------------------------------------------------------
312:            // Framework Callbacks
313:            // -------------------------------------------------------------------------
314:
315:            /**
316:             * Create a BnAgent based on the supplied BnAgent Value Object.
317:             *
318:             *
319:             * @throws InvalidValueException If one of the values are not correct,
320:             *                               this will not roll back the transaction
321:             *                               because the caller has the chance to
322:             *                               fix the problem and try again
323:             * @throws EJBException If no new unique ID could be retrieved this will
324:             *                      rollback the transaction because there is no
325:             *                      hope to try again
326:             * @throws CreateException Because we have to do so (EJB spec.)
327:             *
328:             * @ejb:create-method view-type="both"
329:             **/
330:            public BnAgentPK ejbCreate(BnAgentValue nd)
331:                    throws InvalidValueException, EJBException, CreateException {
332:                this .setId(hero.interfaces.BnAgentUtil.generateGUID(this ));
333:                // This is only possible in CMPs. Otherwise return a valid PK.
334:                return null;
335:            }
336:
337:            public void ejbPostCreate(BnAgentValue nd) {
338:                // Assign value object in ejbPostCreate to apply XDoclet best
339:                // practice. If not done, there will be an error in JBoss if
340:                // the Value Object has relations.
341:                this .setBnAgentValue(nd);
342:            }
343:
344:            /**
345:             * Create a BnAgent based on the supplied Name and type.
346:             *
347:             *
348:             * @throws InvalidValueException If one of the values are not correct,
349:             *                               this will not roll back the transaction
350:             *                               because the caller has the chance to
351:             *                               fix the problem and try again
352:             * @throws EJBException If no new unique ID could be retrieved this will
353:             *                      rollback the transaction because there is no
354:             *                      hope to try again
355:             * @throws CreateException Because we have to do so (EJB spec.)
356:             *
357:             * @ejb:create-method view-type="both"
358:             **/
359:            public BnAgentPK ejbCreate(String name)
360:                    throws InvalidValueException, EJBException, CreateException {
361:                this .setName(name);
362:                this .setState(hero.interfaces.Constants.Ag.INACTIVE);
363:
364:                this .setId(hero.interfaces.BnAgentUtil.generateGUID(this ));
365:
366:                // This is only possible in CMPs. Otherwise return a valid PK.
367:                return null;
368:            }
369:
370:            public void setEntityContext(EntityContext lContext) {
371:                mContext = lContext;
372:            }
373:
374:            public void unsetEntityContext() {
375:                mContext = null;
376:            }
377:
378:            public void ejbActivate() {
379:            }
380:
381:            public void ejbPassivate() {
382:            }
383:
384:            public void ejbLoad() {
385:            }
386:
387:            public void ejbStore() {
388:            }
389:
390:            public void ejbRemove() throws RemoveException {
391:            }
392:
393:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.