ServiceInformationHelper.java revision 704:3ef63dbde965
167761Smsmith/*
267761Smsmith * Copyright (c) 1998, 2001, Oracle and/or its affiliates. All rights reserved.
367761Smsmith * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
478991Smsmith *
567761Smsmith * This code is free software; you can redistribute it and/or modify it
667761Smsmith * under the terms of the GNU General Public License version 2 only, as
767761Smsmith * published by the Free Software Foundation.  Oracle designates this
867761Smsmith * particular file as subject to the "Classpath" exception as provided
967761Smsmith * by Oracle in the LICENSE file that accompanied this code.
1067761Smsmith *
1167761Smsmith * This code is distributed in the hope that it will be useful, but WITHOUT
1267761Smsmith * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1367761Smsmith * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1467761Smsmith * version 2 for more details (a copy is included in the LICENSE file that
1567761Smsmith * accompanied this code).
1667761Smsmith *
1767761Smsmith * You should have received a copy of the GNU General Public License version
1867761Smsmith * 2 along with this work; if not, write to the Free Software Foundation,
1967761Smsmith * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2067761Smsmith *
2167761Smsmith * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2267761Smsmith * or visit www.oracle.com if you need additional information or have any
2367761Smsmith * questions.
2467761Smsmith */
2567761Smsmith
2667761Smsmith /**
2767761Smsmith  * The Helper for {@code ServiceInformation}. For more information on
2867761Smsmith  * Helper files, see <a href="doc-files/generatedfiles.html#helper">
2967761Smsmith  * "Generated Files: Helper Files"</a>.<P>
30143002Sobrien  */
31143002Sobrien
32143002Sobrienpackage org.omg.CORBA;
3367761Smsmith
34297748Sjhb
35297748Sjhbpublic abstract class ServiceInformationHelper {
3667761Smsmith
3767761Smsmith    public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.ServiceInformation that)
3876166Smarkm    {
39110894Stakawata        out.write_long(that.service_options.length);
4067761Smsmith        out.write_ulong_array(that.service_options, 0, that.service_options.length);
41129879Sphk        out.write_long(that.service_details.length);
4267761Smsmith        for (int i = 0 ; i < that.service_details.length ; i += 1) {
4367761Smsmith            org.omg.CORBA.ServiceDetailHelper.write(out, that.service_details[i]);
4467761Smsmith        }
4567761Smsmith    }
4667761Smsmith
4767761Smsmith    public static org.omg.CORBA.ServiceInformation read(org.omg.CORBA.portable.InputStream in) {
4886133Siwasaki        org.omg.CORBA.ServiceInformation that = new org.omg.CORBA.ServiceInformation();
4985835Siwasaki        {
50123337Snjl            int __length = in.read_long();
51189903Sjkim            that.service_options = new int[__length];
52127193Snjl            in.read_ulong_array(that.service_options, 0, that.service_options.length);
53189903Sjkim        }
5467761Smsmith        {
55181987Sjhb            int __length = in.read_long();
56335657Savg            that.service_details = new org.omg.CORBA.ServiceDetail[__length];
57181987Sjhb            for (int __index = 0 ; __index < that.service_details.length ; __index += 1) {
58181987Sjhb                that.service_details[__index] = org.omg.CORBA.ServiceDetailHelper.read(in);
5967761Smsmith            }
60122764Snjl        }
61122764Snjl        return that;
6282537Smsmith    }
63131258Snjl    public static org.omg.CORBA.ServiceInformation extract(org.omg.CORBA.Any a) {
6482537Smsmith        org.omg.CORBA.portable.InputStream in = a.create_input_stream();
65193530Sjkim        return read(in);
66193530Sjkim    }
67193530Sjkim    public static void insert(org.omg.CORBA.Any a, org.omg.CORBA.ServiceInformation that) {
68193530Sjkim        org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
6967761Smsmith        write(out, that);
7067761Smsmith        a.read_value(out.create_input_stream(), type());
7167761Smsmith    }
72167814Sjkim    private static org.omg.CORBA.TypeCode _tc;
73167814Sjkim    synchronized public static org.omg.CORBA.TypeCode type() {
74227293Sed        int _memberCount = 2;
7567761Smsmith        org.omg.CORBA.StructMember[] _members = null;
76119529Snjl        if (_tc == null) {
7778991Smsmith            _members= new org.omg.CORBA.StructMember[2];
7891120Smsmith            _members[0] = new org.omg.CORBA.StructMember(
7969744Smsmith                                                         "service_options",
8067761Smsmith                                                         org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)),
8167761Smsmith                                                         null);
8267761Smsmith
8367761Smsmith            _members[1] = new org.omg.CORBA.StructMember(
8467761Smsmith                                                         "service_details",
85126080Sphk                                                         org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ServiceDetailHelper.type()),
86111815Sphk                                                         null);
87111815Sphk            _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceInformation", _members);
88111815Sphk        }
89111815Sphk        return _tc;
9067761Smsmith    }
9167761Smsmith    public static String id() {
92214390Sjkim        return "IDL:omg.org/CORBA/ServiceInformation:1.0";
93214390Sjkim    }
94214390Sjkim}
95214390Sjkim