KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > IOP > ServiceContextHelper


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

10
11 abstract public class ServiceContextHelper
12 {
13   private static String JavaDoc _id = "IDL:omg.org/IOP/ServiceContext:1.0";
14
15   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.IOP.ServiceContext JavaDoc that)
16   {
17     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
18     a.type (type ());
19     write (out, that);
20     a.read_value (out.create_input_stream (), type ());
21   }
22
23   public static org.omg.IOP.ServiceContext JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
24   {
25     return read (a.create_input_stream ());
26   }
27
28   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
29   private static boolean __active = false;
30   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
31   {
32     if (__typeCode == null)
33     {
34       synchronized (org.omg.CORBA.TypeCode JavaDoc.class)
35       {
36         if (__typeCode == null)
37         {
38           if (__active)
39           {
40             return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
41           }
42           __active = true;
43           org.omg.CORBA.StructMember JavaDoc[] _members0 = new org.omg.CORBA.StructMember JavaDoc [2];
44           org.omg.CORBA.TypeCode JavaDoc _tcOf_members0 = null;
45           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
46           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.IOP.ServiceIdHelper.id (), "ServiceId", _tcOf_members0);
47           _members0[0] = new org.omg.CORBA.StructMember JavaDoc (
48             "context_id",
49             _tcOf_members0,
50             null);
51           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
52           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0);
53           _members0[1] = new org.omg.CORBA.StructMember JavaDoc (
54             "context_data",
55             _tcOf_members0,
56             null);
57           __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.IOP.ServiceContextHelper.id (), "ServiceContext", _members0);
58           __active = false;
59         }
60       }
61     }
62     return __typeCode;
63   }
64
65   public static String JavaDoc id ()
66   {
67     return _id;
68   }
69
70   public static org.omg.IOP.ServiceContext JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
71   {
72     org.omg.IOP.ServiceContext JavaDoc value = new org.omg.IOP.ServiceContext JavaDoc ();
73     value.context_id = istream.read_ulong ();
74     int _len0 = istream.read_long ();
75     value.context_data = new byte[_len0];
76     istream.read_octet_array (value.context_data, 0, _len0);
77     return value;
78   }
79
80   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.IOP.ServiceContext JavaDoc value)
81   {
82     ostream.write_ulong (value.context_id);
83     ostream.write_long (value.context_data.length);
84     ostream.write_octet_array (value.context_data, 0, value.context_data.length);
85   }
86
87 }
88
Popular Tags