KickJava   Java API By Example, From Geeks To Geeks.

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


1 package gcc.org.omg.GIOP;
2
3
4 /**
5 * gcc/org/omg/GIOP/TargetAddressHelper.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 abstract public class TargetAddressHelper
12 {
13   private static String JavaDoc _id = "IDL:omg.org/GIOP/TargetAddress:1.0";
14
15   public static void insert (org.omg.CORBA.Any JavaDoc a, gcc.org.omg.GIOP.TargetAddress 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 gcc.org.omg.GIOP.TargetAddress 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   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
30   {
31     if (__typeCode == null)
32     {
33       org.omg.CORBA.TypeCode JavaDoc _disTypeCode0;
34       _disTypeCode0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short);
35       _disTypeCode0 = org.omg.CORBA.ORB.init ().create_alias_tc (gcc.org.omg.GIOP.AddressingDispositionHelper.id (), "AddressingDisposition", _disTypeCode0);
36       org.omg.CORBA.UnionMember JavaDoc[] _members0 = new org.omg.CORBA.UnionMember JavaDoc [3];
37       org.omg.CORBA.TypeCode JavaDoc _tcOf_members0;
38       org.omg.CORBA.Any JavaDoc _anyOf_members0;
39
40       // Branch for object_key (case label gcc.org.omg.GIOP.KeyAddr.value)
41
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
42       _anyOf_members0.insert_short ((short)gcc.org.omg.GIOP.KeyAddr.value);
43       _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
44       _tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0);
45       _members0[0] = new org.omg.CORBA.UnionMember JavaDoc (
46         "object_key",
47         _anyOf_members0,
48         _tcOf_members0,
49         null);
50
51       // Branch for profile (case label gcc.org.omg.GIOP.ProfileAddr.value)
52
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
53       _anyOf_members0.insert_short ((short)gcc.org.omg.GIOP.ProfileAddr.value);
54       _tcOf_members0 = gcc.org.omg.IOP.TaggedProfileHelper.type ();
55       _members0[1] = new org.omg.CORBA.UnionMember JavaDoc (
56         "profile",
57         _anyOf_members0,
58         _tcOf_members0,
59         null);
60
61       // Branch for ior (case label gcc.org.omg.GIOP.ReferenceAddr.value)
62
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
63       _anyOf_members0.insert_short ((short)gcc.org.omg.GIOP.ReferenceAddr.value);
64       _tcOf_members0 = gcc.org.omg.GIOP.IORAddressingInfoHelper.type ();
65       _members0[2] = new org.omg.CORBA.UnionMember JavaDoc (
66         "ior",
67         _anyOf_members0,
68         _tcOf_members0,
69         null);
70       __typeCode = org.omg.CORBA.ORB.init ().create_union_tc (gcc.org.omg.GIOP.TargetAddressHelper.id (), "TargetAddress", _disTypeCode0, _members0);
71     }
72     return __typeCode;
73   }
74
75   public static String JavaDoc id ()
76   {
77     return _id;
78   }
79
80   public static gcc.org.omg.GIOP.TargetAddress read (org.omg.CORBA.portable.InputStream JavaDoc istream)
81   {
82     gcc.org.omg.GIOP.TargetAddress value = new gcc.org.omg.GIOP.TargetAddress ();
83     short _dis0 = (short)0;
84     _dis0 = istream.read_short ();
85     switch (_dis0)
86     {
87       case gcc.org.omg.GIOP.KeyAddr.value:
88         byte _object_key[] = null;
89         int _len1 = istream.read_long ();
90         _object_key = new byte[_len1];
91         istream.read_octet_array (_object_key, 0, _len1);
92         value.object_key (_object_key);
93         break;
94       case gcc.org.omg.GIOP.ProfileAddr.value:
95         gcc.org.omg.IOP.TaggedProfile _profile = null;
96         _profile = gcc.org.omg.IOP.TaggedProfileHelper.read (istream);
97         value.profile (_profile);
98         break;
99       case gcc.org.omg.GIOP.ReferenceAddr.value:
100         gcc.org.omg.GIOP.IORAddressingInfo _ior = null;
101         _ior = gcc.org.omg.GIOP.IORAddressingInfoHelper.read (istream);
102         value.ior (_ior);
103         break;
104       default:
105         value._default( _dis0 ) ;
106         break;
107     }
108     return value;
109   }
110
111   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, gcc.org.omg.GIOP.TargetAddress value)
112   {
113     ostream.write_short (value.discriminator ());
114     switch (value.discriminator ())
115     {
116       case gcc.org.omg.GIOP.KeyAddr.value:
117         ostream.write_long (value.object_key ().length);
118         ostream.write_octet_array (value.object_key (), 0, value.object_key ().length);
119         break;
120       case gcc.org.omg.GIOP.ProfileAddr.value:
121         gcc.org.omg.IOP.TaggedProfileHelper.write (ostream, value.profile ());
122         break;
123       case gcc.org.omg.GIOP.ReferenceAddr.value:
124         gcc.org.omg.GIOP.IORAddressingInfoHelper.write (ostream, value.ior ());
125         break;
126     }
127   }
128
129 }
130
Popular Tags