KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.corba.poa;
2
3 import org.omg.WfBase.*;
4 import org.omg.WorkflowModel.WfAssignment;
5 import org.omg.WorkflowModel.WfAssignmentIteratorPOA;
6 import org.omg.WorkflowModel.WfEventAuditIteratorHelper;
7 import org.omg.WorkflowModel.WfAssignmentHelper;
8 import org.omg.CORBA.ORB JavaDoc;
9 import org.omg.CORBA.ORBPackage.InvalidName JavaDoc;
10 import org.omg.PortableServer.POA JavaDoc;
11 import org.omg.PortableServer.POAHelper JavaDoc;
12 import org.omg.PortableServer.POAPackage.ServantAlreadyActive JavaDoc;
13 import org.omg.PortableServer.POAPackage.WrongPolicy JavaDoc;
14 import org.omg.PortableServer.POAPackage.ServantNotActive JavaDoc;
15 import org.enhydra.shark.corba.poa.Collective;
16 import org.enhydra.shark.corba.poa.SharkCORBAUtilities;
17 import org.enhydra.shark.corba.poa.WfAssignmentCORBA;
18
19 /**
20  * Iterator for assignments of activity.
21  *
22  * @author David Forslund
23  * @version 1.0
24  */

25 public class WfAssignmentIteratorCORBA extends WfAssignmentIteratorPOA {
26    //private SharkCORBAServer myServer;
27

28    org.enhydra.shark.api.client.wfmodel.WfAssignmentIterator myIterator;
29    private Collective __collective;
30     private ORB JavaDoc orb;
31
32    protected WfAssignmentIteratorCORBA(ORB JavaDoc orb, Collective toJoin,
33                                        org.enhydra.shark.api.client.wfmodel.WfAssignmentIterator iter) throws BaseException {
34       __collective = toJoin;
35       this.orb = orb;
36
37      // toJoin.__recruit(this);
38
this.myIterator = iter;
39    }
40
41    public String JavaDoc query_expression() throws BaseException {
42       try {
43          return myIterator.query_expression();
44       } catch (Exception JavaDoc ex) {
45          throw new BaseException();
46       }
47    }
48
49    public void set_query_expression(String JavaDoc query) throws BaseException,
50                                                  InvalidQuery {
51       try {
52          myIterator.set_query_expression(query);
53       } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) {
54          throw new InvalidQuery();
55       } catch (Exception JavaDoc ex) {
56          throw new BaseException();
57       }
58    }
59
60    public NameValue[] names_in_expression() throws BaseException {
61       try {
62          return SharkCORBAUtilities.makeCORBANameValueArray(orb, myIterator.names_in_expression());
63       } catch (Exception JavaDoc ex) {
64          throw new BaseException();
65       }
66    }
67
68    public void set_names_in_expression(NameValue[] query) throws BaseException,
69                                                          NameMismatch {
70       try {
71          myIterator.set_names_in_expression(SharkCORBAUtilities.makeMap(query));
72       } catch (org.enhydra.shark.api.client.wfbase.NameMismatch nm) {
73          throw new NameMismatch();
74       } catch (Exception JavaDoc ex) {
75          throw new BaseException();
76       }
77    }
78
79    public String JavaDoc query_grammar() throws BaseException {
80       try {
81          return myIterator.query_grammar();
82       } catch (Exception JavaDoc ex) {
83          throw new BaseException();
84       }
85    }
86
87    public void set_query_grammar(String JavaDoc query_grammmar) throws BaseException,
88                                                        GrammarNotSupported {
89       try {
90          myIterator.set_query_grammar(query_grammmar);
91       } catch (org.enhydra.shark.api.client.wfbase.GrammarNotSupported gns) {
92          throw new GrammarNotSupported();
93       } catch (Exception JavaDoc ex) {
94          throw new BaseException();
95       }
96    }
97
98    public int how_many() throws BaseException {
99       try {
100          return myIterator.how_many();
101       } catch (Exception JavaDoc ex) {
102          throw new BaseException();
103       }
104    }
105
106    public void goto_start() throws BaseException {
107       try {
108          myIterator.goto_start();
109       } catch (Exception JavaDoc ex) {
110          throw new BaseException();
111       }
112    }
113
114    public void goto_end() throws BaseException {
115       try {
116          myIterator.goto_end();
117       } catch (Exception JavaDoc ex) {
118          throw new BaseException();
119       }
120    }
121
122    public WfAssignment get_next_object() throws BaseException {
123       try {
124          WfAssignment assign = SharkCORBAUtilities.makeWfAssignment(new WfAssignmentCORBA(orb, __collective, myIterator.get_next_object()));
125          __collective.__recruit(assign);
126           return assign;
127       } catch (Exception JavaDoc ex) {
128          throw new BaseException();
129       }
130    }
131
132    public WfAssignment get_previous_object() throws BaseException {
133       try {
134          WfAssignment assign = SharkCORBAUtilities.makeWfAssignment( new WfAssignmentCORBA(orb, __collective,
135                                       myIterator.get_previous_object()));
136          __collective.__recruit(assign);
137           return assign;
138       } catch (Exception JavaDoc ex) {
139          throw new BaseException();
140       }
141    }
142
143    public WfAssignment[] get_next_n_sequence(int max_number) throws BaseException {
144       try {
145          return SharkCORBAUtilities.makeCORBAAssignments(__collective,
146                                                          myIterator.get_next_n_sequence(max_number));
147       } catch (Exception JavaDoc ex) {
148          throw new BaseException();
149       }
150    }
151
152    public WfAssignment[] get_previous_n_sequence(int max_number) throws BaseException {
153       try {
154          return SharkCORBAUtilities.makeCORBAAssignments(__collective,
155                                                          myIterator.get_previous_n_sequence(max_number));
156       } catch (Exception JavaDoc ex) {
157          throw new BaseException();
158       }
159    }
160
161 }
Popular Tags