BadKindHelper.java revision 898:e68b042f7130
138494Sobrien/*
238494Sobrien * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
3174294Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
438494Sobrien *
538494Sobrien * This code is free software; you can redistribute it and/or modify it
638494Sobrien * under the terms of the GNU General Public License version 2 only, as
738494Sobrien * published by the Free Software Foundation.  Oracle designates this
838494Sobrien * particular file as subject to the "Classpath" exception as provided
938494Sobrien * by Oracle in the LICENSE file that accompanied this code.
1038494Sobrien *
1138494Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT
1238494Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1338494Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1438494Sobrien * version 2 for more details (a copy is included in the LICENSE file that
1538494Sobrien * accompanied this code).
1638494Sobrien *
1738494Sobrien * You should have received a copy of the GNU General Public License version
1838494Sobrien * 2 along with this work; if not, write to the Free Software Foundation,
1938494Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2038494Sobrien *
2138494Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2238494Sobrien * or visit www.oracle.com if you need additional information or have any
2338494Sobrien * questions.
2438494Sobrien */
2538494Sobrien
2638494Sobrienpackage org.omg.CORBA.TypeCodePackage;
2738494Sobrien
2838494Sobrien
2938494Sobrien/**
3038494Sobrien * This Helper class is used to facilitate the marshalling of
3138494Sobrien * {@code TypeCodePackage/BadKind}.
3238494Sobrien * For more information on Helper files, see
3338494Sobrien * <a href="{@docRoot}/org/omg/CORBA/doc-files/generatedfiles.html#helper">
3438494Sobrien * "Generated Files: Helper Files"</a>.
3538494Sobrien */
3638494Sobrien
3738494Sobrienabstract public class BadKindHelper
3838494Sobrien{
3938494Sobrien  private static String  _id = "IDL:omg.org.CORBA/TypeCode/BadKind:1.0";
40174294Sobrien
4138494Sobrien  public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.TypeCodePackage.BadKind that)
4238494Sobrien  {
4338494Sobrien    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
4438494Sobrien    a.type (type ());
4538494Sobrien    write (out, that);
4638494Sobrien    a.read_value (out.create_input_stream (), type ());
47174294Sobrien  }
4838494Sobrien
4938494Sobrien  public static org.omg.CORBA.TypeCodePackage.BadKind extract (org.omg.CORBA.Any a)
5038494Sobrien  {
5138494Sobrien    return read (a.create_input_stream ());
52119679Smbr  }
5351292Sobrien
5451292Sobrien  private static org.omg.CORBA.TypeCode __typeCode = null;
5538494Sobrien  private static boolean __active = false;
5638494Sobrien  synchronized public static org.omg.CORBA.TypeCode type ()
5738494Sobrien  {
5838494Sobrien    if (__typeCode == null)
5938494Sobrien    {
6038494Sobrien      synchronized (org.omg.CORBA.TypeCode.class)
6138494Sobrien      {
6238494Sobrien        if (__typeCode == null)
63174294Sobrien        {
6438494Sobrien          if (__active)
6538494Sobrien          {
6638494Sobrien            return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
6738494Sobrien          }
6838494Sobrien          __active = true;
6938494Sobrien          org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
7038494Sobrien          org.omg.CORBA.TypeCode _tcOf_members0 = null;
7138494Sobrien          __typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.TypeCodePackage.BadKindHelper.id (), "BadKind", _members0);
7238494Sobrien          __active = false;
7338494Sobrien        }
7438494Sobrien      }
7538494Sobrien    }
7638494Sobrien    return __typeCode;
7738494Sobrien  }
7838494Sobrien
7938494Sobrien  public static String id ()
8038494Sobrien  {
8138494Sobrien    return _id;
8238494Sobrien  }
8338494Sobrien
8438494Sobrien  public static org.omg.CORBA.TypeCodePackage.BadKind read (org.omg.CORBA.portable.InputStream istream)
8538494Sobrien  {
8638494Sobrien    org.omg.CORBA.TypeCodePackage.BadKind value = new org.omg.CORBA.TypeCodePackage.BadKind ();
8738494Sobrien    // read and discard the repository ID
88119679Smbr    istream.read_string ();
89119679Smbr    return value;
90119679Smbr  }
91119679Smbr
92119679Smbr  public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.TypeCodePackage.BadKind value)
93119679Smbr  {
94119679Smbr    // write the repository ID
95119679Smbr    ostream.write_string (id ());
96174294Sobrien  }
97119679Smbr
98119679Smbr}
99119679Smbr