KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > ior > JIDLObjectKeyTemplate


1 /*
2  * @(#)JIDLObjectKeyTemplate.java 1.21 04/03/01
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.ior;
9
10 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
11 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
12
13 import org.omg.CORBA.OctetSeqHolder JavaDoc ;
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 /**
25  * @author Ken Cavanaugh
26  */

27 public final class JIDLObjectKeyTemplate extends NewObjectKeyTemplateBase
28 {
29     /** This constructor reads the template ONLY from the stream.
30     */

31     public JIDLObjectKeyTemplate( ORB orb, int magic, int scid, InputStream JavaDoc is )
32     {
33     super( orb, magic, scid, is.read_long(), JIDL_ORB_ID, JIDL_OAID );
34
35     setORBVersion( is ) ;
36     }
37
38     /** This constructor reads a complete ObjectKey (template and Id)
39     * from the stream.
40     */

41     public JIDLObjectKeyTemplate( ORB orb, int magic, int scid, InputStream JavaDoc is,
42     OctetSeqHolder JavaDoc osh )
43     {
44     super( orb, magic, scid, is.read_long(), JIDL_ORB_ID, JIDL_OAID );
45
46     osh.value = readObjectKey( is ) ;
47
48     setORBVersion( is ) ;
49     }
50     
51     public JIDLObjectKeyTemplate( ORB orb, int scid, int serverid )
52     {
53     super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid,
54         JIDL_ORB_ID, JIDL_OAID ) ;
55
56     setORBVersion( ORBVersionFactory.getORBVersion() ) ;
57     }
58    
59     protected void writeTemplate( OutputStream JavaDoc os )
60     {
61     os.write_long( getMagic() ) ;
62     os.write_long( getSubcontractId() ) ;
63     os.write_long( getServerId() ) ;
64     }
65 }
66
Popular Tags