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