1. /*
  2. * @(#)ServiceInformationHolder.java 1.10 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. /**
  12. * A Holder class for a <code>ServiceInformation</code> object
  13. * that is used to store "out" and "inout" parameters in IDL methods.
  14. * If an IDL method signature has an IDL <code>xxx</code> as an "out"
  15. * or "inout" parameter, the programmer must pass an instance of
  16. * <code>ServiceInformationHolder</code> as the corresponding
  17. * parameter in the method invocation; for "inout" parameters, the programmer
  18. * must also fill the "in" value to be sent to the server.
  19. * Before the method invocation returns, the ORB will fill in the
  20. * value corresponding to the "out" value returned from the server.
  21. * <P>
  22. * If <code>myServiceInformationHolder</code> is an instance of <code>ServiceInformationHolder</code>,
  23. * the value stored in its <code>value</code> field can be accessed with
  24. * <code>myServiceInformationHolder.value</code>.
  25. */
  26. public final class ServiceInformationHolder
  27. implements org.omg.CORBA.portable.Streamable {
  28. /**
  29. * The <code>ServiceInformation</code> value held by this
  30. * <code>ServiceInformationHolder</code> object in its <code>value</code> field.
  31. */
  32. public ServiceInformation value;
  33. /**
  34. * Constructs a new <code>ServiceInformationHolder</code> object with its
  35. * <code>value</code> field initialized to null.
  36. */
  37. public ServiceInformationHolder() {
  38. this(null);
  39. }
  40. /**
  41. * Constructs a new <code>ServiceInformationHolder</code> object with its
  42. * <code>value</code> field initialized to the given
  43. * <code>ServiceInformation</code> object.
  44. *
  45. * @param arg the <code>ServiceInformation</code> object with which to initialize
  46. * the <code>value</code> field of the newly-created
  47. * <code>ServiceInformationHolder</code> object
  48. */
  49. public ServiceInformationHolder(org.omg.CORBA.ServiceInformation arg) {
  50. value = arg;
  51. }
  52. /**
  53. * Marshals the value in this <code>ServiceInformationHolder</code> object's
  54. * <code>value</code> field to the output stream <code>out</code>.
  55. *
  56. * @param out the <code>OutputStream</code> object that will contain
  57. * the CDR formatted data
  58. */
  59. public void _write(org.omg.CORBA.portable.OutputStream out) {
  60. org.omg.CORBA.ServiceInformationHelper.write(out, value);
  61. }
  62. /**
  63. * Reads unmarshalled data from the input stream <code>in</code> and assigns it to
  64. * the <code>value</code> field in this <code>ServiceInformationHolder</code> object.
  65. *
  66. * @param in the <code>InputStream</code> object containing CDR
  67. * formatted data from the wire
  68. */
  69. public void _read(org.omg.CORBA.portable.InputStream in) {
  70. value = org.omg.CORBA.ServiceInformationHelper.read(in);
  71. }
  72. /**
  73. * Retrieves the <code>TypeCode</code> object that corresponds
  74. * to the value held in this <code>ServiceInformationHolder</code> object's
  75. * <code>value</code> field.
  76. *
  77. * @return the type code for the value held in this <code>ServiceInformationHolder</code>
  78. * object
  79. */
  80. public org.omg.CORBA.TypeCode _type() {
  81. return org.omg.CORBA.ServiceInformationHelper.type();
  82. }
  83. }