1. /*
  2. * @(#)BindingHelper.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * File: ./org/omg/CosNaming/BindingHelper.java
  9. * From: nameservice.idl
  10. * Date: Tue Aug 11 03:12:09 1998
  11. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  12. */
  13. package org.omg.CosNaming;
  14. public class BindingHelper {
  15. // It is useless to have instances of this class
  16. private BindingHelper() { }
  17. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CosNaming.Binding that) {
  18. {
  19. out.write_long(that.binding_name.length);
  20. for (int __index = 0 ; __index < that.binding_name.length ; __index += 1) {
  21. org.omg.CosNaming.NameComponentHelper.write(out, that.binding_name[__index]);
  22. }
  23. }
  24. org.omg.CosNaming.BindingTypeHelper.write(out, that.binding_type);
  25. }
  26. public static org.omg.CosNaming.Binding read(org.omg.CORBA.portable.InputStream in) {
  27. org.omg.CosNaming.Binding that = new org.omg.CosNaming.Binding();
  28. {
  29. int __length = in.read_long();
  30. that.binding_name = new org.omg.CosNaming.NameComponent[__length];
  31. for (int __index = 0 ; __index < that.binding_name.length ; __index += 1) {
  32. that.binding_name[__index] = org.omg.CosNaming.NameComponentHelper.read(in);
  33. }
  34. }
  35. that.binding_type = org.omg.CosNaming.BindingTypeHelper.read(in);
  36. return that;
  37. }
  38. public static org.omg.CosNaming.Binding extract(org.omg.CORBA.Any a) {
  39. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  40. return read(in);
  41. }
  42. public static void insert(org.omg.CORBA.Any a, org.omg.CosNaming.Binding that) {
  43. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  44. write(out, that);
  45. a.read_value(out.create_input_stream(), type());
  46. }
  47. private static org.omg.CORBA.TypeCode _tc;
  48. synchronized public static org.omg.CORBA.TypeCode type() {
  49. int _memberCount = 2;
  50. org.omg.CORBA.StructMember[] _members = null;
  51. if (_tc == null) {
  52. _members= new org.omg.CORBA.StructMember[2];
  53. _members[0] = new org.omg.CORBA.StructMember(
  54. "binding_name",
  55. org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CosNaming.NameComponentHelper.type()),
  56. null);
  57. _members[1] = new org.omg.CORBA.StructMember(
  58. "binding_type",
  59. org.omg.CosNaming.BindingTypeHelper.type(),
  60. null);
  61. _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "Binding", _members);
  62. }
  63. return _tc;
  64. }
  65. public static String id() {
  66. return "IDL:omg.org/CosNaming/Binding:1.0";
  67. }
  68. }