1. /*
  2. * @(#)ServiceInformationHelper.java 1.6 00/02/02
  3. *
  4. * Copyright 1998-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. package org.omg.CORBA;
  11. public class ServiceInformationHelper {
  12. // It is useless to have instances of this class
  13. private ServiceInformationHelper() { }
  14. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.ServiceInformation that)
  15. {
  16. out.write_long(that.service_options.length);
  17. out.write_ulong_array(that.service_options, 0, that.service_options.length);
  18. out.write_long(that.service_details.length);
  19. for (int i = 0 ; i < that.service_details.length ; i += 1) {
  20. org.omg.CORBA.ServiceDetailHelper.write(out, that.service_details[i]);
  21. }
  22. }
  23. public static org.omg.CORBA.ServiceInformation read(org.omg.CORBA.portable.InputStream in) {
  24. org.omg.CORBA.ServiceInformation that = new org.omg.CORBA.ServiceInformation();
  25. {
  26. int __length = in.read_long();
  27. that.service_options = new int[__length];
  28. in.read_ulong_array(that.service_options, 0, that.service_options.length);
  29. }
  30. {
  31. int __length = in.read_long();
  32. that.service_details = new org.omg.CORBA.ServiceDetail[__length];
  33. for (int __index = 0 ; __index < that.service_details.length ; __index += 1) {
  34. that.service_details[__index] = org.omg.CORBA.ServiceDetailHelper.read(in);
  35. }
  36. }
  37. return that;
  38. }
  39. public static org.omg.CORBA.ServiceInformation extract(org.omg.CORBA.Any a) {
  40. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  41. return read(in);
  42. }
  43. public static void insert(org.omg.CORBA.Any a, org.omg.CORBA.ServiceInformation that) {
  44. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  45. write(out, that);
  46. a.read_value(out.create_input_stream(), type());
  47. }
  48. private static org.omg.CORBA.TypeCode _tc;
  49. synchronized public static org.omg.CORBA.TypeCode type() {
  50. int _memberCount = 2;
  51. org.omg.CORBA.StructMember[] _members = null;
  52. if (_tc == null) {
  53. _members= new org.omg.CORBA.StructMember[2];
  54. _members[0] = new org.omg.CORBA.StructMember(
  55. "service_options",
  56. org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)),
  57. null);
  58. _members[1] = new org.omg.CORBA.StructMember(
  59. "service_details",
  60. org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ServiceDetailHelper.type()),
  61. null);
  62. _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceInformation", _members);
  63. }
  64. return _tc;
  65. }
  66. public static String id() {
  67. return "IDL:omg.org/CORBA/ServiceInformation:1.0";
  68. }
  69. }