1 26 27 package org.objectweb.openccm.ir3; 28 29 37 38 public class ProvidesDef_impl 39 extends FeatureContained 40 implements org.omg.CORBA.ComponentIR.ProvidesDefOperations 41 { 42 48 49 protected InterfaceDef_ref interface_type_; 50 51 52 protected org.omg.CORBA.ExtLocalInterfaceDef ccm_facet_executor_itf_; 53 54 60 61 public 62 ProvidesDef_impl(IFR ifr, 63 Container_impl container) 64 { 65 super(ifr, container); 67 68 setServant(new org.omg.CORBA.ComponentIR.ProvidesDefPOATie(this)); 70 71 interface_type_ = new InterfaceDef_ref(this); 73 ccm_facet_executor_itf_ = null; 74 } 75 76 82 85 public org.omg.CORBA.ComponentIR.ProvidesDef 86 asProvidesDef() 87 { 88 return org.omg.CORBA.ComponentIR.ProvidesDefHelper.narrow(asObject()); 89 } 90 91 94 public org.omg.CORBA.ComponentIR.ProvidesDescription 95 describe_provides() 96 { 97 org.omg.CORBA.ComponentIR.ProvidesDescription description = 99 new org.omg.CORBA.ComponentIR.ProvidesDescription(); 100 description.name = name(); 101 description.id = id(); 102 description.defined_in = getContainerID(); 103 description.version = version(); 104 description.interface_type = interface_type().id(); 105 106 return description; 107 } 108 109 115 118 public void 119 setDescriptionValue(org.omg.CORBA.Any any) 120 { 121 org.omg.CORBA.ComponentIR.ProvidesDescriptionHelper.insert(any, describe_provides()); 123 } 124 125 131 134 protected void 135 cutDependencies() 136 { 137 if(ccm_facet_executor_itf_ != null) 139 { 140 159 ccm_facet_executor_itf_ = null; 160 } 161 162 interface_type_.cutDependency(); 164 interface_type_ = null; 165 166 super.cutDependencies(); 168 } 169 170 176 179 public org.omg.CORBA.DefinitionKind 180 def_kind() 181 { 182 return org.omg.CORBA.DefinitionKind.dk_Provides; 183 } 184 185 191 194 public org.omg.CORBA.InterfaceDef 195 interface_type() 196 { 197 return interface_type_.asInterfaceDef(); 199 } 200 201 209 public void 210 interface_type(org.omg.CORBA.InterfaceDef val) 211 { 212 interface_type_.setDependency(castToLocal(val)); 215 } 216 217 223 226 protected void 227 whenCreated() 228 { 229 if (!getIFR().getRepository().enable_mappings_) 231 return ; 232 233 235 String cont_base_id = getBaseContainerID(); 240 241 String name = "provide_" + name(); 246 String version = version(); 247 String id = cont_base_id + name + ':' + version; 248 InterfaceDef_impl container = (InterfaceDef_impl)container_; 249 container_.mapping_started_ = true; 250 container.create_operation(id, name, version, 251 interface_type_.asIDLType(), 252 org.omg.CORBA.OperationMode.OP_NORMAL, 253 new org.omg.CORBA.ParameterDescription [0], 254 new org.omg.CORBA.ExceptionDef [0], 255 new java.lang.String [0]); 256 container_.mapping_started_ = false; 257 258 cont_base_id = interface_type_.getImpl().getBaseContainerID(); 263 version = interface_type_.getImpl().version(); 264 265 name = "CCM_"+interface_type_.getImpl().name(); 266 id = cont_base_id + name + ':' + version; 267 org.omg.CORBA.Contained contained = getIFR().getRepository().lookup_mapped_id(id); 268 org.omg.CORBA.ExtLocalInterfaceDef facet_executor = null; 269 if (contained==null) 270 { 271 org.omg.CORBA.InterfaceDef [] bases = new org.omg.CORBA.InterfaceDef [1]; 275 bases[0] = interface_type(); 276 interface_type_.getImpl().container_.mapping_started_ = true; 277 facet_executor = interface_type_.getImpl().container_.create_ext_local_interface(id, name, version, bases); 278 ccm_facet_executor_itf_ = facet_executor; 279 interface_type_.getImpl().container_.mapping_started_ = false; 280 } 281 else 282 { 283 facet_executor = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow(contained); 284 } 285 286 cont_base_id = container_.getBaseContainerID(); 292 version = container_.version(); 293 294 String litf_id = cont_base_id + "CCM_" + container_.name() + ':' + version; 295 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 296 getIFR().getRepository().lookup_mapped_id(litf_id)); 297 298 cont_base_id = computeBaseID(litf_id); 299 version = litf.version(); 300 name = "get_" + name(); 301 id = cont_base_id + name + ':' + version; 302 303 litf.create_operation(id, name, version, 304 facet_executor, 305 org.omg.CORBA.OperationMode.OP_NORMAL, 306 new org.omg.CORBA.ParameterDescription [0], 307 new org.omg.CORBA.ExceptionDef [0], 308 new java.lang.String [0]); 309 } 310 } 311 | Popular Tags |