1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class AttributeDef_impl 42 extends FeatureContained 43 implements AttributeDefOperations 44 { 45 51 52 protected IDLType_ref type_def_; 53 54 55 protected AttributeMode mode_; 56 57 63 66 public 67 AttributeDef_impl(IFR ifr, 68 Container_impl container) 69 { 70 super(ifr, container); 72 73 setServant(new AttributeDefPOATie(this)); 75 76 type_def_ = new IDLType_ref(this); 78 79 mode_ = AttributeMode.ATTR_NORMAL; 81 } 82 83 89 92 public AttributeDef 93 asAttributeDef() 94 { 95 return AttributeDefHelper.narrow(asObject()); 96 } 97 98 101 public AttributeDescription 102 getAttributeDescription() 103 { 104 AttributeDescription description = new AttributeDescription(); 106 107 description.name = name(); 109 description.id = id(); 110 description.defined_in = getContainerID(); 111 description.version = version(); 112 description.type = type(); 113 description.mode = mode(); 114 115 return description; 116 } 117 118 124 127 public void 128 setDescriptionValue(Any any) 129 { 130 AttributeDescriptionHelper.insert(any, getAttributeDescription()); 132 } 133 134 140 143 protected void 144 cutDependencies() 145 { 146 type_def_.cutDependency(); 148 149 mode_ = null; 150 151 super.cutDependencies(); 153 } 154 155 161 164 public DefinitionKind 165 def_kind() 166 { 167 return DefinitionKind.dk_Attribute; 168 } 169 170 176 179 public TypeCode 180 type() 181 { 182 return type_def_.recursiveType(); 184 } 185 186 189 public IDLType 190 type_def() 191 { 192 return type_def_.asIDLType(); 194 } 195 196 199 public void 200 type_def(IDLType val) 201 { 202 type_def_.setDependency( castToLocal(val) ); 205 } 206 207 210 public AttributeMode 211 mode() 212 { 213 return mode_; 214 } 215 216 219 public void 220 mode(AttributeMode val) 221 { 222 mode_ = val; 223 } 224 225 231 234 protected void 235 whenCreated() 236 { 237 if (!getIFR().getRepository().enable_mappings_) 239 return ; 240 241 if ((container_.def_kind().value()!=org.omg.CORBA.DefinitionKind._dk_Home) && 243 (container_.def_kind().value()!=org.omg.CORBA.DefinitionKind._dk_Component)) 244 return ; 245 246 248 if (container_.def_kind().value()==org.omg.CORBA.DefinitionKind._dk_Home) 250 { 251 ExtInterfaceDef_impl explicit = (ExtInterfaceDef_impl)((HomeDef_impl)container_).base_interfaces_[0].getImpl(); 255 String explicit_base_id = explicit.getBaseID(); 256 String id = explicit_base_id + name() + ":" + version(); 257 258 container_.mapping_started_ = true; 259 explicit.create_ext_attribute(id, name(), version(), type_def(), mode(), 260 new org.omg.CORBA.ExceptionDef [0], 261 new org.omg.CORBA.ExceptionDef [0]); 262 container_.mapping_started_ = false; 263 264 String cont_base_id = container_.getBaseContainerID(); 271 String explicit_exe_id = cont_base_id + "CCM_" + container_.name() + "Explicit:" + container_.version(); 272 org.omg.CORBA.ExtLocalInterfaceDef explicit_exe = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 273 getIFR().getRepository().lookup_mapped_id(explicit_exe_id)); 274 275 id = cont_base_id + "CCM_" + container_.name() + "Explicit/" + name() + ":" + version(); 276 explicit_exe.create_ext_attribute(id, name(), version(), type_def(), mode(), 277 new org.omg.CORBA.ExceptionDef [0], 278 new org.omg.CORBA.ExceptionDef [0]); 279 280 } 281 else if (container_.def_kind().value()==org.omg.CORBA.DefinitionKind._dk_Component) 283 { 284 String cont_base_id = container_.getBaseContainerID(); 288 String litf_id = cont_base_id + "CCM_" + container_.name() + "_Executor:" + container_.version(); 290 org.omg.CORBA.ExtLocalInterfaceDef litf = org.omg.CORBA.ExtLocalInterfaceDefHelper.narrow( 291 getIFR().getRepository().lookup_mapped_id(litf_id)); 292 293 String id = cont_base_id + "CCM_" + container_.name() + "_Executor/" + name() + ":" + version(); 294 litf.create_ext_attribute(id, 295 name(), 296 version(), 297 type_def(), 298 mode(), 299 new org.omg.CORBA.ExceptionDef [0], 300 new org.omg.CORBA.ExceptionDef [0]); 301 } 302 } 303 } 304 | Popular Tags |