1. /*
  2. * @(#)CodeSetServiceContext.java 1.12 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.core;
  8. import org.omg.CORBA.SystemException;
  9. import org.omg.CORBA_2_3.portable.InputStream;
  10. import org.omg.CORBA_2_3.portable.OutputStream;
  11. import com.sun.corba.se.internal.core.MarshalInputStream ;
  12. import com.sun.corba.se.internal.core.MarshalOutputStream ;
  13. public class CodeSetServiceContext extends ServiceContext {
  14. public CodeSetServiceContext( CodeSetComponentInfo.CodeSetContext csc )
  15. {
  16. this.csc = csc ;
  17. }
  18. public CodeSetServiceContext(InputStream is, GIOPVersion gv)
  19. {
  20. super(is, gv) ;
  21. csc = new CodeSetComponentInfo.CodeSetContext() ;
  22. csc.read( (MarshalInputStream)in ) ;
  23. }
  24. // Required SERVICE_CONTEXT_ID and getId definitions
  25. public static final int SERVICE_CONTEXT_ID = 1 ;
  26. public int getId() { return SERVICE_CONTEXT_ID ; }
  27. public void writeData( OutputStream os ) throws SystemException
  28. {
  29. csc.write( (MarshalOutputStream)os ) ;
  30. }
  31. public CodeSetComponentInfo.CodeSetContext getCodeSetContext()
  32. {
  33. return csc ;
  34. }
  35. private CodeSetComponentInfo.CodeSetContext csc ;
  36. public String toString()
  37. {
  38. return "CodeSetServiceContext[ csc=" + csc + " ]" ;
  39. }
  40. }