1 package org.enhydra.shark; 2 3 import java.util.List ; 4 import org.enhydra.shark.api.SharkTransaction; 5 import org.enhydra.shark.api.client.wfbase.BaseException; 6 import org.enhydra.shark.api.client.wfmodel.InvalidPerformer; 7 import org.enhydra.shark.api.client.wfmodel.WfEventAudit; 8 import org.enhydra.shark.api.client.wfmodel.WfRequester; 9 import org.enhydra.shark.api.internal.working.WfProcessInternal; 10 import org.enhydra.shark.api.internal.working.WfRequesterInternal; 11 12 17 public class WfDefaultRequester implements WfRequesterInternal { 18 19 private String resourceUsername; 20 21 private WfRequester externalRequester; 22 23 protected WfDefaultRequester (String resourceUsername,WfRequester extRequester) { 24 this.resourceUsername=resourceUsername; 25 this.externalRequester=extRequester; 26 } 27 28 public String getResourceRequesterUsername (SharkTransaction t) throws BaseException { 29 return resourceUsername; 30 } 31 32 public WfRequester getExternalRequester(SharkTransaction t) throws BaseException { 33 return externalRequester; 34 } 35 36 39 public void receive_event (SharkTransaction t,WfEventAudit event,WfProcessInternal process) throws BaseException, InvalidPerformer { 40 if (externalRequester!=null) { 42 try { 43 externalRequester.receive_event(t,event); 44 } catch (Throwable thr) {} 45 } 46 } 47 48 52 private List getPerformerIds (SharkTransaction t) throws BaseException { 53 try { 54 return SharkEngineManager.getInstance().getInstancePersistenceManager().getResourceRequestersProcessIds(resourceUsername,t); 55 } catch (Exception ex) { 56 throw new BaseException(ex); 57 } 58 } 59 60 public String toString () { 61 return "Default requester - "+resourceUsername; 62 } 63 64 } 65 66 | Popular Tags |