1 26 27 package org.objectweb.openccm.ir3; 28 29 37 38 public class ConsumesDef_impl 39 extends EventPortDef_impl 40 implements org.omg.CORBA.ComponentIR.ConsumesDefOperations 41 { 42 48 54 57 public 58 ConsumesDef_impl(IFR ifr, 59 Container_impl container) 60 { 61 super(ifr, container); 63 64 setServant(new org.omg.CORBA.ComponentIR.ConsumesDefPOATie(this)); 66 } 67 68 74 77 public org.omg.CORBA.ComponentIR.ConsumesDef 78 asConsumesDef() 79 { 80 return org.omg.CORBA.ComponentIR.ConsumesDefHelper.narrow(asObject()); 81 } 82 83 89 92 public org.omg.CORBA.DefinitionKind 93 def_kind() 94 { 95 return org.omg.CORBA.DefinitionKind.dk_Consumes; 96 } 97 98 104 110 116 119 protected void 120 whenCreated() 121 { 122 if (!getIFR().getRepository().enable_mappings_) 124 return ; 125 126 128 String cont_base_id = getBaseContainerID(); 133 134 139 org.omg.CORBA.ExtInterfaceDef event_consumer = null; 141 String name = event_.asEventDef().name() + "Consumer"; 142 String version = event_.asEventDef().version(); 143 String id = computeIDWithoutVersion(event_.asEventDef().id()); 144 id = id + "Consumer:" + version; 145 146 event_consumer = org.omg.CORBA.ExtInterfaceDefHelper.narrow( 147 getIFR().getRepository().lookup_mapped_id(id)); 148 149 name = "get_consumer_" + name(); 150 version = version(); 151 id = cont_base_id + name + ":" + version; 152 InterfaceDef_impl container = (InterfaceDef_impl)container_; 153 154 container_.mapping_started_ = true; 155 container.create_operation(id, name, version, 156 event_consumer, 157 org.omg.CORBA.OperationMode.OP_NORMAL, 158 new org.omg.CORBA.ParameterDescription [0], 159 new org.omg.CORBA.ExceptionDef [0], 160 new java.lang.String [0]); 161 container_.mapping_started_ = false; 162 163 cont_base_id = container_.getBaseContainerID(); 172 version = container_.version(); 173 174 String litf_id = cont_base_id + "CCM_" + container_.name() + ":" + version; 175 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 176 getIFR().getRepository().lookup_mapped_id(litf_id)); 177 178 cont_base_id = computeBaseID(litf_id); 179 version = litf.version(); 180 name = "push_" + name(); 181 id = cont_base_id + name + ":" + version; 182 183 org.omg.CORBA.ParameterDescription [] params = new org.omg.CORBA.ParameterDescription [1]; 184 params[0] = new org.omg.CORBA.ParameterDescription (); 185 params[0].name = "event"; 186 params[0].type_def = event_.getImpl().asIDLType(); 187 params[0].type = params[0].type_def.type(); 188 params[0].mode = org.omg.CORBA.ParameterMode.PARAM_IN; 189 litf.create_operation(id, name, version, 190 getIFR().getRepository().get_primitive( 191 org.omg.CORBA.PrimitiveKind.pk_void), 192 org.omg.CORBA.OperationMode.OP_NORMAL, 193 params, 194 new org.omg.CORBA.ExceptionDef [0], 195 new java.lang.String [0]); 196 } 197 } 198 | Popular Tags |