1 package org.enhydra.shark.corba.poa; 2 3 import org.omg.WfBase.BaseException; 4 import org.omg.WorkflowModel.*; 5 import org.omg.CORBA.ORB ; 6 import org.enhydra.shark.corba.poa.Collective; 7 import org.enhydra.shark.corba.poa.SharkCORBAUtilities; 8 import org.enhydra.shark.corba.poa.WfProcessIteratorCORBA; 9 10 11 14 public class WfRequesterCORBA extends WfRequesterPOA { 15 16 org.enhydra.shark.api.client.wfmodel.WfRequester reqInternal; 17 18 private Collective __collective; 19 private ORB orb; 20 21 public WfRequesterCORBA(ORB orb, Collective toJoin, 22 org.enhydra.shark.api.client.wfmodel.WfRequester reqInternal) { 23 __collective = toJoin; 24 25 this.orb = orb; 26 this.reqInternal = reqInternal; 28 } 29 30 33 public int how_many_performer() throws BaseException { 34 try { 35 return reqInternal.how_many_performer(); 36 } catch (Exception ex) { 37 throw new BaseException(); 38 } 39 } 40 41 44 public WfProcessIterator get_iterator_performer() throws BaseException { 45 46 try { 47 WfProcessIterator iter = SharkCORBAUtilities.makeWfProcessIterator(new WfProcessIteratorCORBA(orb, __collective, 48 reqInternal.get_iterator_performer())); 49 __collective.__recruit(iter); 50 return iter; 51 52 } catch (Exception ex) { 53 throw new BaseException(); 54 } 55 56 } 57 58 63 public WfProcess[] get_sequence_performer(int max_number) throws BaseException { 64 try { 65 return SharkCORBAUtilities.makeCORBAProcesses(__collective, reqInternal.get_sequence_performer(max_number)); 66 } catch (Exception ex) { 67 throw new BaseException(); 68 } 69 } 70 71 76 public boolean is_member_of_performer(WfProcess member) throws BaseException { 77 try { 78 boolean ret = false; 79 WfProcess[] perfs = SharkCORBAUtilities.makeCORBAProcesses(__collective, reqInternal.get_sequence_performer(0)); 80 if (perfs != null) { 81 for (int i = 0; i < perfs.length; i++) { 82 WfProcess perf = perfs[i]; 83 if (perf.key().equals(member.key())) { 84 ret = true; 85 break; 86 } 87 } 88 } 89 return ret; 90 } catch (Exception ex) { 91 throw new BaseException(); 92 } 93 } 94 95 public void receive_event(WfEventAudit event) throws BaseException, 96 InvalidPerformer { 97 throw new BaseException(); 98 } 99 100 } 101 102 | Popular Tags |