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