1 26 27 package org.objectweb.openccm.ir3; 28 29 37 38 public class EmitsDef_impl 39 extends EventPortDef_impl 40 implements org.omg.CORBA.ComponentIR.EmitsDefOperations 41 { 42 48 54 57 public 58 EmitsDef_impl(IFR ifr, 59 Container_impl container) 60 { 61 super(ifr, container); 63 64 setServant(new org.omg.CORBA.ComponentIR.EmitsDefPOATie(this)); 66 } 67 68 74 77 public org.omg.CORBA.ComponentIR.EmitsDef 78 asEmitsDef() 79 { 80 return org.omg.CORBA.ComponentIR.EmitsDefHelper.narrow(asObject()); 81 } 82 83 89 92 public org.omg.CORBA.DefinitionKind 93 def_kind() 94 { 95 return org.omg.CORBA.DefinitionKind.dk_Emits; 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 String version = version(); 140 String name = "connect_" + name(); 141 String id = cont_base_id + name + ":" + version; 142 InterfaceDef_impl container = (InterfaceDef_impl)container_; 143 String cons_id = computeIDWithoutVersion(event_.asEventDef().id()); 144 cons_id = cons_id + "Consumer:"+ event_.asEventDef().version(); 145 146 org.omg.CORBA.IDLType consumer_itf = org.omg.CORBA.IDLTypeHelper.narrow( 147 getIFR().getRepository().lookup_mapped_id(cons_id)); 148 org.omg.CORBA.ParameterDescription [] params = new org.omg.CORBA.ParameterDescription [1]; 149 params[0] = new org.omg.CORBA.ParameterDescription (); 150 params[0].name = "consumer"; 151 params[0].type_def = consumer_itf; 152 params[0].type = params[0].type_def.type(); 153 params[0].mode = org.omg.CORBA.ParameterMode.PARAM_IN; 154 org.omg.CORBA.ExceptionDef [] excs = new org.omg.CORBA.ExceptionDef [1]; 155 excs[0] = org.omg.CORBA.ExceptionDefHelper.narrow( 156 getIFR().getRepository().lookup("::Components::AlreadyConnected")); 157 158 container_.mapping_started_ = true; 159 container.create_operation(id, name, version, 160 getIFR().getRepository().get_primitive( 161 org.omg.CORBA.PrimitiveKind.pk_void), 162 org.omg.CORBA.OperationMode.OP_NORMAL, 163 params, excs, new java.lang.String [0]); 164 container_.mapping_started_ = false; 165 166 name = "disconnect_" + name(); 171 id = cont_base_id + name + ":" + version; 172 excs = new org.omg.CORBA.ExceptionDef [1]; 173 excs[0] = org.omg.CORBA.ExceptionDefHelper.narrow( 174 getIFR().getRepository().lookup("::Components::NoConnection")); 175 176 container_.mapping_started_ = true; 177 container.create_operation(id, name, version, 178 consumer_itf, 179 org.omg.CORBA.OperationMode.OP_NORMAL, 180 new org.omg.CORBA.ParameterDescription [0], 181 excs, new java.lang.String [0]); 182 container_.mapping_started_ = false; 183 184 cont_base_id = container_.getBaseContainerID(); 193 version = container_.version(); 194 195 String litf_id = cont_base_id + "CCM_" + container_.name() + "_Context:" + version; 196 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 197 getIFR().getRepository().lookup_mapped_id(litf_id)); 198 199 cont_base_id = computeBaseID(litf_id); 200 version = litf.version(); 201 name = "push_" + name(); 202 id = cont_base_id + name + ":" + version; 203 204 params = new org.omg.CORBA.ParameterDescription [1]; 205 params[0] = new org.omg.CORBA.ParameterDescription (); 206 params[0].name = "event"; 207 params[0].type_def = event_.getImpl().asIDLType(); 208 params[0].type = params[0].type_def.type(); 209 params[0].mode = org.omg.CORBA.ParameterMode.PARAM_IN; 210 litf.create_operation(id, name, version, 211 getIFR().getRepository().get_primitive( 212 org.omg.CORBA.PrimitiveKind.pk_void), 213 org.omg.CORBA.OperationMode.OP_NORMAL, 214 params, 215 new org.omg.CORBA.ExceptionDef [0], 216 new java.lang.String [0]); 217 } 218 } 219 | Popular Tags |