KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > servicecontext > SendingContextServiceContext


1 /*
2  * @(#)SendingContextServiceContext.java 1.16 04/06/21
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.spi.servicecontext;
9
10 import org.omg.CORBA.SystemException JavaDoc;
11 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
12 import org.omg.CORBA_2_3.portable.OutputStream JavaDoc ;
13 import com.sun.corba.se.spi.ior.IOR ;
14 import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
15 import com.sun.corba.se.spi.servicecontext.ServiceContext ;
16 import com.sun.corba.se.impl.encoding.MarshalOutputStream ;
17 import com.sun.corba.se.impl.ior.IORImpl ;
18
19 public class SendingContextServiceContext extends ServiceContext {
20     public SendingContextServiceContext( IOR ior )
21     {
22     this.ior = ior ;
23     }
24
25     public SendingContextServiceContext(InputStream JavaDoc is, GIOPVersion gv)
26     {
27     super(is, gv) ;
28     ior = new IORImpl( in ) ;
29     }
30
31     // Required SERVICE_CONTEXT_ID and getId definitions
32
public static final int SERVICE_CONTEXT_ID = 6 ;
33     public int getId() { return SERVICE_CONTEXT_ID ; }
34
35     public void writeData( OutputStream JavaDoc os ) throws SystemException JavaDoc
36     {
37     ior.write( os ) ;
38     }
39
40     public IOR getIOR()
41     {
42     return ior ;
43     }
44
45     private IOR ior = null ;
46
47     public String JavaDoc toString()
48     {
49     return "SendingContexServiceContext[ ior=" + ior + " ]" ;
50     }
51 }
52
Popular Tags