1 28 29 package org.objectweb.openccm.Containers.MetaInformation; 30 31 import org.omg.Components.InvalidName; 32 33 36 public class ComponentInstanceImpl 37 extends InstanceImpl 38 implements ComponentInstance { 39 40 private InterfaceInstance _equivalent_interface; 41 private InterfaceInstanceList _supported_interfaces; 42 43 private AttributeInstanceList _attributes; 44 private FacetPortInstanceList _facets; 45 private ReceptaclePortInstanceList _receptacles; 46 private ConsumerPortInstanceList _consumers; 47 private EmitterPortInstanceList _emitters; 48 private PublisherPortInstanceList _publishers; 49 50 public ComponentInstanceImpl() 51 { 52 _attributes = new AttributeInstanceListImpl(); 53 _facets = new FacetPortInstanceListImpl(); 54 _receptacles = new ReceptaclePortInstanceListImpl(); 55 _consumers = new ConsumerPortInstanceListImpl(); 56 _emitters = new EmitterPortInstanceListImpl(); 57 _publishers = new PublisherPortInstanceListImpl(); 58 59 _equivalent_interface = null; 60 _supported_interfaces = new InterfaceInstanceListImpl(); 61 } 62 63 64 67 public InterfaceInstance equivalent_interface() 68 { 69 return _equivalent_interface; 70 } 71 72 75 public void equivalent_interface(InterfaceInstance value) 76 { 77 _equivalent_interface = value; 78 } 79 80 83 public InterfaceInstanceList supported_interface() 84 { 85 return _supported_interfaces; 86 } 87 88 91 public void supported_interface(InterfaceInstanceList value) 92 { 93 _supported_interfaces = value; 94 } 95 96 99 public AttributeInstanceList attribute_instance_list() 100 { 101 return _attributes; 102 } 103 104 107 public void attribute_instance_list(AttributeInstanceList value) 108 { 109 _attributes = value; 110 } 111 112 115 public FacetPortInstanceList facet_port_instance_list() 116 { 117 return _facets; 118 } 119 120 123 public void facet_port_instance_list(FacetPortInstanceList value) 124 { 125 _facets = value; 126 } 127 128 131 public ReceptaclePortInstanceList receptacle_port_instance_list() 132 { 133 return _receptacles; 134 } 135 136 139 public void receptacle_port_instance_list(ReceptaclePortInstanceList value) 140 { 141 _receptacles = value; 142 } 143 144 147 public ConsumerPortInstanceList consumer_port_instance_list() 148 { 149 return _consumers; 150 } 151 152 155 public void consumer_port_instance_list(ConsumerPortInstanceList value) 156 { 157 _consumers = value; 158 } 159 160 163 public EmitterPortInstanceList emitter_port_instance_list() 164 { 165 return _emitters; 166 } 167 168 171 public void emitter_port_instance_list(EmitterPortInstanceList value) 172 { 173 _emitters = value; 174 } 175 176 179 public PublisherPortInstanceList publisher_port_instance_list() 180 { 181 return _publishers; 182 } 183 184 187 public void publisher_port_instance_list(PublisherPortInstanceList value) 188 { 189 _publishers = value; 190 } 191 192 196 198 public FacetPortInstance create_facet_port_instance(String name) 199 { 200 ComponentType _ctype = (ComponentType) this.type_reference(); 201 FacetPortType _fpt = null; 202 try 203 { 204 _fpt = _ctype.facet_port_type_list().get_facet_port_type(name); 205 } 206 catch (InvalidName e) 207 { 208 System.err.println("Error : unbale to find facet '" +name+ "' for component"); 209 return null; 210 } 211 FacetPortInstance _fpi = new FacetPortInstanceImpl(); 212 _fpi.type_reference(_fpt); 213 _fpi.related_instance_kind(instance_kind.COMPONENT_INSTANCE); 214 _fpi.instance_reference(this); 215 _fpi.object_ref(null); 216 217 return _fpi; 218 } 219 220 222 public ReceptaclePortInstance create_receptacle_port_instance(String name) 223 { 224 ComponentType _ctype = (ComponentType) this.type_reference(); 225 ReceptaclePortType _rpt = null; 226 try 227 { 228 _rpt = _ctype.receptacle_port_type_list().get_receptacle_port_type(name); 229 } 230 catch (InvalidName e) 231 { 232 System.err.println("Error : unbale to find receptacle '" +name+ "' for component"); 233 return null; 234 } 235 ReceptaclePortInstance _rpi = new ReceptaclePortInstanceImpl(); 236 _rpi.type_reference(_rpt); 237 _rpi.related_instance_kind(instance_kind.COMPONENT_INSTANCE); 238 _rpi.instance_reference(this); 239 _rpi.object_ref(null); 240 241 return _rpi; 242 } 243 244 246 public ConsumerPortInstance create_consumer_port_instance(String name) 247 { 248 ComponentType _ctype = (ComponentType) this.type_reference(); 249 ConsumerPortType _cpt; 250 try 251 { 252 _cpt = _ctype.consumer_port_type_list().get_consumer_port_type(name); 253 } 254 catch (InvalidName e) 255 { 256 System.err.println("Error : unbale to find consumer '" +name+ "' for component"); 257 return null; 258 } 259 ConsumerPortInstance _cpi = new ConsumerPortInstanceImpl(); 260 _cpi.type_reference(_cpt); 261 _cpi.related_instance_kind(instance_kind.COMPONENT_INSTANCE); 262 _cpi.instance_reference(this); 263 _cpi.object_ref(null); 264 265 266 return _cpi; 267 } 268 269 271 public EmitterPortInstance create_emitter_port_instance(String name) 272 { 273 ComponentType _ctype = (ComponentType) this.type_reference(); 274 EmitterPortType _ept; 275 try 276 { 277 _ept = _ctype.emitter_port_type_list().get_emitter_port_type(name); 278 } 279 catch (InvalidName e) 280 { 281 System.err.println("Error : unbale to find emitter '" +name+ "' for component"); 282 return null; 283 } 284 EmitterPortInstance _epi = new EmitterPortInstanceImpl(); 285 _epi.type_reference(_ept); 286 _epi.related_instance_kind(instance_kind.COMPONENT_INSTANCE); 287 _epi.instance_reference(this); 288 _epi.object_ref(null); 289 290 return _epi; 291 } 292 293 295 public PublisherPortInstance create_publisher_port_instance(String name) 296 { 297 ComponentType _ctype = (ComponentType) this.type_reference(); 298 PublisherPortType _ppt; 299 try 300 { 301 _ppt = _ctype.publisher_port_type_list().get_publisher_port_type(name); 302 } 303 catch (InvalidName e) 304 { 305 System.err.println("Error : unbale to find publisher '" +name+ "' for component"); 306 return null; 307 } 308 PublisherPortInstance _ppi = new PublisherPortInstanceImpl(); 309 _ppi.type_reference(_ppt); 310 _ppi.related_instance_kind(instance_kind.COMPONENT_INSTANCE); 311 _ppi.instance_reference(this); 312 _ppi.object_ref(null); 313 314 return _ppi; 315 } 316 317 } 318 | Popular Tags |