KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corba > WfRequesterCORBA


1 package org.enhydra.shark.corba;
2
3 import org.omg.WfBase.BaseException;
4 import org.omg.WorkflowModel.*;
5
6 /**
7  * WfRequesterImpl - Workflow Requester implementation
8  */

9 public class WfRequesterCORBA extends _WfRequesterImplBase {
10
11    org.enhydra.shark.api.client.wfmodel.WfRequester reqInternal;
12
13    private Collective __collective;
14
15    public WfRequesterCORBA(Collective toJoin,
16                            org.enhydra.shark.api.client.wfmodel.WfRequester reqInternal) {
17       __collective = toJoin;
18       toJoin.__recruit(this);
19       this.reqInternal = reqInternal;
20    }
21
22    /**
23     * Gets the number of processes.
24     */

25    public int how_many_performer() throws BaseException {
26       try {
27          return reqInternal.how_many_performer();
28       } catch (Exception JavaDoc ex) {
29          throw new BaseException();
30       }
31    }
32
33    /**
34     * Gets an iterator of processes.
35     */

36    public WfProcessIterator get_iterator_performer() throws BaseException {
37       try {
38          return new WfProcessIteratorCORBA(__collective,
39                                            reqInternal.get_iterator_performer());
40       } catch (Exception JavaDoc ex) {
41          throw new BaseException();
42       }
43    }
44
45    /**
46     * A list of processes
47     *
48     * @return List of WfProcess objects.
49     */

50    public WfProcess[] get_sequence_performer(int max_number) throws BaseException {
51       try {
52          return SharkCORBAUtilities.makeCORBAProcesses(__collective, reqInternal.get_sequence_performer(max_number));
53       } catch (Exception JavaDoc ex) {
54          throw new BaseException();
55       }
56    }
57
58    /**
59     * Checks if a WfProcess is associated with this requester object
60     *
61     * @return true if the process is found.
62     */

63    public boolean is_member_of_performer(WfProcess member) throws BaseException {
64       try {
65          boolean ret = false;
66          WfProcess[] perfs = SharkCORBAUtilities.makeCORBAProcesses(__collective, reqInternal.get_sequence_performer(0));
67          if (perfs != null) {
68             for (int i = 0; i < perfs.length; i++) {
69                WfProcess perf = perfs[i];
70                if (perf.key().equals(member.key())) {
71                   ret = true;
72                   break;
73                }
74             }
75          }
76          return ret;
77       } catch (Exception JavaDoc ex) {
78          throw new BaseException();
79       }
80    }
81
82    public void receive_event(WfEventAudit event) throws BaseException,
83                                                 InvalidPerformer {
84       throw new BaseException();
85    }
86
87 }
88
89
Popular Tags