1 22 package org.jboss.iiop.rmi.ir; 23 24 import org.omg.CORBA.TypeCode ; 25 import org.omg.CORBA.TypeCodePackage.BadKind ; 26 import org.omg.CORBA.IRObject ; 27 import org.omg.CORBA.IDLType ; 28 import org.omg.CORBA.IDLTypeHelper ; 29 import org.omg.CORBA.DefinitionKind ; 30 import org.omg.CORBA.AliasDef ; 31 import org.omg.CORBA.AliasDefOperations ; 32 import org.omg.CORBA.AliasDefPOATie; 33 import org.omg.CORBA.BAD_INV_ORDER ; 34 35 41 class AliasDefImpl 42 extends TypedefDefImpl 43 implements AliasDefOperations 44 { 45 47 49 51 53 AliasDefImpl(String id, String name, String version, 54 LocalContainer defined_in, 55 TypeCode typeCode, RepositoryImpl repository) 56 { 57 super(id, name, version, defined_in, typeCode, 58 DefinitionKind.dk_Alias, repository); 59 } 60 61 63 65 public IRObject getReference() 66 { 67 if (ref == null) { 68 ref = org.omg.CORBA.AliasDefHelper.narrow( 69 servantToReference(new AliasDefPOATie(this)) ); 70 } 71 return ref; 72 } 73 74 public void allDone() 75 throws IRConstructionException 76 { 77 try { 79 original_type_def = IDLTypeImpl.getIDLType(type().content_type(), 80 repository); 81 } catch (BadKind ex) { 82 throw new RuntimeException ("Bad kind " + type().kind().value() + 83 " for TypeCode.content_type()"); 84 } 85 86 getReference(); 87 } 88 89 91 public IDLType original_type_def() 92 { 93 return IDLTypeHelper.narrow(original_type_def.getReference()); 94 } 95 96 public void original_type_def(IDLType arg) 97 { 98 throw new BAD_INV_ORDER ("Cannot change RMI/IIOP mapping."); 99 } 100 101 103 105 108 private AliasDef ref = null; 109 110 113 private LocalIDLType original_type_def; 114 } 115 | Popular Tags |