1 package org.enhydra.shark.corba.poa; 2 3 import org.enhydra.shark.corba.WorkflowService.WfResourceIteratorPOA; 4 import org.enhydra.shark.corba.poa.Collective; 5 import org.enhydra.shark.corba.poa.SharkCORBAUtilities; 6 import org.enhydra.shark.corba.poa.WfResourceCORBA; 7 import org.enhydra.shark.api.client.wfbase.*; 8 import org.omg.WfBase.*; 9 import org.omg.WfBase.BaseException; 10 import org.omg.WfBase.GrammarNotSupported; 11 import org.omg.WfBase.InvalidQuery; 12 import org.omg.WfBase.NameMismatch; 13 import org.omg.WorkflowModel.WfResource; 14 import org.omg.WorkflowModel.WfCreateProcessEventAuditHelper; 15 import org.omg.CORBA.ORB ; 16 import org.omg.PortableServer.POA ; 17 import org.omg.PortableServer.POAHelper ; 18 import org.omg.PortableServer.POAPackage.ServantAlreadyActive ; 19 import org.omg.PortableServer.POAPackage.WrongPolicy ; 20 import org.omg.PortableServer.POAPackage.ServantNotActive ; 21 22 28 public class WfResourceIteratorCORBA extends WfResourceIteratorPOA { 29 30 org.enhydra.shark.api.client.wfservice.WfResourceIterator myIterator; 31 32 private Collective __collective; 33 private ORB orb; 34 35 protected WfResourceIteratorCORBA(ORB orb, Collective toJoin, 36 org.enhydra.shark.api.client.wfservice.WfResourceIterator iter) throws BaseException { 37 this.orb = orb; 38 39 __collective = toJoin; 40 this.myIterator = iter; 42 } 43 44 public String query_expression() throws BaseException { 45 try { 46 return myIterator.query_expression(); 47 } catch (Exception ex) { 48 throw new BaseException(); 49 } 50 } 51 52 55 public void set_query_expression(String query) throws BaseException, 56 InvalidQuery { 57 try { 58 myIterator.set_query_expression(query); 59 } catch (org.enhydra.shark.api.client.wfbase.InvalidQuery iq) { 60 throw new InvalidQuery(); 61 } catch (Exception ex) { 62 throw new BaseException(); 63 } 64 } 65 66 public NameValue[] names_in_expression() throws BaseException { 67 try { 68 return SharkCORBAUtilities.makeCORBANameValueArray(orb, 69 myIterator.names_in_expression()); 70 } catch (Exception ex) { 71 throw new BaseException(); 72 } 73 } 74 75 public void set_names_in_expression(NameValue[] query) throws BaseException, 76 NameMismatch { 77 try { 78 myIterator.set_names_in_expression(SharkCORBAUtilities.makeMap(query)); 79 } catch (org.enhydra.shark.api.client.wfbase.NameMismatch nm) { 80 throw new NameMismatch(); 81 } catch (Exception ex) { 82 throw new BaseException(); 83 } 84 } 85 86 public String query_grammar() throws BaseException { 87 try { 88 return myIterator.query_grammar(); 89 } catch (Exception ex) { 90 throw new BaseException(); 91 } 92 } 93 94 public void set_query_grammar(String query_grammmar) throws BaseException, 95 GrammarNotSupported { 96 try { 97 myIterator.set_query_grammar(query_grammmar); 98 } catch (org.enhydra.shark.api.client.wfbase.GrammarNotSupported gns) { 99 throw new GrammarNotSupported(); 100 } catch (Exception ex) { 101 throw new BaseException(); 102 } 103 } 104 105 public int how_many() throws BaseException { 106 try { 107 return myIterator.how_many(); 108 } catch (Exception ex) { 109 throw new BaseException(); 110 } 111 } 112 113 public void goto_start() throws BaseException { 114 try { 115 myIterator.goto_start(); 116 } catch (Exception ex) { 117 throw new BaseException(); 118 } 119 } 120 121 public void goto_end() throws BaseException { 122 try { 123 myIterator.goto_end(); 124 } catch (Exception ex) { 125 throw new BaseException(); 126 } 127 } 128 129 public WfResource get_next_object() throws BaseException { 130 131 132 try { 133 WfResource wfRes = SharkCORBAUtilities.makeWfResource( new WfResourceCORBA(orb, __collective, 134 myIterator.get_next_object())); 135 __collective.__recruit(wfRes); 136 return wfRes; 137 138 } catch (org.enhydra.shark.api.client.wfbase.BaseException e) { 139 e.printStackTrace(); 140 } 141 return null; 142 143 } 144 145 public WfResource get_previous_object() throws BaseException { 146 147 148 try { 149 WfResourceCORBA impl = new WfResourceCORBA(orb, __collective, 150 myIterator.get_previous_object()); 151 WfResource wfRes = SharkCORBAUtilities.makeWfResource( impl); 152 __collective.__recruit(wfRes); 153 return wfRes; 154 } catch (org.enhydra.shark.api.client.wfbase.BaseException e) { 155 e.printStackTrace(); } 157 return null; 158 159 160 } 161 162 public WfResource[] get_next_n_sequence(int max_number) throws BaseException { 163 try { 164 return SharkCORBAUtilities.makeCORBAResources(__collective, 165 myIterator.get_next_n_sequence(max_number)); 166 } catch (Exception ex) { 167 throw new BaseException(); 168 } 169 } 170 171 public WfResource[] get_previous_n_sequence(int max_number) throws BaseException { 172 try { 173 return SharkCORBAUtilities.makeCORBAResources(__collective, 174 myIterator.get_previous_n_sequence(max_number)); 175 } catch (Exception ex) { 176 throw new BaseException(); 177 } 178 } 179 180 } | Popular Tags |