KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gcc > org > omg > GIOP > MessageHeader_1_1Helper


1 package gcc.org.omg.GIOP;
2
3
4 /**
5 * gcc/org/omg/GIOP/MessageHeader_1_1Helper.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.1"
7 * from ../idl/GIOP.idl
8 * Wednesday, December 8, 2004 11:54:39 AM EST
9 */

10
11
12 // GIOP 1.1
13
abstract public class MessageHeader_1_1Helper
14 {
15   private static String JavaDoc _id = "IDL:omg.org/GIOP/MessageHeader_1_1:1.0";
16
17   public static void insert (org.omg.CORBA.Any JavaDoc a, gcc.org.omg.GIOP.MessageHeader_1_1 that)
18   {
19     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
20     a.type (type ());
21     write (out, that);
22     a.read_value (out.create_input_stream (), type ());
23   }
24
25   public static gcc.org.omg.GIOP.MessageHeader_1_1 extract (org.omg.CORBA.Any JavaDoc a)
26   {
27     return read (a.create_input_stream ());
28   }
29
30   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
31   private static boolean __active = false;
32   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
33   {
34     if (__typeCode == null)
35     {
36       synchronized (org.omg.CORBA.TypeCode JavaDoc.class)
37       {
38         if (__typeCode == null)
39         {
40           if (__active)
41           {
42             return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
43           }
44           __active = true;
45           org.omg.CORBA.StructMember JavaDoc[] _members0 = new org.omg.CORBA.StructMember JavaDoc [5];
46           org.omg.CORBA.TypeCode JavaDoc _tcOf_members0 = null;
47           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_char);
48           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_array_tc (4, _tcOf_members0 );
49           _members0[0] = new org.omg.CORBA.StructMember JavaDoc (
50             "magic",
51             _tcOf_members0,
52             null);
53           _tcOf_members0 = gcc.org.omg.GIOP.VersionHelper.type ();
54           _members0[1] = new org.omg.CORBA.StructMember JavaDoc (
55             "GIOP_version",
56             _tcOf_members0,
57             null);
58           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
59           _members0[2] = new org.omg.CORBA.StructMember JavaDoc (
60             "flags",
61             _tcOf_members0,
62             null);
63           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
64           _members0[3] = new org.omg.CORBA.StructMember JavaDoc (
65             "message_type",
66             _tcOf_members0,
67             null);
68           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
69           _members0[4] = new org.omg.CORBA.StructMember JavaDoc (
70             "message_size",
71             _tcOf_members0,
72             null);
73           __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (gcc.org.omg.GIOP.MessageHeader_1_1Helper.id (), "MessageHeader_1_1", _members0);
74           __active = false;
75         }
76       }
77     }
78     return __typeCode;
79   }
80
81   public static String JavaDoc id ()
82   {
83     return _id;
84   }
85
86   public static gcc.org.omg.GIOP.MessageHeader_1_1 read (org.omg.CORBA.portable.InputStream JavaDoc istream)
87   {
88     gcc.org.omg.GIOP.MessageHeader_1_1 value = new gcc.org.omg.GIOP.MessageHeader_1_1 ();
89     value.magic = new char[4];
90     for (int _o0 = 0;_o0 < (4); ++_o0)
91     {
92       value.magic[_o0] = istream.read_char ();
93     }
94     value.GIOP_version = gcc.org.omg.GIOP.VersionHelper.read (istream);
95     value.flags = istream.read_octet ();
96     value.message_type = istream.read_octet ();
97     value.message_size = istream.read_ulong ();
98     return value;
99   }
100
101   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, gcc.org.omg.GIOP.MessageHeader_1_1 value)
102   {
103     if (value.magic.length != (4))
104       throw new org.omg.CORBA.MARSHAL JavaDoc (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
105     for (int _i0 = 0;_i0 < (4); ++_i0)
106     {
107       ostream.write_char (value.magic[_i0]);
108     }
109     gcc.org.omg.GIOP.VersionHelper.write (ostream, value.GIOP_version);
110     ostream.write_octet (value.flags);
111     ostream.write_octet (value.message_type);
112     ostream.write_ulong (value.message_size);
113   }
114
115 }
116
Popular Tags