KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > ServiceInformationHelper


1 /*
2  * @(#)ServiceInformationHelper.java 1.12 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7  
8  /**
9  * The Helper for <tt>ServiceInformation</tt>. For more information on
10 * Helper files, see <a HREF="doc-files/generatedfiles.html#helper">
11 * "Generated Files: Helper Files"</a>.<P>
12 */

13
14 package org.omg.CORBA;
15
16
17 public abstract class ServiceInformationHelper {
18
19     public static void write(org.omg.CORBA.portable.OutputStream JavaDoc out, org.omg.CORBA.ServiceInformation JavaDoc that)
20     {
21     out.write_long(that.service_options.length);
22     out.write_ulong_array(that.service_options, 0, that.service_options.length);
23     out.write_long(that.service_details.length);
24     for (int i = 0 ; i < that.service_details.length ; i += 1) {
25         org.omg.CORBA.ServiceDetailHelper.write(out, that.service_details[i]);
26     }
27     }
28
29     public static org.omg.CORBA.ServiceInformation JavaDoc read(org.omg.CORBA.portable.InputStream JavaDoc in) {
30         org.omg.CORBA.ServiceInformation JavaDoc that = new org.omg.CORBA.ServiceInformation JavaDoc();
31     {
32         int __length = in.read_long();
33         that.service_options = new int[__length];
34         in.read_ulong_array(that.service_options, 0, that.service_options.length);
35     }
36     {
37         int __length = in.read_long();
38         that.service_details = new org.omg.CORBA.ServiceDetail JavaDoc[__length];
39         for (int __index = 0 ; __index < that.service_details.length ; __index += 1) {
40             that.service_details[__index] = org.omg.CORBA.ServiceDetailHelper.read(in);
41         }
42     }
43         return that;
44     }
45     public static org.omg.CORBA.ServiceInformation JavaDoc extract(org.omg.CORBA.Any JavaDoc a) {
46     org.omg.CORBA.portable.InputStream JavaDoc in = a.create_input_stream();
47     return read(in);
48     }
49     public static void insert(org.omg.CORBA.Any JavaDoc a, org.omg.CORBA.ServiceInformation JavaDoc that) {
50     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream();
51     write(out, that);
52     a.read_value(out.create_input_stream(), type());
53     }
54     private static org.omg.CORBA.TypeCode JavaDoc _tc;
55     synchronized public static org.omg.CORBA.TypeCode JavaDoc type() {
56     int _memberCount = 2;
57     org.omg.CORBA.StructMember JavaDoc[] _members = null;
58     if (_tc == null) {
59         _members= new org.omg.CORBA.StructMember JavaDoc[2];
60         _members[0] = new org.omg.CORBA.StructMember JavaDoc(
61                              "service_options",
62                              org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)),
63                              null);
64
65         _members[1] = new org.omg.CORBA.StructMember JavaDoc(
66                              "service_details",
67                              org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ServiceDetailHelper.type()),
68                              null);
69         _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceInformation", _members);
70     }
71     return _tc;
72     }
73     public static String JavaDoc id() {
74     return "IDL:omg.org/CORBA/ServiceInformation:1.0";
75     }
76 }
77
Popular Tags