1 26 27 package org.objectweb.openccm.ir3; 28 29 37 38 public class PublishesDef_impl 39 extends EventPortDef_impl 40 implements org.omg.CORBA.ComponentIR.PublishesDefOperations 41 { 42 48 54 57 public 58 PublishesDef_impl(IFR ifr, 59 Container_impl container) 60 { 61 super(ifr, container); 63 64 setServant(new org.omg.CORBA.ComponentIR.PublishesDefPOATie(this)); 66 } 67 68 74 77 public org.omg.CORBA.ComponentIR.PublishesDef 78 asPublishesDef() 79 { 80 return org.omg.CORBA.ComponentIR.PublishesDefHelper.narrow(asObject()); 81 } 82 83 89 92 public org.omg.CORBA.DefinitionKind 93 def_kind() 94 { 95 return org.omg.CORBA.DefinitionKind.dk_Publishes; 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 String version = version(); 134 135 String name = "subscribe_" + 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::ExceededConnectionLimit")); 157 org.omg.CORBA.IDLType cookie = org.omg.CORBA.IDLTypeHelper.narrow( 158 getIFR().getRepository().lookup("::Components::Cookie")); 159 160 container_.mapping_started_ = true; 161 container.create_operation(id, name, version, 162 cookie, 163 org.omg.CORBA.OperationMode.OP_NORMAL, 164 params, excs, new java.lang.String [0]); 165 container_.mapping_started_ = false; 166 167 name = "unsubscribe_" + name(); 172 id = cont_base_id + name + ":" + version; 173 params = new org.omg.CORBA.ParameterDescription [1]; 174 params[0] = new org.omg.CORBA.ParameterDescription (); 175 params[0].name = "ck"; 176 params[0].type_def = cookie; 177 params[0].type = params[0].type_def.type(); 178 params[0].mode = org.omg.CORBA.ParameterMode.PARAM_IN; 179 excs = new org.omg.CORBA.ExceptionDef [1]; 180 excs[0] = org.omg.CORBA.ExceptionDefHelper.narrow( 181 getIFR().getRepository().lookup("::Components::InvalidConnection")); 182 183 container_.mapping_started_ = true; 184 container.create_operation(id, name, version, 185 consumer_itf, 186 org.omg.CORBA.OperationMode.OP_NORMAL, 187 params, excs, new java.lang.String [0]); 188 container_.mapping_started_ = false; 189 190 cont_base_id = container_.getBaseContainerID(); 199 version = container_.version(); 200 201 String litf_id = cont_base_id + "CCM_" + container_.name() + "_Context:" + version; 202 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 203 getIFR().getRepository().lookup_mapped_id(litf_id)); 204 205 cont_base_id = computeBaseID(litf_id); 206 version = litf.version(); 207 name = "push_" + name(); 208 id = cont_base_id + name + ":" + version; 209 210 params = new org.omg.CORBA.ParameterDescription [1]; 211 params[0] = new org.omg.CORBA.ParameterDescription (); 212 params[0].name = "event"; 213 params[0].type_def = event_.getImpl().asIDLType(); 214 params[0].type = params[0].type_def.type(); 215 params[0].mode = org.omg.CORBA.ParameterMode.PARAM_IN; 216 litf.create_operation(id, name, version, 217 getIFR().getRepository().get_primitive( 218 org.omg.CORBA.PrimitiveKind.pk_void), 219 org.omg.CORBA.OperationMode.OP_NORMAL, 220 params, 221 new org.omg.CORBA.ExceptionDef [0], 222 new java.lang.String [0]); 223 } 224 } 225 | Popular Tags |