KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)CodeSetServiceContext.java 1.15 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.iiop.GIOPVersion;
14 import com.sun.corba.se.impl.encoding.MarshalInputStream ;
15 import com.sun.corba.se.impl.encoding.MarshalOutputStream ;
16 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo ;
17
18 public class CodeSetServiceContext extends ServiceContext {
19     public CodeSetServiceContext( CodeSetComponentInfo.CodeSetContext csc )
20     {
21     this.csc = csc ;
22     }
23
24     public CodeSetServiceContext(InputStream JavaDoc is, GIOPVersion gv)
25     {
26     super(is, gv) ;
27     csc = new CodeSetComponentInfo.CodeSetContext() ;
28     csc.read( (MarshalInputStream)in ) ;
29     }
30
31     // Required SERVICE_CONTEXT_ID and getId definitions
32
public static final int SERVICE_CONTEXT_ID = 1 ;
33     public int getId() { return SERVICE_CONTEXT_ID ; }
34
35     public void writeData( OutputStream JavaDoc os ) throws SystemException JavaDoc
36     {
37     csc.write( (MarshalOutputStream)os ) ;
38     }
39     
40     public CodeSetComponentInfo.CodeSetContext getCodeSetContext()
41     {
42     return csc ;
43     }
44
45     private CodeSetComponentInfo.CodeSetContext csc ;
46
47     public String JavaDoc toString()
48     {
49     return "CodeSetServiceContext[ csc=" + csc + " ]" ;
50     }
51 }
52
Popular Tags