1. /*
  2. * @(#)UEInfoServiceContext.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 java.io.Serializable ;
  9. import org.omg.CORBA.SystemException;
  10. import org.omg.CORBA.CompletionStatus;
  11. import org.omg.CORBA.UNKNOWN;
  12. import org.omg.CORBA_2_3.portable.InputStream;
  13. import org.omg.CORBA_2_3.portable.OutputStream;
  14. import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
  15. import com.sun.corba.se.spi.servicecontext.ServiceContext ;
  16. public class UEInfoServiceContext extends ServiceContext {
  17. public UEInfoServiceContext( Throwable ex )
  18. {
  19. unknown = ex ;
  20. }
  21. public UEInfoServiceContext(InputStream is, GIOPVersion gv)
  22. {
  23. super(is, gv) ;
  24. try {
  25. unknown = (Throwable) in.read_value() ;
  26. } catch (ThreadDeath d) {
  27. throw d ;
  28. } catch (Throwable e) {
  29. unknown = new UNKNOWN( 0, CompletionStatus.COMPLETED_MAYBE ) ;
  30. }
  31. }
  32. // Required SERVICE_CONTEXT_ID and getId definitions
  33. public static final int SERVICE_CONTEXT_ID = 9 ;
  34. public int getId() { return SERVICE_CONTEXT_ID ; }
  35. public void writeData( OutputStream os ) throws SystemException
  36. {
  37. os.write_value( (Serializable)unknown ) ;
  38. }
  39. public Throwable getUE() { return unknown ; }
  40. private Throwable unknown = null ;
  41. public String toString()
  42. {
  43. return "UEInfoServiceContext[ unknown=" + unknown.toString() + " ]" ;
  44. }
  45. }