1 package org.enhydra.shark.corba.poa; 2 3 import org.omg.WfBase.*; 4 import org.omg.WorkflowModel.*; 5 import org.omg.CORBA.ORB ; 6 import org.omg.PortableServer.POA ; 7 import org.omg.PortableServer.POAHelper ; 8 import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; 9 import org.omg.PortableServer.POAPackage.WrongPolicy ; 10 import org.omg.PortableServer.POAPackage.ServantNotActive ; 11 import org.enhydra.shark.corba.poa.Collective; 12 import org.enhydra.shark.corba.poa.SharkCORBAUtilities; 13 import org.enhydra.shark.corba.poa.WfProcessCORBA; 14 15 21 public class WfProcessIteratorCORBA extends WfProcessIteratorPOA { 22 23 org.enhydra.shark.api.client.wfmodel.WfProcessIterator myIterator; 24 25 private Collective __collective; 26 private ORB orb; 27 28 protected WfProcessIteratorCORBA(ORB orb, Collective toJoin, 29 org.enhydra.shark.api.client.wfmodel.WfProcessIterator iter) throws BaseException { 30 __collective = toJoin; 31 this.orb = orb; 32 33 this.myIterator = iter; 35 } 36 37 public String query_expression() throws BaseException { 38 try { 39 return myIterator.query_expression(); 40 } catch (Exception ex) { 41 throw new BaseException(); 42 } 43 } 44 45 51 public void set_query_expression(String query) throws BaseException, 52 InvalidQuery { 53 try { 54 myIterator.set_query_expression(query); 55 } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) { 56 throw new InvalidQuery(); 57 } catch (Exception ex) { 58 throw new BaseException(); 59 } 60 } 61 62 public NameValue[] names_in_expression() throws BaseException { 63 try { 64 return SharkCORBAUtilities.makeCORBANameValueArray(orb, 65 myIterator.names_in_expression()); 66 } catch (Exception 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 ex) { 78 throw new BaseException(); 79 } 80 } 81 82 public String query_grammar() throws BaseException { 83 try { 84 return myIterator.query_grammar(); 85 } catch (Exception ex) { 86 throw new BaseException(); 87 } 88 } 89 90 public void set_query_grammar(String 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 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 ex) { 105 throw new BaseException(); 106 } 107 } 108 109 public void goto_start() throws BaseException { 110 try { 111 myIterator.goto_start(); 112 } catch (Exception ex) { 113 throw new BaseException(); 114 } 115 } 116 117 public void goto_end() throws BaseException { 118 try { 119 myIterator.goto_end(); 120 } catch (Exception ex) { 121 throw new BaseException(); 122 } 123 } 124 125 public WfProcess get_next_object() throws BaseException { 126 try { 127 WfProcess proc = SharkCORBAUtilities.makeWfProcess(new WfProcessCORBA(orb, __collective, myIterator.get_next_object())); 128 __collective.__recruit(proc); 129 return proc; 130 } catch (Exception ex) { 131 throw new BaseException(); 132 } 133 } 134 135 public WfProcess get_previous_object() throws BaseException { 136 try { 137 WfProcess proc = SharkCORBAUtilities.makeWfProcess(new WfProcessCORBA(orb, __collective, 138 myIterator.get_previous_object())); 139 __collective.__recruit(proc); 140 return proc; 141 } catch (Exception ex) { 142 throw new BaseException(); 143 } 144 } 145 146 public WfProcess[] get_next_n_sequence(int max_number) throws BaseException { 147 try { 148 return SharkCORBAUtilities.makeCORBAProcesses(__collective, 149 myIterator.get_next_n_sequence(max_number)); 150 } catch (Exception ex) { 151 throw new BaseException(); 152 } 153 } 154 155 public WfProcess[] get_previous_n_sequence(int max_number) throws BaseException { 156 try { 157 return SharkCORBAUtilities.makeCORBAProcesses(__collective, 158 myIterator.get_previous_n_sequence(max_number)); 159 } catch (Exception ex) { 160 throw new BaseException(); 161 } 162 } 163 164 } | Popular Tags |