1 7 8 package com.sun.corba.se.impl.ior; 9 10 import org.omg.CORBA.OctetSeqHolder ; 11 12 import org.omg.CORBA_2_3.portable.InputStream ; 13 import org.omg.CORBA_2_3.portable.OutputStream ; 14 15 import com.sun.corba.se.spi.ior.ObjectId ; 16 import com.sun.corba.se.spi.ior.ObjectKeyFactory ; 17 18 import com.sun.corba.se.spi.orb.ORB ; 19 import com.sun.corba.se.spi.orb.ORBVersion ; 20 import com.sun.corba.se.spi.orb.ORBVersionFactory ; 21 22 import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ; 23 24 import com.sun.corba.se.impl.encoding.CDRInputStream ; 25 26 29 public final class OldJIDLObjectKeyTemplate extends OldObjectKeyTemplateBase 30 { 31 36 public static final byte NULL_PATCH_VERSION = 0; 37 38 byte patchVersion = OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION; 39 40 public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid, 41 InputStream is, OctetSeqHolder osh ) 42 { 43 this( orb, magic, scid, is ); 44 45 osh.value = readObjectKey( is ) ; 46 47 62 if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW && 63 osh.value.length > ((CDRInputStream)is).getPosition()) { 64 65 patchVersion = is.read_octet(); 66 67 if (patchVersion == ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL) 68 setORBVersion(ORBVersionFactory.getJDK1_3_1_01()); 69 else if (patchVersion > ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL) 70 setORBVersion(ORBVersionFactory.getORBVersion()); 71 else 72 throw wrapper.invalidJdk131PatchLevel( new Integer ( patchVersion ) ) ; 73 } 74 } 75 76 77 public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid, int serverid) 78 { 79 super( orb, magic, scid, serverid, JIDL_ORB_ID, JIDL_OAID ) ; 80 } 81 82 public OldJIDLObjectKeyTemplate(ORB orb, int magic, int scid, InputStream is) 83 { 84 this( orb, magic, scid, is.read_long() ) ; 85 } 86 87 protected void writeTemplate( OutputStream os ) 88 { 89 os.write_long( getMagic() ) ; 90 os.write_long( getSubcontractId() ) ; 91 os.write_long( getServerId() ) ; 92 } 93 94 public void write(ObjectId objectId, OutputStream os) 95 { 96 super.write(objectId, os); 97 98 if (patchVersion != OldJIDLObjectKeyTemplate.NULL_PATCH_VERSION) 99 os.write_octet( patchVersion ) ; 100 } 101 } 102 | Popular Tags |