KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.corba.poa;
2
3 import org.enhydra.shark.corba.WorkflowService.WfProcessMgrIteratorPOA;
4 import org.enhydra.shark.corba.poa.Collective;
5 import org.enhydra.shark.corba.poa.SharkCORBAUtilities;
6 import org.enhydra.shark.corba.poa.WfProcessMgrCORBA;
7 import org.omg.WfBase.*;
8 import org.omg.WorkflowModel.WfProcessMgr;
9 import org.omg.WorkflowModel.WfProcessMgrHelper;
10 import org.omg.CORBA.ORB JavaDoc;
11 import org.omg.PortableServer.POA JavaDoc;
12 import org.omg.PortableServer.POAHelper JavaDoc;
13 import org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc;
14 import org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
15 import org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc;
16
17 /**
18  * Iterator for engine's process managers.
19  *
20  * @author David Forslund
21  * @version 1.0
22  */

23 public class WfProcessMgrIteratorCORBA extends WfProcessMgrIteratorPOA {
24
25    org.enhydra.shark.api.client.wfservice.WfProcessMgrIterator myIterator;
26    private Collective __collective;
27     private ORB JavaDoc orb;
28
29
30    protected WfProcessMgrIteratorCORBA(ORB JavaDoc orb, Collective toJoin,
31                                        org.enhydra.shark.api.client.wfservice.WfProcessMgrIterator iter) throws BaseException {
32       __collective = toJoin;
33       this.orb = orb;
34       this.myIterator = iter;
35
36        // activate the object.
37
// toJoin.__recruit(this);
38
}
39
40    public String JavaDoc query_expression() throws BaseException {
41       try {
42          return myIterator.query_expression();
43       } catch (Exception JavaDoc ex) {
44          throw new BaseException();
45       }
46    }
47
48    /*
49     * The following names may be used: packageId, processDefinitionId,
50     * name, category and version.
51     */

52    public void set_query_expression(String JavaDoc query) throws BaseException,
53                                                  InvalidQuery {
54       try {
55          myIterator.set_query_expression(query);
56       } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) {
57          throw new InvalidQuery();
58       } catch (Exception JavaDoc ex) {
59          throw new BaseException();
60       }
61    }
62
63    public NameValue[] names_in_expression() throws BaseException {
64       try {
65          return SharkCORBAUtilities.makeCORBANameValueArray(orb, myIterator.names_in_expression());
66       } catch (Exception JavaDoc ex) {
67          throw new BaseException();
68       }
69    }
70
71    public void set_names_in_expression(NameValue[] query) throws BaseException,
72                                                          NameMismatch {
73       try {
74          myIterator.set_names_in_expression(SharkCORBAUtilities.makeMap(query));
75       } catch (org.enhydra.shark.api.client.wfbase.NameMismatch nm) {
76          throw new NameMismatch();
77       } catch (Exception JavaDoc ex) {
78          throw new BaseException();
79       }
80    }
81
82    public String JavaDoc query_grammar() throws BaseException {
83       try {
84          return myIterator.query_grammar();
85       } catch (Exception JavaDoc ex) {
86          throw new BaseException();
87       }
88    }
89
90    public void set_query_grammar(String JavaDoc query_grammmar) throws BaseException,
91                                                        GrammarNotSupported {
92       try {
93          myIterator.set_query_grammar(query_grammmar);
94       } catch (org.enhydra.shark.api.client.wfbase.GrammarNotSupported gns) {
95          throw new GrammarNotSupported();
96       } catch (Exception JavaDoc ex) {
97          throw new BaseException();
98       }
99    }
100
101    public int how_many() throws BaseException {
102       try {
103          return myIterator.how_many();
104       } catch (Exception JavaDoc ex) {
105          throw new BaseException();
106       }
107    }
108
109    public void goto_start() throws BaseException {
110       try {
111          myIterator.goto_start();
112       } catch (Exception JavaDoc ex) {
113          throw new BaseException();
114       }
115    }
116
117    public void goto_end() throws BaseException {
118       try {
119          myIterator.goto_end();
120       } catch (Exception JavaDoc ex) {
121          throw new BaseException();
122       }
123    }
124
125    public WfProcessMgr get_next_object() throws BaseException {
126       try {
127           WfProcessMgr proc = SharkCORBAUtilities.makeWfProcessMgr( new WfProcessMgrCORBA(orb, __collective, myIterator.get_next_object()));
128           __collective.__recruit(proc);
129           return proc;
130       } catch (Exception JavaDoc ex) {
131          throw new BaseException();
132       }
133    }
134
135    public WfProcessMgr get_previous_object() throws BaseException {
136       try {
137          WfProcessMgr proc = SharkCORBAUtilities.makeWfProcessMgr( new WfProcessMgrCORBA(orb, __collective,
138                                       myIterator.get_previous_object()));
139           __collective.__recruit(proc);
140           return proc;
141       } catch (Exception JavaDoc ex) {
142          throw new BaseException();
143       }
144    }
145
146    public WfProcessMgr[] get_next_n_sequence(int max_number) throws BaseException {
147       try {
148          return SharkCORBAUtilities.makeCORBAProcessMgrs(orb, __collective,
149                                                          myIterator.get_next_n_sequence(max_number));
150       } catch (Exception JavaDoc ex) {
151          throw new BaseException();
152       }
153    }
154
155    public WfProcessMgr[] get_previous_n_sequence(int max_number) throws BaseException {
156       try {
157          return SharkCORBAUtilities.makeCORBAProcessMgrs(orb, __collective,
158                                                          myIterator.get_previous_n_sequence(max_number));
159       } catch (Exception JavaDoc ex) {
160          throw new BaseException();
161       }
162    }
163
164 }
Popular Tags