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