1 28 29 30 package org.objectweb.ccm.runtime; 31 32 import org.objectweb.corba.runtime.*; 33 34 37 public class ServiceImpl 38 extends org.omg.CORBA.LocalObject 39 implements Service 40 { 41 private String _service_id; 43 private String _impl_uuid; 44 private CORBAServiceRef _corba_service_ref; 45 private java.util.Hashtable _internals; 46 private java.util.Hashtable _policy_factories; 47 private String _orb_init; 48 private org.coach.ECA.CallControllerFactory _controller_factory; 49 private org.coach.ECA.ServiceInitializer _service_initializer; 50 private CallControllerInitInfoImpl _controller_iinfo; 51 52 public 54 ServiceImpl(String sid, String uuid) 55 { 56 _service_id = sid; 57 _impl_uuid = uuid; 58 _corba_service_ref = null; 59 _internals = new java.util.Hashtable (); 60 _policy_factories = new java.util.Hashtable (); 61 _orb_init = null; 62 _controller_factory = null; 63 64 _controller_iinfo = null; 65 } 66 67 71 private CallControllerInitInfoImpl 72 getControllerIInfo() 73 { 74 if (_controller_iinfo==null) { 75 _controller_iinfo = new CallControllerInitInfoImpl(); 77 } 80 81 return _controller_iinfo; 82 } 83 84 88 final public String 89 service_id() 90 { 91 return _service_id; 92 } 93 94 final public String 95 implementation_uuid() 96 { 97 return _impl_uuid; 98 } 99 100 final public org.omg.CORBA.Object 101 get_service_internal(String sid) 102 { 103 return (org.omg.CORBA.Object )_internals.get(sid); 104 } 105 106 final public Policy 107 create_policy(String ptype, String pvalue) 108 { 109 org.coach.ECA.PolicyFactory pfact = (org.coach.ECA.PolicyFactory)_policy_factories.get(ptype); 111 org.omg.CORBA.Policy pol = pfact.create_policy(ptype, pvalue); 112 113 PolicyImpl policy = new PolicyImpl(this, pol); 115 116 118 return policy; 120 } 121 122 126 final public CORBAServiceRef 127 getCorbaServiceRef() 128 { 129 return _corba_service_ref; 130 } 131 132 final public void 133 setCorbaServiceRef(CORBAServiceRef csref) 134 { 135 _corba_service_ref = csref; 136 } 137 138 final public org.coach.ECA.ServiceInitializer 139 getServiceInitializer() 140 { 141 return _service_initializer; 142 } 143 144 final public void 145 setServiceInitializer(org.coach.ECA.ServiceInitializer sinit) 146 { 147 _service_initializer = sinit; 148 } 149 150 final public void 151 addServiceInternal(String sid, org.omg.CORBA.Object internal) 152 { 153 _internals.put(sid, internal); 154 } 155 156 final public void 157 addPolicyFactory(String ptype, org.coach.ECA.PolicyFactory fact) 158 { 159 _policy_factories.put(ptype, fact); 160 } 161 162 final public String 163 getORBInitializer() 164 { 165 return _orb_init; 166 } 167 168 final public void 169 setORBInitializer(String orbinit) 170 { 171 _orb_init = orbinit; 172 } 173 174 final public void 175 setCallControllerFactory(org.coach.ECA.CallControllerFactory fact) 176 { 177 _controller_factory = fact; 178 } 179 180 final public org.coach.ECA.CallController 181 createCallController(Policy pol) 182 { 183 return _controller_factory.create_call_controller(pol.corba_policy(), getControllerIInfo()); 184 } 185 } 186 | Popular Tags |