KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corba > poa > ExecutionAdminCORBA


1 package org.enhydra.shark.corba.poa;
2
3 import org.enhydra.shark.api.common.SharkConstants;
4 import org.enhydra.shark.corba.WorkflowService.*;
5 import org.enhydra.shark.corba.poa.Collective;
6 import org.omg.CORBA.ORB JavaDoc;
7 import org.omg.WfBase.*;
8 import org.omg.WorkflowModel.*;
9 import org.omg.PortableServer.POA JavaDoc;
10 import org.omg.PortableServer.POAHelper JavaDoc;
11 import org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc;
12 import org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
13 import org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc;
14
15 /**
16  * The client interface through which client accesses the engine
17  * objects, and performs the various actions on engine.
18  *
19  * @author David Forslund
20  */

21 public class ExecutionAdminCORBA extends ExecutionAdministrationPOA implements Collective {
22     private SharkCORBAServer myServer;
23     org.enhydra.shark.api.client.wfservice.ExecutionAdministration myExecAdmin;
24     private WfProcessMgrIterator wfProcessMgrIterator = null;
25     private WfResourceIterator wfResourceIterator = null;
26     private WfProcessIterator wfProcessIterator = null;
27     private WfAssignmentIterator wfAssignmentIterator = null;
28     private WfActivityIterator wfActivityIterator = null;
29
30     ExecutionAdminCORBA(SharkCORBAServer theServer, org.enhydra.shark.api.client.wfservice.ExecutionAdministration ea) {
31         this.myServer = theServer;
32         this.myExecAdmin = ea;
33         if (myServer.trackObjects) {
34             __collective = new Collective.CollectiveCORBA();
35         }
36
37
38     }
39
40     /**
41      * connect to the engine and reset iterators
42      *
43      * @param userId
44      * @param password
45      * @param engineName
46      * @param scope
47      * @throws BaseException
48      * @throws ConnectFailed
49      */

50     public void connect(String JavaDoc userId,
51                         String JavaDoc password,
52                         String JavaDoc engineName,
53                         String JavaDoc scope) throws BaseException, ConnectFailed {
54         try {
55             myExecAdmin.connect(userId, password, engineName, scope);
56         } catch (org.enhydra.shark.api.client.wfservice.ConnectFailed cf) {
57             throw new ConnectFailed();
58         } catch (Exception JavaDoc ex) {
59             throw new BaseException();
60         }
61     }
62
63     public void disconnect() throws BaseException, NotConnected {
64         try {
65             myExecAdmin.disconnect();
66         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
67             throw new NotConnected(nc.getMessage());
68         } catch (Exception JavaDoc ex) {
69             throw new BaseException();
70         } finally {
71             this.__disband(this._orb());
72         }
73     }
74
75     public void shutdown() throws BaseException, NotConnected {
76         myServer.shutdown();
77     }
78
79     public void removeProcessRequester(String JavaDoc procId) throws BaseException, NotConnected {
80         try {
81             myExecAdmin.getProcess(procId).set_requester(null);
82             WfLinkingRequesterForCORBA.removeCORBARequester(procId);
83         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
84             throw new NotConnected(nc.getMessage());
85         } catch (Exception JavaDoc ex) {
86             throw new BaseException();
87         }
88     }
89
90     public WfProcessMgrIterator get_iterator_processmgr() throws BaseException,
91             NotConnected {
92         if (wfProcessMgrIterator == null) {
93             try {
94                 wfProcessMgrIterator = SharkCORBAUtilities.makeWfProcessMgrIterator(new WfProcessMgrIteratorCORBA(myServer.getBoundORB(), this,
95                         myExecAdmin.get_iterator_processmgr()));
96                 return wfProcessMgrIterator;
97             } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
98                 throw new NotConnected(nc.getMessage());
99             } catch (Exception JavaDoc ex) {
100                 throw new BaseException();
101             }
102         } else
103             return wfProcessMgrIterator;
104     }
105
106     public WfProcessMgr[] get_sequence_processmgr(int max_number) throws BaseException,
107             NotConnected {
108         try {
109             return SharkCORBAUtilities.makeCORBAProcessMgrs(myServer.getBoundORB(), this,
110                     myExecAdmin.get_sequence_processmgr(max_number));
111         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
112             throw new NotConnected(nc.getMessage());
113         } catch (Exception JavaDoc ex) {
114             throw new BaseException();
115         }
116     }
117
118     public WfResourceIterator get_iterator_resource() throws BaseException,
119             NotConnected {
120         if (wfResourceIterator != null) return wfResourceIterator;
121         try {
122             wfResourceIterator = SharkCORBAUtilities.makeWfResourceIterator(new WfResourceIteratorCORBA(myServer._orb(), this,
123                     myExecAdmin.get_iterator_resource()));
124             return wfResourceIterator;
125         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
126             throw new NotConnected(nc.getMessage());
127         } catch (Exception JavaDoc ex) {
128             throw new BaseException();
129         }
130     }
131
132     public WfResource[] get_sequence_resource(int max_number) throws BaseException,
133             NotConnected {
134         try {
135             return SharkCORBAUtilities.makeCORBAResources(this,
136                     myExecAdmin.get_sequence_resource(max_number));
137         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
138             throw new NotConnected(nc.getMessage());
139         } catch (Exception JavaDoc ex) {
140             throw new BaseException();
141         }
142     }
143
144     public NameValue[] getLoggedUsers() throws BaseException, NotConnected {
145         try {
146             return SharkCORBAUtilities.makeCORBANameValueArray(myServer.getBoundORB(),
147                     myExecAdmin.getLoggedUsers());
148         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
149             throw new NotConnected(nc.getMessage());
150         } catch (Exception JavaDoc ex) {
151             throw new BaseException();
152         }
153     }
154
155     public void startActivity(String JavaDoc procId, String JavaDoc blockActId, String JavaDoc actDefId) throws BaseException,
156             NotConnected {
157         try {
158             myExecAdmin.startActivity(procId, blockActId, actDefId);
159         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
160             throw new NotConnected(nc.getMessage());
161         } catch (Exception JavaDoc ex) {
162             throw new BaseException();
163         }
164     }
165
166     public WfProcessMgr getProcessMgrByName(String JavaDoc name) throws BaseException,
167             NotConnected {
168         try {
169             WfProcessMgr mgr = SharkCORBAUtilities.makeWfProcessMgr(new WfProcessMgrCORBA(myServer._orb(), this,
170                     myExecAdmin.getProcessMgr(name)));
171             this.__recruit(mgr);
172             return mgr;
173         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
174             throw new NotConnected(nc.getMessage());
175         } catch (Exception JavaDoc ex) {
176             throw new BaseException();
177         }
178     }
179
180     public WfProcessMgr getProcessMgrByXPDLDefinition(String JavaDoc pkgId,
181                                                       String JavaDoc pDefId) throws BaseException,
182             NotConnected {
183         try {
184              WfProcessMgr mgr = SharkCORBAUtilities.makeWfProcessMgr(new WfProcessMgrCORBA(myServer._orb(), this,
185                     myExecAdmin.getProcessMgr(pkgId, pDefId)));
186             this.__recruit(mgr);
187             return mgr;
188         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
189             throw new NotConnected(nc.getMessage());
190         } catch (Exception JavaDoc ex) {
191             throw new BaseException();
192         }
193     }
194
195     public NameValueInfo[] getProcessMgrInputSignatureByMgrName(String JavaDoc name) throws BaseException,
196             NotConnected {
197         try {
198             return SharkCORBAUtilities.makeCORBANameValueInfoArray(myExecAdmin.getProcessMgrInputSignature(name));
199         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
200             throw new NotConnected(nc.getMessage());
201         } catch (Exception JavaDoc ex) {
202             throw new BaseException();
203         }
204     }
205
206     public NameValueInfo[] getProcessMgrInputSignatureByXPDLDefinition(String JavaDoc pkgId,
207                                                                        String JavaDoc pDefId) throws BaseException,
208             NotConnected {
209         try {
210             return SharkCORBAUtilities.makeCORBANameValueInfoArray(myExecAdmin.getProcessMgrInputSignature(pkgId,
211                     pDefId));
212         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
213             throw new NotConnected(nc.getMessage());
214         } catch (Exception JavaDoc ex) {
215             throw new BaseException();
216         }
217     }
218
219     public NameValueInfo[] getProcessMgrInputSignatureByXPDLDefinitionWithVersion(String JavaDoc pkgId,
220                                                                                   String JavaDoc pkgVer,
221                                                                                   String JavaDoc pDefId) throws BaseException,
222             NotConnected {
223         try {
224             return SharkCORBAUtilities.makeCORBANameValueInfoArray(myExecAdmin.getProcessMgrInputSignature(pkgId,
225                     pkgVer,
226                     pDefId));
227         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
228             throw new NotConnected(nc.getMessage());
229         } catch (Exception JavaDoc ex) {
230             throw new BaseException();
231         }
232     }
233
234     public WfProcess getProcess(String JavaDoc procId) throws BaseException,
235             NotConnected {
236         try {
237             WfProcess proc = SharkCORBAUtilities.makeWfProcess(new WfProcessCORBA(myServer.getBoundORB(), this, myExecAdmin.getProcess(procId)));
238             this.__recruit(proc);
239             return proc;
240         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
241             throw new NotConnected(nc.getMessage());
242         } catch (Exception JavaDoc ex) {
243             throw new BaseException();
244         }
245     }
246
247     public WfActivity getActivity(String JavaDoc procId, String JavaDoc actId) throws BaseException,
248             NotConnected {
249         try {
250            WfActivity activity = SharkCORBAUtilities.makeWfActivity(new WfActivityCORBA(myServer.getBoundORB(), this, myExecAdmin.getActivity(procId,
251                     actId)));
252             this.__recruit(activity);
253             return activity;
254         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
255             throw new NotConnected(nc.getMessage());
256         } catch (Exception JavaDoc ex) {
257             throw new BaseException();
258         }
259     }
260
261     public WfResource getResource(String JavaDoc username) throws BaseException,
262             NotConnected {
263         try {
264             WfResource wfRes = SharkCORBAUtilities.makeWfResource(new WfResourceCORBA(myServer.getBoundORB(), this,
265                     myExecAdmin.getResource(username)));
266             __recruit(wfRes);
267             return wfRes;
268         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
269             throw new NotConnected(nc.getMessage());
270         } catch (Exception JavaDoc ex) {
271             throw new BaseException();
272         }
273     }
274
275     public WfAssignment getAssignment(String JavaDoc procId,
276                                       String JavaDoc actId,
277                                       String JavaDoc username) throws BaseException,
278             NotConnected {
279         try {
280             WfAssignment wfAss = SharkCORBAUtilities.makeWfAssignment(new WfAssignmentCORBA(myServer.getBoundORB(), this,
281                     myExecAdmin.getAssignment(procId,
282                             actId,
283                             username)));
284             __recruit(wfAss);
285             return wfAss;
286         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
287             throw new NotConnected(nc.getMessage());
288         } catch (Exception JavaDoc ex) {
289             throw new BaseException();
290         }
291     }
292
293     public WfAssignment getAssignmentById(String JavaDoc procId, String JavaDoc assId) throws BaseException,
294             NotConnected {
295         try {
296             WfAssignment wfAss = SharkCORBAUtilities.makeWfAssignment(new WfAssignmentCORBA(myServer.getBoundORB(), this,
297                     myExecAdmin.getAssignment(procId, assId)));
298             __recruit(wfAss);
299             return wfAss;
300         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
301             throw new NotConnected(nc.getMessage());
302         } catch (Exception JavaDoc ex) {
303             throw new BaseException();
304         }
305     }
306
307     public void reevaluateAssignments() throws BaseException, NotConnected {
308         try {
309             myExecAdmin.reevaluateAssignments();
310         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
311             throw new NotConnected(nc.getMessage());
312         } catch (Exception JavaDoc ex) {
313             throw new BaseException();
314         }
315     }
316
317     public void reevaluateAssignmentsForPkg(String JavaDoc pkgId) throws BaseException,
318             NotConnected {
319         try {
320             myExecAdmin.reevaluateAssignments(pkgId);
321         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
322             throw new NotConnected(nc.getMessage());
323         } catch (Exception JavaDoc ex) {
324             throw new BaseException();
325         }
326     }
327
328     public void reevaluateAssignmentsForProcessDefinition(String JavaDoc pkgId,
329                                                           String JavaDoc pDefId) throws BaseException,
330             NotConnected {
331         try {
332             myExecAdmin.reevaluateAssignments(pkgId, pDefId);
333         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
334             throw new NotConnected(nc.getMessage());
335         } catch (Exception JavaDoc ex) {
336             throw new BaseException();
337         }
338     }
339
340     public void reevaluateAssignmentsForActivityDefinition(String JavaDoc pkgId,
341                                                            String JavaDoc pDefId,
342                                                            String JavaDoc aDefId) throws BaseException,
343             NotConnected {
344         try {
345             myExecAdmin.reevaluateAssignments(pkgId, pDefId, aDefId);
346         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
347             throw new NotConnected(nc.getMessage());
348         } catch (Exception JavaDoc ex) {
349             throw new BaseException();
350         }
351     }
352
353     public WfCreateProcessEventAudit getCreateProcessHistory(String JavaDoc procId) throws BaseException,
354             NotConnected {
355         WfCreateProcessEventAudit ret = null;
356         try {
357             String JavaDoc query = "event_type.equals(\""
358                     + SharkConstants.EVENT_PROCESS_CREATED + "\")";
359             WfCreateProcessEventAuditCORBA impl = new WfCreateProcessEventAuditCORBA(myServer.getBoundORB(), this,
360                     (org.enhydra.shark.api.client.wfmodel.WfCreateProcessEventAudit) myExecAdmin.getProcess(procId)
361                     .get_iterator_history(query,
362                             null)
363                     .get_next_object());
364             myServer._poa().activate_object(impl);
365             ret = WfCreateProcessEventAuditHelper.narrow(myServer._poa().servant_to_reference(impl));
366             __recruit(ret);
367         } catch (ServantAlreadyActive JavaDoc servantAlreadyActive) {
368             servantAlreadyActive.printStackTrace();
369         } catch (WrongPolicy JavaDoc wrongPolicy) {
370             wrongPolicy.printStackTrace();
371         } catch (ServantNotActive JavaDoc servantNotActive) {
372             servantNotActive.printStackTrace();
373
374
375         } catch (Exception JavaDoc ex) {
376             throw new BaseException();
377         }
378         return ret;
379     }
380
381     public WfDataEventAudit[] getProcessSequenceDataHistory(String JavaDoc procId,
382                                                             int max_number) throws BaseException,
383             NotConnected {
384         try {
385             String JavaDoc query = "event_type.equals(\""
386                     + SharkConstants.EVENT_PROCESS_CONTEXT_CHANGED
387                     + "\")";
388             return SharkCORBAUtilities.makeCORBADataEventAudits(this,
389                     myExecAdmin.getProcess(procId)
390                     .get_iterator_history(query,
391                             null)
392                     .get_next_n_sequence(0));
393         } catch (Exception JavaDoc ex) {
394             throw new BaseException();
395         }
396     }
397
398     public WfStateEventAudit[] getProcessSequenceStateHistory(String JavaDoc procId,
399                                                               int max_number) throws BaseException,
400             NotConnected {
401         try {
402             String JavaDoc query = "event_type.equals(\""
403                     + SharkConstants.EVENT_PROCESS_STATE_CHANGED + "\")";
404             return SharkCORBAUtilities.makeCORBAStateEventAudits(this,
405                     myExecAdmin.getProcess(procId)
406                     .get_iterator_history(query,
407                             null)
408                     .get_next_n_sequence(0));
409         } catch (Exception JavaDoc ex) {
410             throw new BaseException();
411         }
412     }
413
414     public WfAssignmentEventAudit[] getSequenceAssignmentHistory(String JavaDoc procId,
415                                                                  String JavaDoc actId,
416                                                                  int max_number) throws BaseException,
417             NotConnected {
418         try {
419             String JavaDoc query = "event_type.equals(\""
420                     + SharkConstants.EVENT_ACTIVITY_ASSIGNMENT_CHANGED
421                     + "\")";
422             return SharkCORBAUtilities.makeCORBAAssignmentEventAudits(this,
423                     myExecAdmin.getActivity(procId,
424                             actId)
425                     .get_iterator_history(query,
426                             null)
427                     .get_next_n_sequence(0));
428         } catch (Exception JavaDoc ex) {
429             throw new BaseException();
430         }
431     }
432
433     public WfDataEventAudit[] getActivitySequenceDataHistory(String JavaDoc procId,
434                                                              String JavaDoc actId,
435                                                              int max_number) throws BaseException,
436             NotConnected {
437         try {
438             String JavaDoc query = "event_type.equals(\""
439                     + SharkConstants.EVENT_ACTIVITY_CONTEXT_CHANGED
440                     + "\") || " + "event_type.equals(\""
441                     + SharkConstants.EVENT_ACTIVITY_RESULT_CHANGED
442                     + "\")";
443             return SharkCORBAUtilities.makeCORBADataEventAudits(this,
444                     myExecAdmin.getActivity(procId,
445                             actId)
446                     .get_iterator_history(query,
447                             null)
448                     .get_next_n_sequence(0));
449         } catch (Exception JavaDoc ex) {
450             throw new BaseException();
451         }
452     }
453
454     public WfStateEventAudit[] getActivitySequenceStateHistory(String JavaDoc procId,
455                                                                String JavaDoc actId,
456                                                                int max_number) throws BaseException,
457             NotConnected {
458         try {
459             String JavaDoc query = "event_type.equals(\""
460                     + SharkConstants.EVENT_ACTIVITY_STATE_CHANGED + "\")";
461             return SharkCORBAUtilities.makeCORBAStateEventAudits(this,
462                     myExecAdmin.getActivity(procId,
463                             actId)
464                     .get_iterator_history(query,
465                             null)
466                     .get_next_n_sequence(0));
467         } catch (Exception JavaDoc ex) {
468             throw new BaseException();
469         }
470     }
471
472     public void deleteClosedProcesses() throws BaseException, NotConnected {
473         try {
474             myExecAdmin.deleteClosedProcesses();
475         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
476             throw new NotConnected(nc.getMessage());
477         } catch (Exception JavaDoc ex) {
478             throw new BaseException();
479         }
480     }
481
482     public void deleteClosedProcessesForPkg(String JavaDoc pkgId) throws BaseException,
483             NotConnected {
484         try {
485             myExecAdmin.deleteClosedProcesses(pkgId);
486         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
487             throw new NotConnected(nc.getMessage());
488         } catch (Exception JavaDoc ex) {
489             throw new BaseException();
490         }
491     }
492
493     public void deleteClosedProcessesForMgr(String JavaDoc mgrName) throws BaseException,
494             NotConnected {
495         try {
496             myExecAdmin.deleteClosedProcessesForMgr(mgrName);
497         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
498             throw new NotConnected(nc.getMessage());
499         } catch (Exception JavaDoc ex) {
500             throw new BaseException();
501         }
502     }
503
504     public void deleteClosedProcessesForPkgWithVersion(String JavaDoc pkgId,
505                                                        String JavaDoc pkgVer) throws BaseException,
506             NotConnected {
507         try {
508             myExecAdmin.deleteClosedProcessesWithVersion(pkgId, pkgVer);
509         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
510             throw new NotConnected(nc.getMessage());
511         } catch (Exception JavaDoc ex) {
512             throw new BaseException();
513         }
514     }
515
516     public void deleteClosedProcessesForProcessDefinition(String JavaDoc pkgId,
517                                                           String JavaDoc pDefId) throws BaseException,
518             NotConnected {
519         try {
520             myExecAdmin.deleteClosedProcesses(pkgId, pDefId);
521         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
522             throw new NotConnected(nc.getMessage());
523         } catch (Exception JavaDoc ex) {
524             throw new BaseException();
525         }
526     }
527
528     public void deleteClosedProcess(String JavaDoc procId) throws BaseException,
529             NotConnected {
530         try {
531             myExecAdmin.deleteClosedProcess(procId);
532         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
533             throw new NotConnected(nc.getMessage());
534         } catch (Exception JavaDoc ex) {
535             throw new BaseException();
536         }
537     }
538
539     public String JavaDoc[] deleteClosedProcessesMultiTrans(int instancesPerTransaction,
540                                                     int failuresToIgnore) throws BaseException,
541             NotConnected {
542         try {
543             return myExecAdmin.deleteClosedProcesses(instancesPerTransaction,
544                     failuresToIgnore);
545         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
546             throw new NotConnected(nc.getMessage());
547         } catch (Exception JavaDoc ex) {
548             throw new BaseException();
549         }
550     }
551
552     public String JavaDoc[] deleteClosedProcessesForMgrMultiTrans(String JavaDoc mgrName,
553                                                           int instancesPerTransaction,
554                                                           int failuresToIgnore) throws BaseException,
555             NotConnected {
556         try {
557             return myExecAdmin.deleteClosedProcessesForMgr(mgrName,
558                     instancesPerTransaction,
559                     failuresToIgnore);
560         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
561             throw new NotConnected(nc.getMessage());
562         } catch (Exception JavaDoc ex) {
563             throw new BaseException();
564         }
565     }
566
567     public NameValue[] getProcessContext(String JavaDoc processId,
568                                          String JavaDoc[] variablesDefIds) throws BaseException,
569             NotConnected {
570         try {
571             return SharkCORBAUtilities.makeCORBANameValueArray(myServer.getBoundORB(),
572                     myExecAdmin.getProcessContext(processId,
573                             variablesDefIds));
574         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
575             throw new NotConnected(nc.getMessage());
576         } catch (Exception JavaDoc ex) {
577             throw new BaseException();
578         }
579     }
580
581     public NameValue[] getActivityContext(String JavaDoc processId,
582                                           String JavaDoc actId,
583                                           String JavaDoc[] variablesDefIds) throws BaseException,
584             NotConnected {
585         try {
586             return SharkCORBAUtilities.makeCORBANameValueArray(myServer.getBoundORB(),
587                     myExecAdmin.getActivityContext(processId,
588                             actId,
589                             variablesDefIds));
590         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
591             throw new NotConnected(nc.getMessage());
592         } catch (Exception JavaDoc ex) {
593             throw new BaseException();
594         }
595     }
596
597     public WfAssignmentIterator get_iterator_assignment() throws BaseException,
598             NotConnected {
599         if (wfAssignmentIterator != null) return wfAssignmentIterator;
600         try {
601             wfAssignmentIterator = SharkCORBAUtilities.makeWfAssignmentIterator(new WfAssignmentIteratorCORBA(myServer.getBoundORB(), this,
602                     myExecAdmin.get_iterator_assignment()));
603             return wfAssignmentIterator;
604         } catch (Exception JavaDoc ex) {
605             throw new BaseException();
606         }
607
608     }
609
610     public WfProcessIterator get_iterator_process() throws BaseException,
611             NotConnected {
612         if (wfProcessIterator != null) return wfProcessIterator;
613         try {
614             wfProcessIterator = SharkCORBAUtilities.makeWfProcessIterator(new WfProcessIteratorCORBA(myServer._orb(), this,
615                     myExecAdmin.get_iterator_process()));
616             return wfProcessIterator;
617
618         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
619             throw new NotConnected(nc.getMessage());
620         } catch (Exception JavaDoc ex) {
621             throw new BaseException();
622         }
623
624     }
625
626     public WfActivityIterator get_iterator_activity() throws BaseException,
627             NotConnected {
628         if (wfActivityIterator != null) return wfActivityIterator;
629         try {
630             wfActivityIterator = SharkCORBAUtilities.makeWfActivityIterator(new WfActivityIteratorCORBA(myServer.getBoundORB(), this,
631                     myExecAdmin.get_iterator_activity()));
632             return wfActivityIterator;
633
634         } catch (org.enhydra.shark.api.client.wfservice.NotConnected nc) {
635             throw new NotConnected(nc.getMessage());
636         } catch (Exception JavaDoc ex) {
637             throw new BaseException();
638         }
639
640     }
641
642     Collective __collective;
643
644     public void __recruit(org.omg.CORBA.Object JavaDoc obj) {
645         if (myServer.trackObjects) {
646             __collective.__recruit(obj);
647         }
648     }
649
650     public void __leave(org.omg.CORBA.Object JavaDoc obj) {
651
652         if (myServer.trackObjects)
653             __collective.__leave(obj);
654     }
655
656     public void __disband(ORB JavaDoc _orb) {
657         if (myServer.trackObjects) {
658             __collective.__disband(_orb);
659         }
660       // try {
661
_this()._release();
662       // } catch (BaseException e) {
663
// e.printStackTrace();
664
// } catch (NotConnected notConnected) {
665
// notConnected.printStackTrace();
666
// }
667

668     }
669
670     public void doneWith(org.omg.CORBA.Object JavaDoc toDisconnect) {
671         myServer.doneWith(toDisconnect);
672        // System.out.println("calling doneWith from ExecutionAdminCORBA on "+toDisconnect.toString());
673
__leave(toDisconnect);
674     }
675 }
Popular Tags