1. /*
  2. * @(#)SendingContextServiceContext.java 1.13 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.ServiceContext ;
  12. import com.sun.corba.se.internal.core.IOR ;
  13. import com.sun.corba.se.internal.core.MarshalOutputStream ;
  14. public class SendingContextServiceContext extends ServiceContext {
  15. public SendingContextServiceContext( IOR ior )
  16. {
  17. this.ior = ior ;
  18. }
  19. public SendingContextServiceContext(InputStream is, GIOPVersion gv)
  20. {
  21. super(is, gv) ;
  22. ior = new IOR( in ) ;
  23. }
  24. // Required SERVICE_CONTEXT_ID and getId definitions
  25. public static final int SERVICE_CONTEXT_ID = 6 ;
  26. public int getId() { return SERVICE_CONTEXT_ID ; }
  27. public void writeData( OutputStream os ) throws SystemException
  28. {
  29. ior.write( os ) ;
  30. }
  31. public IOR getIOR()
  32. {
  33. return ior ;
  34. }
  35. private IOR ior = null ;
  36. public String toString()
  37. {
  38. return "SendingContexServiceContext[ ior=" + ior + " ]" ;
  39. }
  40. }