1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class LocalInterfaceDef_impl 42 extends InterfaceDef_impl 43 implements LocalInterfaceDefOperations 44 { 45 51 54 public 55 LocalInterfaceDef_impl(IFR ifr, 56 Container_impl container) 57 { 58 super(ifr, container, false); 60 61 setServant(new LocalInterfaceDefPOATie(this)); 63 } 64 65 71 77 80 protected LocalInterfaceDef 81 asLocalInterfaceDef() 82 { 83 return LocalInterfaceDefHelper.narrow(asObject()); 84 } 85 86 92 95 protected boolean 96 isUnderDestruction() 97 { 98 if(super.isUnderDestruction()) return true; 100 101 String name = name(); 104 if ( name.startsWith("CCM_") 105 && base_interfaces_.length == 1 106 && base_interfaces_[0].getImpl().isUnderDestruction() 107 && name.substring(4).equals(base_interfaces_[0].getImpl().name())) 108 { 109 destroy(); 110 return true; 111 } 112 113 return false; 115 } 116 117 123 126 public DefinitionKind 127 def_kind() 128 { 129 return DefinitionKind.dk_LocalInterface; 130 } 131 132 138 141 public TypeCode 142 type() 143 { 144 146 152 return getIFR().getTCF().create_interface_tc(id(), name()); 153 } 154 155 161 164 public void 165 base_interfaces(InterfaceDef[] itfs) 166 { 167 for(int i=0; i<itfs.length; i++) 169 if ((itfs[i].def_kind() != DefinitionKind.dk_Interface) && 170 (itfs[i].def_kind() != DefinitionKind.dk_LocalInterface)) 171 throw exceptionInvalidLocalInterfaceInheritance( 172 itfs[i].absolute_name()); 173 174 super.base_interfaces(itfs); 175 } 176 177 180 public boolean 181 is_a(String interface_id) 182 { 183 if(interface_id.equals(id())) 184 return true; 185 186 if(interface_id.equals("IDL:omg.org/CORBA/LocalObject:1.0")) 187 return true; 188 189 for(int i=0; i<base_interfaces_.length; i++) 190 if (base_interfaces_[i].getImpl().is_a(interface_id)) 191 return true; 192 193 return false; 194 } 195 } 196 | Popular Tags |