1 package org.jacorb.ir; 2 3 22 23 import org.omg.CORBA.INTF_REPOS ; 24 import org.omg.PortableServer.POA ; 25 26 import org.apache.avalon.framework.logger.Logger; 27 28 public class SequenceDef 29 extends IDLType 30 implements org.omg.CORBA.SequenceDefOperations 31 { 32 private int bound = -1; 33 private org.omg.CORBA.TypeCode element_type; 34 private org.omg.CORBA.IDLType element_type_def; 35 private Logger logger; 36 private POA poa; 37 38 39 private org.omg.CORBA.Repository ir; 40 41 public SequenceDef( org.omg.CORBA.TypeCode tc, 42 org.omg.CORBA.Repository ir, 43 Logger logger, 44 POA poa ) 45 { 46 if (tc.kind () != org.omg.CORBA.TCKind.tk_sequence) 47 { 48 throw new INTF_REPOS ("Precondition volation: TypeCode must be of kind sequence"); 49 } 50 51 this.logger = logger; 52 this.poa = poa; 53 type = tc; 54 def_kind = org.omg.CORBA.DefinitionKind.dk_Sequence; 55 this.ir = ir; 56 String name = "<unknown>"; 57 try 58 { 59 element_type = tc.content_type(); 60 bound = tc.length(); 61 name = element_type.name(); 62 } 63 catch( org.omg.CORBA.TypeCodePackage.BadKind bk ) 64 { 65 } 67 68 element_type_def = IDLType.create( element_type, ir, 69 this.logger, this.poa); 70 71 if (element_type_def == null) 72 { 73 throw new INTF_REPOS ("Element type " + name + " null in SequenceDef " + name ); 74 } 75 76 this.logger.debug("New SequenceDef"); 77 } 78 79 public int bound() 80 { 81 return bound; 82 } 83 84 public void bound(int a) 85 { 86 bound = a; 87 } 88 89 public org.omg.CORBA.TypeCode element_type() 90 { 91 return element_type; 92 } 93 94 public org.omg.CORBA.IDLType element_type_def() 95 { 96 return element_type_def; 97 } 98 99 public void element_type_def(org.omg.CORBA.IDLType a) 100 { 101 element_type_def = a; 102 } 103 104 public void destroy() 105 { 106 type = null; 107 element_type = null; 108 element_type_def = null; 109 } 110 111 public void define() 112 { 113 114 } 115 } 116 | Popular Tags |