4
|
1 |
/*
|
5555
|
2 |
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
4
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
5555
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
4
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
5555
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
4
|
10 |
*
|
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
15 |
* accompanied this code).
|
|
16 |
*
|
|
17 |
* You should have received a copy of the GNU General Public License version
|
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
20 |
*
|
5555
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
|
23 |
* questions.
|
4
|
24 |
*/
|
|
25 |
|
|
26 |
package com.sun.corba.se.impl.protocol.giopmsgheaders;
|
|
27 |
|
|
28 |
|
|
29 |
/**
|
|
30 |
* com/sun/corba/se/impl/protocol/giopmsgheaders/TargetAddressHelper.java
|
|
31 |
* Generated by the IDL-to-Java compiler (portable), version "3.0"
|
|
32 |
* from ../../../../../../../src/share/classes/com/sun/corba/se/GiopIDL/g.idl
|
|
33 |
* Sunday, June 4, 2000 5:18:54 PM PDT
|
|
34 |
*/
|
|
35 |
|
|
36 |
abstract public class TargetAddressHelper
|
|
37 |
{
|
|
38 |
private static String _id = "IDL:messages/TargetAddress:1.0";
|
|
39 |
|
|
40 |
public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress that)
|
|
41 |
{
|
|
42 |
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
|
|
43 |
a.type (type ());
|
|
44 |
write (out, that);
|
|
45 |
a.read_value (out.create_input_stream (), type ());
|
|
46 |
}
|
|
47 |
|
|
48 |
public static com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress extract (org.omg.CORBA.Any a)
|
|
49 |
{
|
|
50 |
return read (a.create_input_stream ());
|
|
51 |
}
|
|
52 |
|
|
53 |
private static org.omg.CORBA.TypeCode __typeCode = null;
|
|
54 |
synchronized public static org.omg.CORBA.TypeCode type ()
|
|
55 |
{
|
|
56 |
if (__typeCode == null)
|
|
57 |
{
|
|
58 |
org.omg.CORBA.TypeCode _disTypeCode0;
|
|
59 |
_disTypeCode0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_short);
|
|
60 |
_disTypeCode0 = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.AddressingDispositionHelper.id (), "AddressingDisposition", _disTypeCode0);
|
|
61 |
org.omg.CORBA.UnionMember[] _members0 = new org.omg.CORBA.UnionMember [3];
|
|
62 |
org.omg.CORBA.TypeCode _tcOf_members0;
|
|
63 |
org.omg.CORBA.Any _anyOf_members0;
|
|
64 |
|
|
65 |
// Branch for object_key
|
|
66 |
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
|
|
67 |
_anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value);
|
|
68 |
_tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_octet);
|
|
69 |
_tcOf_members0 = org.omg.CORBA.ORB.init ().create_sequence_tc (0, _tcOf_members0);
|
|
70 |
_members0[0] = new org.omg.CORBA.UnionMember (
|
|
71 |
"object_key",
|
|
72 |
_anyOf_members0,
|
|
73 |
_tcOf_members0,
|
|
74 |
null);
|
|
75 |
|
|
76 |
// Branch for profile
|
|
77 |
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
|
|
78 |
_anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value);
|
|
79 |
_tcOf_members0 = org.omg.IOP.TaggedProfileHelper.type ();
|
|
80 |
_members0[1] = new org.omg.CORBA.UnionMember (
|
|
81 |
"profile",
|
|
82 |
_anyOf_members0,
|
|
83 |
_tcOf_members0,
|
|
84 |
null);
|
|
85 |
|
|
86 |
// Branch for ior
|
|
87 |
_anyOf_members0 = org.omg.CORBA.ORB.init ().create_any ();
|
|
88 |
_anyOf_members0.insert_short ((short)com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value);
|
|
89 |
_tcOf_members0 = com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.type ();
|
|
90 |
_members0[2] = new org.omg.CORBA.UnionMember (
|
|
91 |
"ior",
|
|
92 |
_anyOf_members0,
|
|
93 |
_tcOf_members0,
|
|
94 |
null);
|
|
95 |
__typeCode = org.omg.CORBA.ORB.init ().create_union_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddressHelper.id (), "TargetAddress", _disTypeCode0, _members0);
|
|
96 |
}
|
|
97 |
return __typeCode;
|
|
98 |
}
|
|
99 |
|
|
100 |
public static String id ()
|
|
101 |
{
|
|
102 |
return _id;
|
|
103 |
}
|
|
104 |
|
|
105 |
public static com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress read (org.omg.CORBA.portable.InputStream istream)
|
|
106 |
{
|
|
107 |
com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress value = new com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress ();
|
|
108 |
short _dis0 = (short)0;
|
|
109 |
_dis0 = istream.read_short ();
|
|
110 |
switch (_dis0)
|
|
111 |
{
|
|
112 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value:
|
|
113 |
byte _object_key[] = null;
|
|
114 |
int _len1 = istream.read_long ();
|
|
115 |
_object_key = new byte[_len1];
|
|
116 |
istream.read_octet_array (_object_key, 0, _len1);
|
|
117 |
value.object_key (_object_key);
|
|
118 |
break;
|
|
119 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value:
|
|
120 |
org.omg.IOP.TaggedProfile _profile = null;
|
|
121 |
_profile = org.omg.IOP.TaggedProfileHelper.read (istream);
|
|
122 |
value.profile (_profile);
|
|
123 |
break;
|
|
124 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value:
|
|
125 |
com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo _ior = null;
|
|
126 |
_ior = com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.read (istream);
|
|
127 |
value.ior (_ior);
|
|
128 |
break;
|
|
129 |
default:
|
|
130 |
throw new org.omg.CORBA.BAD_OPERATION ();
|
|
131 |
}
|
|
132 |
return value;
|
|
133 |
}
|
|
134 |
|
|
135 |
public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.impl.protocol.giopmsgheaders.TargetAddress value)
|
|
136 |
{
|
|
137 |
ostream.write_short (value.discriminator ());
|
|
138 |
switch (value.discriminator ())
|
|
139 |
{
|
|
140 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr.value:
|
|
141 |
ostream.write_long (value.object_key ().length);
|
|
142 |
ostream.write_octet_array (value.object_key (), 0, value.object_key ().length);
|
|
143 |
break;
|
|
144 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr.value:
|
|
145 |
org.omg.IOP.TaggedProfileHelper.write (ostream, value.profile ());
|
|
146 |
break;
|
|
147 |
case com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr.value:
|
|
148 |
com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.write (ostream, value.ior ());
|
|
149 |
break;
|
|
150 |
default:
|
|
151 |
throw new org.omg.CORBA.BAD_OPERATION ();
|
|
152 |
}
|
|
153 |
}
|
|
154 |
|
|
155 |
}
|