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