1 /*
   2  * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  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  *
  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.
  24  */
  25 
  26 package com.sun.corba.se.impl.protocol.giopmsgheaders;
  27 
  28 
  29 /**
  30 * com/sun/corba/se/impl/protocol/giopmsgheaders/IORAddressingInfoHelper.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 IORAddressingInfoHelper
  37 {
  38   private static String  _id = "IDL:messages/IORAddressingInfo:1.0";
  39 
  40   public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo 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.IORAddressingInfo 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   private static boolean __active = false;
  55   synchronized public static org.omg.CORBA.TypeCode type ()
  56   {
  57     if (__typeCode == null)
  58     {
  59       synchronized (org.omg.CORBA.TypeCode.class)
  60       {
  61         if (__typeCode == null)
  62         {
  63           if (__active)
  64           {
  65             return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
  66           }
  67           __active = true;
  68           org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2];
  69           org.omg.CORBA.TypeCode _tcOf_members0 = null;
  70           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_ulong);
  71           _members0[0] = new org.omg.CORBA.StructMember (
  72             "selected_profile_index",
  73             _tcOf_members0,
  74             null);
  75           _tcOf_members0 = org.omg.IOP.IORHelper.type ();
  76           _members0[1] = new org.omg.CORBA.StructMember (
  77             "ior",
  78             _tcOf_members0,
  79             null);
  80           __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfoHelper.id (), "IORAddressingInfo", _members0);
  81           __active = false;
  82         }
  83       }
  84     }
  85     return __typeCode;
  86   }
  87 
  88   public static String id ()
  89   {
  90     return _id;
  91   }
  92 
  93   public static com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo read (org.omg.CORBA.portable.InputStream istream)
  94   {
  95     com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo value = new com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo ();
  96     value.selected_profile_index = istream.read_ulong ();
  97     value.ior = org.omg.IOP.IORHelper.read (istream);
  98     return value;
  99   }
 100 
 101   public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.impl.protocol.giopmsgheaders.IORAddressingInfo value)
 102   {
 103     ostream.write_ulong (value.selected_profile_index);
 104     org.omg.IOP.IORHelper.write (ostream, value.ior);
 105   }
 106 
 107 }