1. package org.omg.PortableInterceptor;
  2. /**
  3. * org/omg/PortableInterceptor/CurrentHelper.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.1"
  5. * from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
  6. * Monday, February 23, 2004 7:03:06 AM GMT
  7. */
  8. /**
  9. * Portable Interceptors Current (also known as <code>PICurrent</code>)
  10. * is merely a slot table, the slots of which are used by each service to
  11. * transfer their context data between their context and the request's or
  12. * reply's service context. Each service which wishes to use PICurrent
  13. * reserves a slot or slots at initialization time and uses those slots
  14. * during the processing of requests and replies.
  15. * <p>
  16. * Before an invocation is made, PICurrent is obtained via a call to
  17. * <code>ORB.resolve_initial_references( "PICurrent" )</code>. From within
  18. * the interception points, the data on PICurrent that has moved from the
  19. * thread scope to the request scope is available via the
  20. * <code>get_slot</code> operation on the <code>RequestInfo</code> object.
  21. * A PICurrent can still be obtained via
  22. * <code>resolve_initial_references</code>, but that is the Interceptor's
  23. * thread scope PICurrent.
  24. */
  25. abstract public class CurrentHelper
  26. {
  27. private static String _id = "IDL:omg.org/PortableInterceptor/Current:1.0";
  28. public static void insert (org.omg.CORBA.Any a, org.omg.PortableInterceptor.Current that)
  29. {
  30. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  31. a.type (type ());
  32. write (out, that);
  33. a.read_value (out.create_input_stream (), type ());
  34. }
  35. public static org.omg.PortableInterceptor.Current extract (org.omg.CORBA.Any a)
  36. {
  37. return read (a.create_input_stream ());
  38. }
  39. private static org.omg.CORBA.TypeCode __typeCode = null;
  40. synchronized public static org.omg.CORBA.TypeCode type ()
  41. {
  42. if (__typeCode == null)
  43. {
  44. __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.PortableInterceptor.CurrentHelper.id (), "Current");
  45. }
  46. return __typeCode;
  47. }
  48. public static String id ()
  49. {
  50. return _id;
  51. }
  52. public static org.omg.PortableInterceptor.Current read (org.omg.CORBA.portable.InputStream istream)
  53. {
  54. throw new org.omg.CORBA.MARSHAL ();
  55. }
  56. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableInterceptor.Current value)
  57. {
  58. throw new org.omg.CORBA.MARSHAL ();
  59. }
  60. public static org.omg.PortableInterceptor.Current narrow (org.omg.CORBA.Object obj)
  61. {
  62. if (obj == null)
  63. return null;
  64. else if (obj instanceof org.omg.PortableInterceptor.Current)
  65. return (org.omg.PortableInterceptor.Current)obj;
  66. else
  67. throw new org.omg.CORBA.BAD_PARAM ();
  68. }
  69. }