1 22 package org.jboss.iiop.rmi.ir; 23 24 import org.omg.CORBA.ModuleDefOperations ; 25 import org.omg.CORBA.ModuleDefPOATie; 26 import org.omg.CORBA.Any ; 27 import org.omg.CORBA.IRObject ; 28 import org.omg.CORBA.Contained ; 29 import org.omg.CORBA.ContainedOperations ; 30 import org.omg.CORBA.ContainedPackage.Description; 31 import org.omg.CORBA.IDLType ; 32 import org.omg.CORBA.DefinitionKind ; 33 import org.omg.CORBA.StructMember ; 34 import org.omg.CORBA.UnionMember ; 35 import org.omg.CORBA.InterfaceDef ; 36 import org.omg.CORBA.ConstantDef ; 37 import org.omg.CORBA.EnumDef ; 38 import org.omg.CORBA.ValueDef ; 39 import org.omg.CORBA.ValueBoxDef ; 40 import org.omg.CORBA.Initializer ; 41 import org.omg.CORBA.StructDef ; 42 import org.omg.CORBA.UnionDef ; 43 import org.omg.CORBA.ModuleDef ; 44 import org.omg.CORBA.AliasDef ; 45 import org.omg.CORBA.NativeDef ; 46 import org.omg.CORBA.ExceptionDef ; 47 import org.omg.CORBA.ModuleDescription ; 48 import org.omg.CORBA.ModuleDescriptionHelper; 49 50 56 class ModuleDefImpl 57 extends ContainedImpl 58 implements ModuleDefOperations , LocalContainer 59 { 60 62 64 66 68 ModuleDefImpl(String id, String name, String version, 69 LocalContainer defined_in, RepositoryImpl repository) 70 { 71 super(id, name, version, defined_in, 72 DefinitionKind.dk_Module, repository); 73 74 this.delegate = new ContainerImplDelegate(this); 75 } 76 77 79 81 public LocalContained _lookup(String search_name) 82 { 83 return delegate._lookup(search_name); 84 } 85 86 public LocalContained[] _contents(DefinitionKind limit_type, 87 boolean exclude_inherited) 88 { 89 return delegate._contents(limit_type, exclude_inherited); 90 } 91 92 public LocalContained[] _lookup_name(String search_name, 93 int levels_to_search, 94 DefinitionKind limit_type, 95 boolean exclude_inherited) 96 { 97 return delegate._lookup_name(search_name, levels_to_search, limit_type, 98 exclude_inherited); 99 } 100 101 public void add(String name, LocalContained contained) 102 throws IRConstructionException 103 { 104 delegate.add(name, contained); 105 } 106 107 109 public Contained lookup(String search_name) 110 { 111 return delegate.lookup(search_name); 112 } 113 114 public Contained [] contents(DefinitionKind limit_type, 115 boolean exclude_inherited) 116 { 117 return delegate.contents(limit_type, exclude_inherited); 118 } 119 120 public Contained [] lookup_name(String search_name, int levels_to_search, 121 DefinitionKind limit_type, 122 boolean exclude_inherited) 123 { 124 return delegate.lookup_name(search_name, levels_to_search, limit_type, 125 exclude_inherited); 126 } 127 128 public org.omg.CORBA.ContainerPackage.Description[] 129 describe_contents(DefinitionKind limit_type, 130 boolean exclude_inherited, 131 int max_returned_objs) 132 { 133 return delegate.describe_contents(limit_type, exclude_inherited, 134 max_returned_objs); 135 } 136 137 public ModuleDef create_module(String id, String name, String version) 138 { 139 return delegate.create_module(id, name, version); 140 } 141 142 public ConstantDef create_constant(String id, String name, String version, 143 IDLType type, Any value) 144 { 145 return delegate.create_constant(id, name, version, type, value); 146 } 147 148 public StructDef create_struct(String id, String name, String version, 149 StructMember [] members) 150 { 151 return delegate.create_struct(id, name, version, members); 152 } 153 154 public UnionDef create_union(String id, String name, String version, 155 IDLType discriminator_type, 156 UnionMember [] members) 157 { 158 return delegate.create_union(id, name, version, discriminator_type, 159 members); 160 } 161 162 public EnumDef create_enum(String id, String name, String version, 163 String [] members) 164 { 165 return delegate.create_enum(id, name, version, members); 166 } 167 168 public AliasDef create_alias(String id, String name, String version, 169 IDLType original_type) 170 { 171 return delegate.create_alias(id, name, version, original_type); 172 } 173 174 public InterfaceDef create_interface(String id, String name, String version, 175 InterfaceDef [] base_interfaces, 176 boolean is_abstract) 177 { 178 return delegate.create_interface(id, name, version, 179 base_interfaces, is_abstract); 180 } 181 182 public ValueDef create_value(String id, String name, String version, 183 boolean is_custom, boolean is_abstract, 184 ValueDef base_value, boolean is_truncatable, 185 ValueDef [] abstract_base_values, 186 InterfaceDef [] supported_interfaces, 187 Initializer [] initializers) 188 { 189 return delegate.create_value(id, name, version, is_custom, is_abstract, 190 base_value, is_truncatable, 191 abstract_base_values, supported_interfaces, 192 initializers); 193 } 194 195 public ValueBoxDef create_value_box(String id, String name, String version, 196 IDLType original_type_def) 197 { 198 return delegate.create_value_box(id, name, version, original_type_def); 199 } 200 201 public ExceptionDef create_exception(String id, String name, String version, 202 StructMember [] members) 203 { 204 return delegate.create_exception(id, name, version, members); 205 } 206 207 public NativeDef create_native(String id, String name, String version) 208 { 209 return delegate.create_native(id, name, version); 210 } 211 212 214 public IRObject getReference() 215 { 216 if (ref == null) { 217 ref = org.omg.CORBA.ModuleDefHelper.narrow( 218 servantToReference(new ModuleDefPOATie(this)) ); 219 } 220 return ref; 221 } 222 223 public void allDone() 224 throws IRConstructionException 225 { 226 getReference(); 227 delegate.allDone(); 228 } 229 230 public void shutdown() 231 { 232 delegate.shutdown(); 233 super.shutdown(); 234 } 235 236 238 public Description describe() 239 { 240 String defined_in_id = "IR"; 241 242 if (defined_in instanceof ContainedOperations ) 243 defined_in_id = ((ContainedOperations )defined_in).id(); 244 245 ModuleDescription md = new ModuleDescription (name, id, defined_in_id, 246 version); 247 248 Any any = getORB().create_any(); 249 250 ModuleDescriptionHelper.insert(any, md); 251 252 return new Description(DefinitionKind.dk_Module, any); 253 } 254 255 257 259 261 263 266 private ContainerImplDelegate delegate; 267 268 271 private ModuleDef ref = null; 272 273 } 275 276 | Popular Tags |