KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)POAObjectKeyTemplate.java 1.24 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 java.util.Iterator JavaDoc ;
11
12 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
13 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
14
15 import org.omg.CORBA.OctetSeqHolder JavaDoc ;
16
17 import com.sun.corba.se.spi.activation.POANameHelper ;
18
19 import com.sun.corba.se.spi.orb.ORB ;
20 import com.sun.corba.se.spi.orb.ORBVersion ;
21 import com.sun.corba.se.spi.orb.ORBVersionFactory ;
22
23 import com.sun.corba.se.spi.ior.ObjectAdapterId ;
24
25 import com.sun.corba.se.impl.ior.ObjectKeyFactoryImpl ;
26
27 /**
28  * @author
29  */

30 public final class POAObjectKeyTemplate extends NewObjectKeyTemplateBase
31 {
32     /** This constructor reads the template ONLY from the stream.
33     */

34     public POAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream JavaDoc is )
35     {
36     super( orb, magic, scid, is.read_long(), is.read_string(),
37         new ObjectAdapterIdArray( POANameHelper.read( is ) ) ) ;
38
39     setORBVersion( is ) ;
40     }
41
42     /** This constructor reads a complete ObjectKey (template and Id)
43     * from the stream.
44     */

45     public POAObjectKeyTemplate( ORB orb, int magic, int scid, InputStream JavaDoc is,
46     OctetSeqHolder JavaDoc osh )
47     {
48     super( orb, magic, scid, is.read_long(), is.read_string(),
49         new ObjectAdapterIdArray( POANameHelper.read( is ) ) ) ;
50     
51     osh.value = readObjectKey( is ) ;
52
53     setORBVersion( is ) ;
54     }
55     
56     public POAObjectKeyTemplate( ORB orb, int scid, int serverid, String JavaDoc orbid,
57     ObjectAdapterId objectAdapterId)
58     {
59     super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, orbid,
60         objectAdapterId ) ;
61
62     setORBVersion( ORBVersionFactory.getORBVersion() ) ;
63     }
64     
65     public void writeTemplate(OutputStream JavaDoc os)
66     {
67     os.write_long( getMagic() ) ;
68     os.write_long( getSubcontractId() ) ;
69     os.write_long( getServerId() ) ;
70     os.write_string( getORBId() ) ;
71     getObjectAdapterId().write( os ) ;
72     }
73 }
74
Popular Tags