Source Code Cross Referenced for WfAssignmentSSBean.java in  » Workflow-Engines » shark » org » enhydra » shark » ejb » 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 » shark » org.enhydra.shark.ejb 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* WfAssignmentSSBean.java */
002:        package org.enhydra.shark.ejb;
003:
004:        import java.rmi.RemoteException;
005:
006:        import javax.ejb.EJBException;
007:        import javax.ejb.EJBObject;
008:        import javax.ejb.SessionBean;
009:        import javax.ejb.SessionContext;
010:        import javax.naming.Context;
011:        import javax.rmi.PortableRemoteObject;
012:
013:        import org.enhydra.shark.api.client.wfmodel.CannotAcceptSuspended;
014:        import org.enhydra.shark.api.client.wfmodel.InvalidResource;
015:        import org.enhydra.shark.api.client.wfmodel.WfActivity;
016:        import org.enhydra.shark.api.client.wfmodel.WfAssignment;
017:        import org.enhydra.shark.api.client.wfmodel.WfResource;
018:
019:        /**
020:         * @ejb.bean 
021:         *    name="WfAssignmentSS"
022:         *    type="Stateful"
023:         *    display-name="WfAssignment"
024:         *    jndi-name="org/enhydra/shark/ejb/WfAssignmentSS"
025:         *    local-jndi-name="org/enhydra/shark/ejb/WfAssignmentSSLocal"
026:         *    transaction-type="Container"
027:         *    view-type="both"
028:         *    local-business-interface="org.enhydra.shark.api.client.wfmodel.WfAssignment"
029:         *
030:         * @ejb.ejb-ref ejb-name="WfActivitySS"
031:         *           view-type="both"
032:         *           ref-name="org/enhydra/shark/ejb/WfActivitySS" 
033:         * @ejb.ejb-ref ejb-name="WfResourceSS"
034:         *           view-type="both"
035:         *           ref-name="org/enhydra/shark/ejb/WfResourceSS" 
036:         *           
037:         * @ejb:interface
038:         *      extends="org.enhydra.shark.api.client.wfmodel.WfAssignment,javax.ejb.EJBObject"
039:         *
040:         * @ejb:transaction
041:         *    type="Required"
042:         *
043:         * @jonas:bean
044:         *    ejb-name="WfAssignmentSS"
045:         *    jndi-name="org/enhydra/shark/ejb/WfAssignmentSS"
046:         *    
047:         * OMG definition: WfAssignment links WfActivity objects to WfResource objects. These
048:         * links represent real assignments for enacting the activity. This interface may be
049:         * specialized by resource management facilities that interpret the context of the
050:         * activity to create and negotiate assignments with resources. Assignments are created as
051:         * part of the resource selection process before an activity becomes ready for execution.
052:         * The lifetime of an assignment is limited by that of the associated activity.
053:         * <p>
054:         * We extended OMG's interface by duplicating methods, and adding additional parameter
055:         * that represents transaction. If you use methods without SharkTransaction parameter, the
056:         * transaction will be implicitly created, and if you use it with SharkTransaction
057:         * parameter you must obey to some rules explained in HowTo documentation.
058:         * <p>
059:         * Also, we added two additional methods for accepting assignment and getting accepted
060:         * status.
061:         *
062:         * @author V.Puskas
063:         * @author S.Bojanic
064:         * @author T.Jovanovic
065:         * @version 0.1
066:         */
067:        public abstract class WfAssignmentSSBean implements  WfAssignment,
068:                SessionBean {
069:
070:            private SessionContext context;
071:            protected org.enhydra.shark.api.client.wfmodel.WfAssignment sharkObj;
072:
073:            /**
074:             * @ejb:interface-method
075:             * view-type="both"
076:             * A WfAssignment is associated with one WfActivity; the association is established
077:             * when the assignment is created as part of the resource selection process for the
078:             * activity. The following operation returns the associated WfActivity.
079:             */
080:            public WfActivity activity() throws Exception {
081:                WfActivity wfshark = sharkObj.activity();
082:                WfActivitySS wf = null;
083:                try {
084:                    Context initialContext = EJBJNDIContext.getInstance()
085:                            .getInitialContext();
086:                    wf = ((org.enhydra.shark.ejb.WfActivitySSHome) PortableRemoteObject
087:                            .narrow(
088:                                    initialContext
089:                                            .lookup("org/enhydra/shark/ejb/WfActivitySS"),
090:                                    org.enhydra.shark.ejb.WfActivitySSHome.class))
091:                            .create(wfshark);
092:                    return (WfActivitySS) wf.getPassedEJBObject();
093:                } catch (Exception ex) {
094:                    throw new EJBException(ex);
095:                }
096:            }
097:
098:            /**
099:             * @ejb:interface-method
100:             * view-type="both"
101:             * A WfAssignment is associated with one WfResource. The association is established
102:             * when the assignment is created as part of the resource selection process for the
103:             * activity; the assignment can be reassigned to another resource at a later point in
104:             * time. The following operation support the assignee relationship.
105:             */
106:            public WfResource assignee() throws Exception {
107:                WfResource wfshark = sharkObj.assignee();
108:                WfResourceSS wf = null;
109:                try {
110:                    Context initialContext = EJBJNDIContext.getInstance()
111:                            .getInitialContext();
112:                    wf = ((org.enhydra.shark.ejb.WfResourceSSHome) PortableRemoteObject
113:                            .narrow(
114:                                    initialContext
115:                                            .lookup("org/enhydra/shark/ejb/WfResourceSS"),
116:                                    org.enhydra.shark.ejb.WfResourceSSHome.class))
117:                            .create(wfshark);
118:                    return (WfResourceSS) wf.getPassedEJBObject();
119:                } catch (Exception ex) {
120:                    throw new EJBException(ex);
121:                }
122:            }
123:
124:            /**
125:             * @ejb:interface-method
126:             * view-type="both"
127:             * A WfAssignment is associated with one WfResource. The association is established
128:             * when the assignment is created as part of the resource selection process for the
129:             * activity; the assignment can be reassigned to another resource at a later point in
130:             * time. The following operation support changing the assignee relationship. An
131:             * InvalidResource exception is raised by an attempt to assign an invalid resource to
132:             * the assignment.
133:             */
134:            public void set_assignee(WfResource new_value) throws Exception,
135:                    InvalidResource {
136:                try {
137:                    sharkObj.set_assignee(new WfResourceHelper(new_value
138:                            .resource_key()));
139:                    //			WfResource res = SharkEJBUtilities.getExpBuilderResource(new_value.resource_key());
140:                    //			sharkAss.set_assignee(res);
141:                } catch (Exception ex) {
142:                    throw new EJBException(ex);
143:                }
144:            }
145:
146:            // doesn't exist in original OMG spec - should we remove it???
147:            /**
148:             * @ejb:interface-method
149:             * view-type="both"
150:             * Extension to OMG interface. Marks assignment's activity to be accepted by the
151:             * assignment's assignee.
152:             */
153:            public void set_accepted_status(boolean accept) throws Exception,
154:                    CannotAcceptSuspended {
155:                sharkObj.set_accepted_status(accept);
156:            }
157:
158:            /**
159:             * @ejb:interface-method
160:             * view-type="both"
161:             * Extension to OMG interface. Returns if assignment is accepted.
162:             */
163:            public boolean get_accepted_status() throws Exception {
164:                return sharkObj.get_accepted_status();
165:            }
166:
167:            /**
168:             * @ejb.interface-method
169:             *	view-type="both" 
170:             **/
171:            public EJBObject getPassedEJBObject() throws EJBException {
172:                try {
173:                    return context.getEJBObject();
174:                } catch (Exception ex) {
175:                    throw new EJBException(ex);
176:                }
177:            }
178:
179:            public void setSessionContext(SessionContext ctx)
180:                    throws EJBException, RemoteException {
181:                context = ctx;
182:            }
183:
184:            /**
185:             * @ejb:create-method
186:             */
187:            public void ejbCreate(
188:                    org.enhydra.shark.api.client.wfmodel.WfAssignment as) {
189:                sharkObj = as;
190:            }
191:
192:            /* (non-Javadoc)
193:             * @see javax.ejb.SessionBean#ejbActivate()
194:             */
195:            public void ejbActivate() throws EJBException, RemoteException {
196:            }
197:
198:            /* (non-Javadoc)
199:             * @see javax.ejb.SessionBean#ejbPassivate()
200:             */
201:            public void ejbPassivate() throws EJBException, RemoteException {
202:            }
203:
204:            /* (non-Javadoc)
205:             * @see javax.ejb.SessionBean#ejbRemove()
206:             */
207:            public void ejbRemove() throws EJBException, RemoteException {
208:            }
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.