1 26 27 package org.objectweb.openccm.Components; 28 29 38 39 public abstract class CCMHomeBase 40 extends org.omg.CORBA.LocalObject 41 implements org.omg.Components.CCMHomeOperations, 42 org.omg.Components.HomeConfigurationOperations, 43 org.objectweb.openccm.Deployment.CCMHomeLocal 44 { 45 51 protected org.objectweb.openccm.Deployment.listener.CCMHomeListener listener_; 52 53 56 protected java.util.Vector components_; 57 58 64 68 protected 69 CCMHomeBase() 70 { 71 listener_ = null; 72 org.objectweb.openccm.Deployment.listener.TheCCMHomeConfigurator.get_instance().configure_ccm_home(this); 73 components_ = new java.util.Vector (); 74 } 75 76 82 85 protected abstract java.lang.String 86 _component_uid_(); 87 88 91 protected abstract java.lang.String 92 _home_uid_(); 93 94 97 protected abstract org.objectweb.openccm.Containers.HomeServant 98 _home_servant_(); 99 100 106 111 protected final org.omg.Components.CCMObject 112 _create_with_instance(org.omg.Components.EnterpriseComponent comp) 113 { 114 org.omg.Components.CCMObject ref = null; 115 116 ref = _home_servant_().the_PCA().create_component_reference_with_instance(_home_servant_(), comp); 118 listener_.on_create(ref); 119 components_.add(ref); 121 return ref; 122 } 123 124 129 protected final org.omg.Components.CCMObject 130 _find_with_instance(org.omg.Components.EnterpriseComponent comp) 131 { 132 org.omg.Components.CCMObject ref = null; 133 134 ref = _home_servant_().the_PCA().find_component_reference_with_instance(_home_servant_(), comp); 136 return ref; 137 } 138 139 149 public void 150 add_listener (org.objectweb.openccm.Deployment.listener.CCMHomeListener listener) 151 { 152 if (listener_ == null) 153 listener_ = listener; 154 else 155 listener_.set_delegate(listener); 156 } 157 158 164 172 public final org.omg.CORBA.IRObject 173 get_component_def() 174 { 175 org.omg.CORBA.Repository ir = 177 org.objectweb.openccm.corba.TheInterfaceRepository.getRepository(); 178 179 if(ir != null) 181 { 182 throw new org.omg.CORBA.INTF_REPOS (); 183 } 184 185 return ir.lookup_id(_component_uid_()); 187 } 188 189 197 public final org.omg.CORBA.IRObject 198 get_home_def() 199 { 200 org.omg.CORBA.Repository ir = 202 org.objectweb.openccm.corba.TheInterfaceRepository.getRepository(); 203 204 if(ir != null) 206 { 207 throw new org.omg.CORBA.INTF_REPOS (); 208 } 209 210 return ir.lookup_id(_home_uid_()); 212 } 213 214 220 public void 221 remove_home() 222 throws org.omg.Components.RemoveFailure 223 { 224 227 org.omg.Components.CCMObject[] components = get_components(); 229 for(int i=0; i<components.length; i++) 230 { 231 components[i].remove(); 232 } 233 234 _home_servant_().remove(); 236 } 237 238 244 public org.omg.Components.CCMObject[] 245 get_components() 246 { 247 return (org.omg.Components.CCMObject[]) 248 components_.toArray(new org.omg.Components.CCMObject[0]); 249 } 250 251 257 263 public org.omg.Components.Deployment.Container 264 get_container() 265 { 266 return _home_servant_().the_container_base().the_container_ref(); 267 } 268 269 275 283 public final void 284 set_configurator(org.omg.Components.Configurator cfg) 285 { 286 throw new org.omg.CORBA.NO_IMPLEMENT (); 288 } 289 290 298 public final void 299 set_configuration_values(org.omg.Components.ConfigValue[] config) 300 { 301 throw new org.omg.CORBA.NO_IMPLEMENT (); 303 } 304 305 313 public final void 314 complete_component_configuration(boolean b) 315 { 316 throw new org.omg.CORBA.NO_IMPLEMENT (); 318 } 319 320 326 public final void 327 disable_home_configuration() 328 { 329 throw new org.omg.CORBA.NO_IMPLEMENT (); 331 } 332 } 333 334 335 336 337 338 339 340 341 342 343 | Popular Tags |