1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class ExtAttributeDef_impl 42 extends AttributeDef_impl 43 implements ExtAttributeDefOperations 44 { 45 51 52 protected ExceptionDef_ref[] get_exceptions_; 53 54 55 protected ExceptionDef_ref[] set_exceptions_; 56 57 63 66 public 67 ExtAttributeDef_impl(IFR ifr, 68 Container_impl container) 69 { 70 super(ifr, container); 72 73 setServant(new ExtAttributeDefPOATie(this)); 75 76 get_exceptions_ = null; 78 set_exceptions_ = null; 79 } 80 81 87 90 public ExtAttributeDef 91 asExtAttributeDef() 92 { 93 return ExtAttributeDefHelper.narrow(asObject()); 94 } 95 96 99 public ExtAttributeDescription 100 getExtAttributeDescription() 101 { 102 ExtAttributeDescription description = new ExtAttributeDescription(); 104 105 description.name = name(); 107 description.id = id(); 108 description.defined_in = getContainerID(); 109 description.version = version(); 110 description.type = type(); 111 description.mode = mode(); 112 description.get_exceptions = 113 ExceptionDef_impl.compute_ExcDescriptionSeq(get_exceptions_); 114 description.set_exceptions = 115 ExceptionDef_impl.compute_ExcDescriptionSeq(set_exceptions_); 116 117 return description; 118 } 119 120 126 129 public void 130 setDescriptionValue(Any any) 131 { 132 ExtAttributeDescriptionHelper.insert(any, getExtAttributeDescription()); 134 } 135 136 142 145 protected void 146 cutDependencies() 147 { 148 type_def_.cutDependency(); 150 151 mode_ = null; 152 153 ExceptionDef_ref.cutDependencies(get_exceptions_); 155 get_exceptions_ = null; 156 157 ExceptionDef_ref.cutDependencies(set_exceptions_); 159 set_exceptions_ = null; 160 161 super.cutDependencies(); 163 } 164 165 171 177 180 public ExceptionDef[] 181 get_exceptions() 182 { 183 ExceptionDef[] result = new ExceptionDef[get_exceptions_.length]; 184 185 for(int i=0; i<get_exceptions_.length; i++) 186 result[i] = get_exceptions_[i].asExceptionDef(); 187 188 return result; 189 } 190 191 194 public void 195 get_exceptions(ExceptionDef[] val) 196 { 197 ExceptionDef_impl[] exceptions = new ExceptionDef_impl[val.length]; 198 for (int i=0; i<val.length; i++) 199 exceptions[i] = castToLocal(val[i]); 200 201 203 ExceptionDef_ref[] refs = new ExceptionDef_ref[val.length]; 204 for (int i=0; i<val.length; i++) 205 refs[i] = new ExceptionDef_ref( this, exceptions[i] ); 206 207 ExceptionDef_ref.cutDependencies(get_exceptions_); 209 210 get_exceptions_ = refs; 211 } 212 213 216 public ExceptionDef[] 217 set_exceptions() 218 { 219 ExceptionDef[] result = new ExceptionDef[set_exceptions_.length]; 220 221 for(int i=0; i<set_exceptions_.length; i++) 222 result[i] = set_exceptions_[i].asExceptionDef(); 223 224 return result; 225 } 226 227 230 public void 231 set_exceptions(ExceptionDef[] val) 232 { 233 ExceptionDef_impl[] exceptions = new ExceptionDef_impl[val.length]; 234 for (int i=0; i<val.length; i++) 235 exceptions[i] = castToLocal(val[i]); 236 237 239 ExceptionDef_ref[] refs = new ExceptionDef_ref[val.length]; 240 for (int i=0; i<val.length; i++) 241 refs[i] = new ExceptionDef_ref( this, exceptions[i] ); 242 243 ExceptionDef_ref.cutDependencies(set_exceptions_); 245 246 set_exceptions_ = refs; 247 } 248 249 252 public org.omg.CORBA.ExtAttributeDescription 253 describe_attribute() 254 { 255 return getExtAttributeDescription(); 256 } 257 258 264 267 protected void 268 whenCreated() 269 { 270 if (!getIFR().getRepository().enable_mappings_) 272 return ; 273 274 if ((container_.def_kind().value()!=org.omg.CORBA.DefinitionKind._dk_Home) && 276 (container_.def_kind().value()!=org.omg.CORBA.DefinitionKind._dk_Component)) 277 return ; 278 279 281 if (container_.def_kind().value()==org.omg.CORBA.DefinitionKind._dk_Home) 283 { 284 ExtInterfaceDef_impl explicit = (ExtInterfaceDef_impl)((HomeDef_impl)container_).base_interfaces_[0].getImpl(); 288 String explicit_base_id = explicit.getBaseContainerID(); 289 String id = explicit_base_id + name() + ":" + version(); 290 291 container_.mapping_started_ = true; 292 explicit.create_ext_attribute(id, name(), version(), type_def(), mode(), 293 get_exceptions(), set_exceptions()); 294 container_.mapping_started_ = false; 295 296 String cont_base_id = container_.getBaseContainerID(); 303 String explicit_exe_id = cont_base_id + "CCM_" + container_.name() + "Explicit:" + container_.version(); 304 org.omg.CORBA.ExtLocalInterfaceDef explicit_exe = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 305 getIFR().getRepository().lookup_mapped_id(explicit_exe_id)); 306 307 id = cont_base_id + "CCM_" + container_.name() + "Explicit/" + name() + ":" + version(); 308 explicit_exe.create_ext_attribute(id, name(), version(), type_def(), mode(), 309 get_exceptions(), set_exceptions()); 310 311 } 312 else if (container_.def_kind().value()==org.omg.CORBA.DefinitionKind._dk_Component) 314 { 315 String cont_base_id = container_.getBaseContainerID(); 319 String litf_id = cont_base_id + "CCM_" + container_.name() + "_Executor:" + container_.version(); 321 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 322 getIFR().getRepository().lookup_mapped_id(litf_id)); 323 324 String id = cont_base_id + "CCM_" + container_.name() + "_Executor/" + name() + ":" + version(); 325 litf.create_ext_attribute(id, 326 name(), 327 version(), 328 type_def(), 329 mode(), 330 get_exceptions(), 331 set_exceptions()); 332 } 333 } 334 } 335 | Popular Tags |