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