1 7 8 package com.sun.corba.se.impl.ior; 9 10 import org.omg.CORBA.INTERNAL ; 11 import org.omg.CORBA.OctetSeqHolder ; 12 13 import org.omg.CORBA_2_3.portable.InputStream ; 14 import org.omg.CORBA_2_3.portable.OutputStream ; 15 16 import com.sun.corba.se.spi.orb.ORB ; 17 import com.sun.corba.se.spi.orb.ORBVersion ; 18 import com.sun.corba.se.spi.orb.ORBVersionFactory ; 19 20 import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; 21 22 25 public final class OldPOAObjectKeyTemplate extends OldObjectKeyTemplateBase 26 { 27 29 public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is ) 30 { 31 this( orb, magic, scid, is.read_long(), is.read_long(), is.read_long() ) ; 32 } 33 34 37 public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream is, 38 OctetSeqHolder osh ) 39 { 40 this( orb, magic, scid, is ) ; 41 osh.value = readObjectKey( is ) ; 42 } 43 44 public OldPOAObjectKeyTemplate( ORB orb, int magic, int scid, int serverid, 45 int orbid, int poaid) 46 { 47 super( orb, magic, scid, serverid, 48 Integer.toString( orbid ), 49 new ObjectAdapterIdNumber( poaid ) ) ; 50 } 51 52 public void writeTemplate(OutputStream os) 53 { 54 os.write_long( getMagic() ) ; 55 os.write_long( getSubcontractId() ) ; 56 os.write_long( getServerId() ) ; 57 58 int orbid = Integer.parseInt( getORBId() ) ; 59 os.write_long( orbid ) ; 60 61 ObjectAdapterIdNumber oaid = (ObjectAdapterIdNumber)(getObjectAdapterId()) ; 62 int poaid = oaid.getOldPOAId() ; 63 os.write_long( poaid ) ; 64 } 65 66 public ORBVersion getORBVersion() 67 { 68 if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_OLD) 69 return ORBVersionFactory.getOLD() ; 70 else if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_NEW) 71 return ORBVersionFactory.getNEW() ; 72 else 73 throw new INTERNAL () ; 74 } 75 } 76 77 | Popular Tags |