KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > SharkObjectFactory


1 package org.enhydra.shark;
2
3 import org.enhydra.shark.api.client.wfmodel.*;
4 import org.enhydra.shark.api.client.wfservice.*;
5 import org.enhydra.shark.api.internal.working.*;
6
7 import java.util.Map JavaDoc;
8 import org.enhydra.shark.api.SharkTransaction;
9 import org.enhydra.shark.api.client.wfbase.BaseException;
10 import org.enhydra.shark.api.internal.eventaudit.AssignmentEventAuditPersistenceInterface;
11 import org.enhydra.shark.api.internal.eventaudit.CreateProcessEventAuditPersistenceInterface;
12 import org.enhydra.shark.api.internal.eventaudit.DataEventAuditPersistenceInterface;
13 import org.enhydra.shark.api.internal.eventaudit.StateEventAuditPersistenceInterface;
14 import org.enhydra.shark.api.internal.instancepersistence.ActivityPersistenceInterface;
15 import org.enhydra.shark.api.internal.instancepersistence.AssignmentPersistenceInterface;
16 import org.enhydra.shark.api.internal.instancepersistence.ProcessMgrPersistenceInterface;
17 import org.enhydra.shark.api.internal.instancepersistence.ProcessPersistenceInterface;
18 import org.enhydra.shark.api.internal.instancepersistence.ResourcePersistenceInterface;
19
20 /**
21  * Factory for generating Shark core objects.
22  * @author Sasa Bojanic
23  * @version 1.0
24  */

25 public class SharkObjectFactory implements ObjectFactory {
26
27    protected SharkObjectFactory () {}
28
29    // main objects
30
public WfProcessMgrInternal createProcessMgr (
31       SharkTransaction t,
32       String JavaDoc packageId,
33       String JavaDoc version,
34       String JavaDoc procDefId) throws BaseException {
35
36       return new WfProcessMgrImpl(t,packageId,version,procDefId);
37    }
38
39    public WfProcessMgrInternal createProcessMgr (ProcessMgrPersistenceInterface po) throws BaseException {
40       return new WfProcessMgrImpl(po);
41    }
42
43    public WfProcessMgr createProcessMgrWrapper (
44       String JavaDoc userAuth,
45       String JavaDoc name)
46       throws BaseException {
47
48       return new WfProcessMgrWrapper(userAuth,name);
49    }
50
51    public WfProcessInternal createProcess (
52       SharkTransaction t,
53       WfProcessMgrInternal manager,
54       WfRequesterInternal requester,
55       String JavaDoc key) throws BaseException {
56
57       return new WfProcessImpl(t,manager,requester,key);
58    }
59
60    public WfProcessInternal createProcess (ProcessPersistenceInterface po) throws BaseException {
61       return new WfProcessImpl(po);
62    }
63
64    public WfProcess createProcessWrapper (
65       String JavaDoc userAuth,
66       String JavaDoc mgrName,
67       String JavaDoc procId) {
68
69       return new WfProcessWrapper(userAuth,mgrName,procId);
70    }
71
72    public WfRequesterInternal createDefaultRequester (String JavaDoc resUsername,WfRequester extRequester) {
73       return new WfDefaultRequester(resUsername,extRequester);
74    }
75
76    public WfRequester createRequesterWrapper (
77       String JavaDoc userAuth,
78       String JavaDoc resUsername) {
79
80       return new WfRequesterWrapper(userAuth,resUsername);
81    }
82
83    public WfActivityInternal createActivity (
84       SharkTransaction t,
85       WfProcessInternal process,
86       String JavaDoc key,
87       String JavaDoc activitySetDefId,
88       String JavaDoc activityDefId,
89       WfActivityInternal blockActivity) throws BaseException {
90
91       return new WfActivityImpl(t,process,key,activitySetDefId,activityDefId,blockActivity);
92    }
93
94    public WfActivityInternal createActivity (ActivityPersistenceInterface po,
95                                              WfProcessInternal process) throws BaseException {
96       return new WfActivityImpl(po,process);
97    }
98
99    public WfActivity createActivityWrapper (
100       String JavaDoc userAuth,
101       String JavaDoc mgrName,
102       String JavaDoc procId,
103       String JavaDoc actId) {
104
105       return new WfActivityWrapper(userAuth,mgrName,procId,actId);
106    }
107
108    public WfAssignmentInternal createAssignment (
109       SharkTransaction t,
110       WfActivityInternal activity,
111       WfResourceInternal resource)
112       throws BaseException {
113
114       return new WfAssignmentImpl(t,activity,resource);
115    }
116
117    public WfAssignmentInternal createAssignment (AssignmentPersistenceInterface po,
118                                                 WfResourceInternal res) throws BaseException {
119       return new WfAssignmentImpl(po,res);
120    }
121
122    public WfAssignment createAssignmentWrapper (
123       String JavaDoc userAuth,
124       String JavaDoc mgrName,
125       String JavaDoc procId,
126       String JavaDoc actId,
127       String JavaDoc username) {
128
129       return new WfAssignmentWrapper(userAuth,mgrName,procId,actId,username);
130    }
131
132    public WfResourceInternal createResource (
133       SharkTransaction t,
134       String JavaDoc resourceKey) throws BaseException {
135
136       return new WfResourceImpl(t, resourceKey);
137    }
138
139    public WfResourceInternal createResource (ResourcePersistenceInterface po) throws BaseException {
140       return new WfResourceImpl(po);
141    }
142
143    public WfResource createResourceWrapper (
144       String JavaDoc userAuth,
145       String JavaDoc username) {
146
147       return new WfResourceWrapper(userAuth,username);
148    }
149
150    // event audits
151
public WfAssignmentEventAuditInternal createAssignmentEventAuditWrapper (
152       SharkTransaction t,
153       WfActivityInternal activity,
154       WfResourceInternal oldRes,
155       WfResourceInternal newRes,
156       boolean isAccepted) throws BaseException {
157
158       return new WfAssignmentEventAuditWrapper(t,activity,oldRes,newRes,isAccepted);
159    }
160
161    public WfAssignmentEventAuditInternal createAssignmentEventAuditWrapper (
162       String JavaDoc userAuth,
163       AssignmentEventAuditPersistenceInterface po) throws BaseException {
164
165       return new WfAssignmentEventAuditWrapper(userAuth,po);
166    }
167
168    public WfCreateProcessEventAuditInternal createCreateProcessEventAuditWrapper (
169       SharkTransaction t,
170       WfProcessInternal process,
171       WfRequesterInternal requester) throws BaseException {
172
173       return new WfCreateProcessEventAuditWrapper(t,process,requester);
174    }
175
176    public WfCreateProcessEventAuditInternal createCreateProcessEventAuditWrapper (
177       String JavaDoc userAuth,
178       CreateProcessEventAuditPersistenceInterface po) throws BaseException {
179
180       return new WfCreateProcessEventAuditWrapper(userAuth,po);
181    }
182
183    public WfDataEventAuditInternal createDataEventAuditWrapper (
184       SharkTransaction t,
185       WfExecutionObjectInternal object,
186       String JavaDoc eventType,
187       Map JavaDoc oldData,
188       Map JavaDoc newData) throws BaseException {
189
190       return new WfDataEventAuditWrapper(t,object,eventType,oldData,newData);
191    }
192
193    public WfDataEventAuditInternal createDataEventAuditWrapper (
194       String JavaDoc userAuth,
195       DataEventAuditPersistenceInterface po) throws BaseException {
196
197       return new WfDataEventAuditWrapper(userAuth,po);
198    }
199
200    public WfStateEventAuditInternal createStateEventAuditWrapper (
201       SharkTransaction t,
202       WfExecutionObjectInternal object,
203       String JavaDoc eventType,
204       String JavaDoc oldState,
205       String JavaDoc newState) throws BaseException {
206
207       return new WfStateEventAuditWrapper(t,object,eventType,oldState,newState);
208    }
209
210    public WfStateEventAuditInternal createStateEventAuditWrapper (
211       String JavaDoc userAuth,
212       StateEventAuditPersistenceInterface po) throws BaseException {
213
214       return new WfStateEventAuditWrapper(userAuth,po);
215    }
216
217    // iterators
218
public WfProcessMgrIterator createProcessMgrIteratorWrapper (
219       SharkTransaction t,
220       String JavaDoc userAuth) throws BaseException {
221
222       return new WfProcessMgrIteratorWrapper(t,userAuth);
223    }
224
225    public WfProcessIterator createProcessIteratorWrapper (
226       SharkTransaction t,
227       String JavaDoc userAuth,
228       String JavaDoc mgrName) throws BaseException {
229
230       return new WfProcessIteratorWrapper(t,userAuth,mgrName);
231    }
232
233    public WfProcessIterator createProcessIteratorWrapper (
234       SharkTransaction t,
235       String JavaDoc userAuth,
236       String JavaDoc procId,
237       String JavaDoc actId) throws BaseException {
238
239       return new WfProcessIteratorWrapper(t,userAuth,procId,actId);
240    }
241
242    public WfProcessIterator createProcessIteratorWrapper (
243       SharkTransaction t,
244       String JavaDoc userAuth,
245       String JavaDoc username,
246       boolean ext) throws BaseException {
247
248       return new WfProcessIteratorWrapper(t,userAuth,username,true);
249    }
250
251    public WfActivityIterator createActivityIteratorWrapper (
252       SharkTransaction t,
253       String JavaDoc userAuth,
254       String JavaDoc procId) throws BaseException {
255
256       return new WfActivityIteratorWrapper(t,userAuth,procId);
257    }
258
259    public WfAssignmentIterator createAssignmentIteratorWrapper (
260       SharkTransaction t,
261       String JavaDoc userAuth,
262       String JavaDoc procId,
263       String JavaDoc actId) throws BaseException {
264
265       return new WfAssignmentIteratorWrapper(t,userAuth,procId,actId);
266    }
267
268    public WfAssignmentIterator createAssignmentIteratorWrapper (
269       SharkTransaction t,
270       String JavaDoc userAuth,
271       String JavaDoc username) throws BaseException {
272
273       return new WfAssignmentIteratorWrapper(t,userAuth,username);
274    }
275
276    public WfResourceIterator createResourceIteratorWrapper (
277       SharkTransaction t,
278       String JavaDoc userAuth) throws BaseException {
279
280       return new WfResourceIteratorWrapper(t,userAuth);
281    }
282
283    public WfEventAuditIterator createEventAuditIteratorWrapper (
284       SharkTransaction t,
285       String JavaDoc userAuth,
286       String JavaDoc procId) throws BaseException {
287
288       return new WfEventAuditIteratorWrapper(t,userAuth,procId);
289    }
290
291    public WfEventAuditIterator createEventAuditIteratorWrapper (
292       SharkTransaction t,
293       String JavaDoc userAuth,
294       String JavaDoc procId,
295       String JavaDoc actId) throws BaseException {
296
297       return new WfEventAuditIteratorWrapper(t,userAuth,procId,actId);
298    }
299
300    public AdminInterface createAdminInterface () {
301       return new Administration();
302    }
303
304    public AdminMisc createAdminMisc () {
305       return new AdminMiscImpl();
306    }
307
308    public ApplicationMap createApplicationMap () {
309       return new ApplicationMapImpl();
310    }
311
312    public ExecutionAdministration createExecutionAdministration () {
313       return new ExecutionAdmin();
314    }
315
316    public ParticipantMappingAdministration createParticipantMappingAdministration () {
317       return new ParticipantMappingsAdministrationImpl();
318    }
319
320    public ApplicationMappingAdministration createApplicationMappingAdministration () {
321       return new ApplicationMappingsAdministrationImpl();
322    }
323
324    public ScriptMappingAdministration createScriptMappingAdministration () {
325       return new ScriptMappingsAdministrationImpl();
326    }
327
328    public PackageAdministration createPackageAdministration () {
329       return new PackageAdmin();
330    }
331
332    public ParticipantMap createParticipantMap () {
333       return new ParticipantMapImpl();
334    }
335
336    public RepositoryMgr createRepositoryManager () {
337       return new RepositoryManager();
338    }
339
340    public SharkConnection createSharkConnection () {
341       return new SharkConnectionImpl();
342    }
343
344    public UserGroupAdministration createUserGroupAdministration () {
345       return new UserGroupAdmin();
346    }
347
348    public CacheAdministration createCacheAdministration () {
349       return new CacheAdmin();
350    }
351
352    public DeadlineAdministration createDeadlineAdministration () {
353       return new DeadlineAdmin();
354    }
355
356    public LimitAdministration createLimitAdministration () {
357       return new LimitAdmin();
358    }
359
360 }
361
Popular Tags