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.SequenceDef ; 31 import org.omg.CORBA.SequenceDefOperations ; 32 import org.omg.CORBA.SequenceDefPOATie; 33 import org.omg.CORBA.BAD_INV_ORDER ; 34 35 41 class SequenceDefImpl 42 extends IDLTypeImpl 43 implements SequenceDefOperations 44 { 45 47 49 51 53 SequenceDefImpl(TypeCode typeCode, RepositoryImpl repository) 54 { 55 super(typeCode, DefinitionKind.dk_Sequence, repository); 56 } 57 58 60 62 public IRObject getReference() 63 { 64 if (ref == null) { 65 ref = org.omg.CORBA.SequenceDefHelper.narrow( 66 servantToReference(new SequenceDefPOATie(this)) ); 67 } 68 return ref; 69 } 70 71 public void allDone() 72 throws IRConstructionException 73 { 74 try { 76 element_type_def = IDLTypeImpl.getIDLType(type().content_type(), 77 repository); 78 } catch (BadKind ex) { 79 throw new RuntimeException ("Bad kind " + type().kind().value() + 80 " for TypeCode.content_type()"); 81 } 82 83 getReference(); 84 } 85 86 87 89 public int bound() 90 { 91 try { 92 return type().length(); 93 } catch (BadKind ex) { 94 throw new RuntimeException (); 96 } 97 } 98 99 public void bound(int arg) 100 { 101 throw new BAD_INV_ORDER ("Cannot change RMI/IIOP mapping."); 102 } 103 104 public TypeCode element_type() 105 { 106 try { 107 return type().content_type(); 108 } catch (BadKind ex) { 109 throw new RuntimeException (); 111 } 112 } 113 114 public IDLType element_type_def() 115 { 116 return IDLTypeHelper.narrow(element_type_def.getReference()); 117 } 118 119 public void element_type_def(IDLType arg) 120 { 121 throw new BAD_INV_ORDER ("Cannot change RMI/IIOP mapping."); 122 } 123 124 125 127 129 132 private SequenceDef ref = null; 133 134 137 private LocalIDLType element_type_def; 138 } 139 | Popular Tags |