1 22 package org.jboss.iiop.rmi.ir; 23 24 import org.omg.CORBA.Any ; 25 import org.omg.CORBA.TypeCode ; 26 import org.omg.CORBA.IRObject ; 27 import org.omg.CORBA.ContainedOperations ; 28 import org.omg.CORBA.ContainedPackage.Description; 29 import org.omg.CORBA.IDLType ; 30 import org.omg.CORBA.IDLTypeHelper ; 31 import org.omg.CORBA.DefinitionKind ; 32 import org.omg.CORBA.ValueMember ; 33 import org.omg.CORBA.ValueMemberHelper ; 34 import org.omg.CORBA.ValueMemberDef ; 35 import org.omg.CORBA.ValueMemberDefOperations ; 36 import org.omg.CORBA.ValueMemberDefPOATie; 37 import org.omg.CORBA.PUBLIC_MEMBER ; 38 import org.omg.CORBA.PRIVATE_MEMBER ; 39 import org.omg.CORBA.BAD_INV_ORDER ; 40 41 47 class ValueMemberDefImpl 48 extends ContainedImpl 49 implements ValueMemberDefOperations 50 { 51 53 55 57 59 ValueMemberDefImpl(String id, String name, String version, 60 TypeCode typeCode, boolean publicMember, 61 LocalContainer defined_in, RepositoryImpl repository) 62 { 63 super(id, name, version, defined_in, 64 DefinitionKind.dk_ValueMember, repository); 65 66 this.typeCode = typeCode; 67 this.publicMember = publicMember; 68 } 69 70 72 74 public IRObject getReference() 75 { 76 if (ref == null) { 77 ref = org.omg.CORBA.ValueMemberDefHelper.narrow( 78 servantToReference(new ValueMemberDefPOATie(this)) ); 79 } 80 return ref; 81 } 82 83 public void allDone() 84 throws IRConstructionException 85 { 86 type_def = IDLTypeImpl.getIDLType(typeCode, repository); 88 89 getReference(); 90 } 91 92 94 public TypeCode type() 95 { 96 return typeCode; 97 } 98 99 public IDLType type_def() 100 { 101 return IDLTypeHelper.narrow(type_def.getReference()); 102 } 103 104 public void type_def(IDLType arg) 105 { 106 throw new BAD_INV_ORDER ("Cannot change RMI/IIOP mapping."); 107 } 108 109 public short access() 110 { 111 return (publicMember) ? PUBLIC_MEMBER.value : PRIVATE_MEMBER.value; 112 } 113 114 public void access(short arg) 115 { 116 throw new BAD_INV_ORDER ("Cannot change RMI/IIOP mapping."); 117 } 118 119 121 public Description describe() 122 { 123 String defined_in_id = "IR"; 124 125 if (defined_in instanceof ContainedOperations ) 126 defined_in_id = ((ContainedOperations )defined_in).id(); 127 128 ValueMember d = 129 new ValueMember (name, id, defined_in_id, version, 130 typeCode, type_def(), access()); 131 132 Any any = getORB().create_any(); 133 134 ValueMemberHelper.insert(any, d); 135 136 return new Description(DefinitionKind.dk_ValueMember, any); 137 } 138 139 140 142 144 147 private ValueMemberDef ref = null; 148 149 152 private TypeCode typeCode; 153 154 157 private LocalIDLType type_def; 158 159 162 private boolean publicMember; 163 } 164 | Popular Tags |