1 package org.enhydra.shark.corba; 2 3 import org.enhydra.shark.corba.ExpressionBuilders.*; 4 import org.enhydra.shark.corba.WorkflowService.ConnectFailed; 5 import org.enhydra.shark.corba.WorkflowService.NotConnected; 6 import org.enhydra.shark.corba.WorkflowService._ExpressionBuilderManagerImplBase; 7 import org.omg.CORBA.ORB ; 8 import org.omg.WfBase.BaseException; 9 10 15 public class ExpressionBuilderMgrCORBA extends _ExpressionBuilderManagerImplBase implements 16 Collective{ 17 18 org.enhydra.shark.api.client.wfservice.ExpressionBuilderManager myEBM; 19 private SharkCORBAServer myServer; 20 private Collective __collective; 21 22 public ExpressionBuilderMgrCORBA (SharkCORBAServer server, org.enhydra.shark.api.client.wfservice.ExpressionBuilderManager ebm) { 23 this.myEBM=ebm; 24 this.myServer = server; 25 if (myServer.trackObjects) { 26 __collective = new Collective.CollectiveCORBA(); 27 } 28 } 29 30 public void connect(String userId, String password, String engineName, String scope) throws BaseException, ConnectFailed { 31 try { 32 if (!myServer.validateUser(userId,password)) { 33 throw new ConnectFailed("Connection failed, invalid username or password"); 34 } 35 } catch (ConnectFailed cf) { 36 throw cf; 37 } catch (Exception ex) { 38 throw new BaseException(); 39 } 40 } 41 42 public void disconnect() throws BaseException, NotConnected { 43 this.__disband(this._orb()); 44 } 45 46 public ActivityIteratorExpressionBuilder getActivityIteratorExpressionBuilder () { 47 ActivityIteratorExpressionBuilderCORBA ret = new ActivityIteratorExpressionBuilderCORBA(myEBM.getActivityIteratorExpressionBuilder()); 48 this.__recruit(ret); 49 return ret; 50 } 51 52 public AssignmentIteratorExpressionBuilder getAssignmentIteratorExpressionBuilder () { 53 AssignmentIteratorExpressionBuilderCORBA ret = new AssignmentIteratorExpressionBuilderCORBA(myEBM.getAssignmentIteratorExpressionBuilder()); 54 this.__recruit(ret); 55 return ret; 56 } 57 58 public EventAuditIteratorExpressionBuilder getEventAuditIteratorExpressionBuilder () { 59 throw new RuntimeException ("Currently not implemented !"); 60 } 62 63 public ProcessIteratorExpressionBuilder getProcessIteratorExpressionBuilder () { 64 ProcessIteratorExpressionBuilderCORBA ret = new ProcessIteratorExpressionBuilderCORBA(myEBM.getProcessIteratorExpressionBuilder()); 65 this.__recruit(ret); 66 return ret; 67 } 68 69 public ProcessMgrIteratorExpressionBuilder getProcessMgrIteratorExpressionBuilder () { 70 ProcessMgrIteratorExpressionBuilderCORBA ret = new ProcessMgrIteratorExpressionBuilderCORBA(myEBM.getProcessMgrIteratorExpressionBuilder()); 71 this.__recruit(ret); 72 return ret; 73 } 74 75 public ResourceIteratorExpressionBuilder getResourceIteratorExpressionBuilder () { 76 ResourceIteratorExpressionBuilderCORBA ret = new ResourceIteratorExpressionBuilderCORBA(myEBM.getResourceIteratorExpressionBuilder()); 77 this.__recruit(ret); 78 return ret; 79 } 80 81 public void __recruit(org.omg.CORBA.Object obj) { 82 if (myServer.trackObjects) 83 __collective.__recruit(obj); 84 } 85 86 public void __leave(org.omg.CORBA.Object obj) { 87 if (myServer.trackObjects) 88 __collective.__leave(obj); 89 } 90 91 public void __disband(ORB _orb) { 92 if (myServer.trackObjects) { 93 __collective.__disband(_orb); 94 } 95 this._orb().disconnect(this); 96 } 97 } 98 | Popular Tags |