Source Code Cross Referenced for WfResourceIteratorSSBean.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:        /* WfResourceIteratorSSBean.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.naming.InitialContext;
012:        import javax.rmi.PortableRemoteObject;
013:
014:        import org.enhydra.shark.api.client.wfmodel.WfResource;
015:        import org.enhydra.shark.api.client.wfservice.WfResourceIterator;
016:
017:        /**
018:         * @ejb.bean 
019:         *    name="WfResourceIteratorSS"
020:         *    type="Stateful"
021:         *    display-name="WfResourceIterator"
022:         *    jndi-name="org/enhydra/shark/ejb/WfResourceIteratorSS"
023:         *    local-jndi-name="org/enhydra/shark/ejb/WfResourceIteratorSSLocal"
024:         *    transaction-type="Container"
025:         *    view-type="both"
026:         *    local-business-interface="org.enhydra.shark.api.client.wfservice.WfResourceIterator"
027:         *
028:         * @ejb.ejb-ref ejb-name="WfProcessSS"
029:         *           view-type="both"
030:         *           ref-name="org/enhydra/shark/ejb/WfProcessSS" 
031:         *           
032:         * @ejb:interface
033:         *      extends="org.enhydra.shark.api.client.wfservice.WfResourceIterator,javax.ejb.EJBObject"
034:         *
035:         * @ejb:transaction
036:         *    type="Required"
037:         *
038:         * @jonas:bean
039:         *    ejb-name="WfResourceIteratorSS"
040:         *    jndi-name="org/enhydra/shark/ejb/WfResourceIteratorSS"
041:         *    
042:         * OMG definition: The WfResourceIterator interface specializes the WfBase::BaseIterator
043:         * interface and adds specific process operations. The following attributes can be used in
044:         * query expressions: key, name, priority, description, state.
045:         * <p>
046:         * We extended OMG's interface by duplicating methods, and adding additional parameter
047:         * that represents transaction. If you use methods without SharkTransaction parameter, the
048:         * transaction will be implicitly created, and if you use it with SharkTransaction
049:         * parameter you must obey to some rules explained in HowTo documentation.
050:         * <p>
051:         * Also, look at our implementation API documentation of this interface to see which
052:         * additional attributes can be used in query expressions.
053:         *
054:         * @author V.Puskas
055:         * @author S.Bojanic
056:         * @author T.Jovanovic
057:         * @version 0.1
058:         */
059:        public abstract class WfResourceIteratorSSBean extends
060:                BaseIteratorSSBean implements  WfResourceIterator, SessionBean {
061:
062:            private SessionContext context;
063:
064:            /**
065:             * @ejb:interface-method
066:             * view-type="both" 
067:             */
068:            public WfResource get_next_object() throws Exception {
069:                WfResource wfshark = ((WfResourceIterator) sharkObj)
070:                        .get_next_object();
071:                WfResourceSS wf = null;
072:                try {
073:                    Context initialContext = EJBJNDIContext.getInstance()
074:                            .getInitialContext();
075:                    wf = ((org.enhydra.shark.ejb.WfResourceSSHome) PortableRemoteObject
076:                            .narrow(
077:                                    initialContext
078:                                            .lookup("org/enhydra/shark/ejb/WfResourceSS"),
079:                                    org.enhydra.shark.ejb.WfResourceSSHome.class))
080:                            .create(wfshark);
081:                    return (WfResourceSS) wf.getPassedEJBObject();
082:                } catch (Exception ex) {
083:                    throw new EJBException(ex);
084:                }
085:            }
086:
087:            /**
088:             * @ejb:interface-method
089:             * view-type="both" 
090:             */
091:            public WfResource get_previous_object() throws Exception {
092:                WfResource wfshark = ((WfResourceIterator) sharkObj)
093:                        .get_previous_object();
094:                WfResourceSS wf = null;
095:                try {
096:                    Context initialContext = EJBJNDIContext.getInstance()
097:                            .getInitialContext();
098:                    wf = ((org.enhydra.shark.ejb.WfResourceSSHome) PortableRemoteObject
099:                            .narrow(
100:                                    initialContext
101:                                            .lookup("org/enhydra/shark/ejb/WfResourceSS"),
102:                                    org.enhydra.shark.ejb.WfResourceSSHome.class))
103:                            .create(wfshark);
104:                    return (WfResourceSS) wf.getPassedEJBObject();
105:                } catch (Exception ex) {
106:                    throw new EJBException(ex);
107:                }
108:            }
109:
110:            /**
111:             * @ejb:interface-method
112:             * view-type="both" 
113:             */
114:            public WfResource[] get_next_n_sequence(int max_number)
115:                    throws Exception {
116:                WfResource[] wfsshark = ((WfResourceIterator) sharkObj)
117:                        .get_next_n_sequence(max_number);
118:                WfResourceSSHome home = null;
119:                InitialContext initialContext = EJBJNDIContext.getInstance()
120:                        .getInitialContext();
121:                home = (WfResourceSSHome) PortableRemoteObject.narrow(
122:                        initialContext
123:                                .lookup("org/enhydra/shark/ejb/WfResourceSS"),
124:                        org.enhydra.shark.ejb.WfResourceSSHome.class);
125:                int len = wfsshark.length;
126:                WfResourceSS[] remotes = new WfResourceSS[len];
127:                for (int i = 0; i < len; i++) {
128:                    remotes[i] = (WfResourceSS) (home.create(wfsshark[i]))
129:                            .getPassedEJBObject();
130:                }
131:                return remotes;
132:            }
133:
134:            /**
135:             * @ejb:interface-method
136:             * view-type="both" 
137:             */
138:            public WfResource[] get_previous_n_sequence(int max_number)
139:                    throws Exception {
140:                WfResource[] wfsshark = ((WfResourceIterator) sharkObj)
141:                        .get_previous_n_sequence(max_number);
142:                WfResourceSSHome home = null;
143:                InitialContext initialContext = EJBJNDIContext.getInstance()
144:                        .getInitialContext();
145:                home = (WfResourceSSHome) PortableRemoteObject.narrow(
146:                        initialContext
147:                                .lookup("org/enhydra/shark/ejb/WfResourceSS"),
148:                        org.enhydra.shark.ejb.WfResourceSSHome.class);
149:                int len = wfsshark.length;
150:                WfResourceSS[] remotes = new WfResourceSS[len];
151:                for (int i = 0; i < len; i++) {
152:                    remotes[i] = (WfResourceSS) (home.create(wfsshark[i]))
153:                            .getPassedEJBObject();
154:                }
155:                return remotes;
156:            }
157:
158:            /**
159:             * @ejb.interface-method
160:             *	view-type="both" 
161:             **/
162:            public EJBObject getPassedEJBObject() throws EJBException {
163:                try {
164:                    return context.getEJBObject();
165:                } catch (Exception ex) {
166:                    throw new EJBException(ex);
167:                }
168:            }
169:
170:            public void setSessionContext(SessionContext ctx)
171:                    throws EJBException, RemoteException {
172:                context = ctx;
173:            }
174:
175:            /**
176:             * @ejb:create-method
177:             */
178:            public void ejbCreate(
179:                    org.enhydra.shark.api.client.wfservice.WfResourceIterator iter) {
180:                sharkObj = iter;
181:            }
182:
183:            /* (non-Javadoc)
184:             * @see javax.ejb.SessionBean#ejbActivate()
185:             */
186:            public void ejbActivate() throws EJBException, RemoteException {
187:            }
188:
189:            /* (non-Javadoc)
190:             * @see javax.ejb.SessionBean#ejbPassivate()
191:             */
192:            public void ejbPassivate() throws EJBException, RemoteException {
193:            }
194:
195:            /* (non-Javadoc)
196:             * @see javax.ejb.SessionBean#ejbRemove()
197:             */
198:            public void ejbRemove() throws EJBException, RemoteException {
199:            }
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.