KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > PortableInterceptor > CurrentHelper


1 package org.omg.PortableInterceptor;
2
3
4 /**
5 * org/omg/PortableInterceptor/CurrentHelper.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
8 * Saturday, February 9, 2008 9:40:08 AM GMT
9 */

10
11
12 /**
13    * Portable Interceptors Current (also known as <code>PICurrent</code>)
14    * is merely a slot table, the slots of which are used by each service to
15    * transfer their context data between their context and the request's or
16    * reply's service context. Each service which wishes to use PICurrent
17    * reserves a slot or slots at initialization time and uses those slots
18    * during the processing of requests and replies.
19    * <p>
20    * Before an invocation is made, PICurrent is obtained via a call to
21    * <code>ORB.resolve_initial_references( "PICurrent" )</code>. From within
22    * the interception points, the data on PICurrent that has moved from the
23    * thread scope to the request scope is available via the
24    * <code>get_slot</code> operation on the <code>RequestInfo</code> object.
25    * A PICurrent can still be obtained via
26    * <code>resolve_initial_references</code>, but that is the Interceptor's
27    * thread scope PICurrent.
28    */

29 abstract public class CurrentHelper
30 {
31   private static String JavaDoc _id = "IDL:omg.org/PortableInterceptor/Current:1.0";
32
33   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.PortableInterceptor.Current JavaDoc that)
34   {
35     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
36     a.type (type ());
37     write (out, that);
38     a.read_value (out.create_input_stream (), type ());
39   }
40
41   public static org.omg.PortableInterceptor.Current JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
42   {
43     return read (a.create_input_stream ());
44   }
45
46   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
47   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
48   {
49     if (__typeCode == null)
50     {
51       __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.PortableInterceptor.CurrentHelper.id (), "Current");
52     }
53     return __typeCode;
54   }
55
56   public static String JavaDoc id ()
57   {
58     return _id;
59   }
60
61   public static org.omg.PortableInterceptor.Current JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
62   {
63       throw new org.omg.CORBA.MARSHAL JavaDoc ();
64   }
65
66   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.PortableInterceptor.Current JavaDoc value)
67   {
68       throw new org.omg.CORBA.MARSHAL JavaDoc ();
69   }
70
71   public static org.omg.PortableInterceptor.Current JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
72   {
73     if (obj == null)
74       return null;
75     else if (obj instanceof org.omg.PortableInterceptor.Current JavaDoc)
76       return (org.omg.PortableInterceptor.Current JavaDoc)obj;
77     else
78       throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
79   }
80
81   public static org.omg.PortableInterceptor.Current JavaDoc unchecked_narrow (org.omg.CORBA.Object JavaDoc obj)
82   {
83     if (obj == null)
84       return null;
85     else if (obj instanceof org.omg.PortableInterceptor.Current JavaDoc)
86       return (org.omg.PortableInterceptor.Current JavaDoc)obj;
87     else
88       throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
89   }
90
91 }
92
Popular Tags