1. /*
  2. * @(#)PrincipalHolder.java 1.27 04/05/18
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package org.omg.CORBA;
  8. import org.omg.CORBA.portable.Streamable;
  9. import org.omg.CORBA.portable.InputStream;
  10. import org.omg.CORBA.portable.OutputStream;
  11. /**
  12. * The Holder for <tt>Principal</tt>. For more information on
  13. * Holder files, see <a href="doc-files/generatedfiles.html#holder">
  14. * "Generated Files: Holder Files"</a>.<P>
  15. * A container class for values of type <code>Principal</code>
  16. * that is used to store "out" and "inout" parameters in IDL methods.
  17. * If an IDL method signature has an IDL <code>Principal</code> as an "out"
  18. * or "inout" parameter, the programmer must pass an instance of
  19. * <code>PrincipalHolder</code> as the corresponding
  20. * parameter in the method invocation; for "inout" parameters, the programmer
  21. * must also fill the "in" value to be sent to the server.
  22. * Before the method invocation returns, the ORB will fill in the
  23. * value corresponding to the "out" value returned from the server.
  24. * <P>
  25. * If <code>myPrincipalHolder</code> is an instance of <code>PrincipalHolder</code>,
  26. * the value stored in its <code>value</code> field can be accessed with
  27. * <code>myPrincipalHolder.value</code>.
  28. *
  29. * @version 1.14, 09/09/97
  30. * @since JDK1.2
  31. * @deprecated Deprecated by CORBA 2.2.
  32. */
  33. @Deprecated
  34. public final class PrincipalHolder implements Streamable {
  35. /**
  36. * The <code>Principal</code> value held by this <code>PrincipalHolder</code>
  37. * object.
  38. */
  39. public Principal value;
  40. /**
  41. * Constructs a new <code>PrincipalHolder</code> object with its
  42. * <code>value</code> field initialized to <code>null</code>.
  43. */
  44. public PrincipalHolder() {
  45. }
  46. /**
  47. * Constructs a new <code>PrincipalHolder</code> object with its
  48. * <code>value</code> field initialized to the given
  49. * <code>Principal</code> object.
  50. * @param initial the <code>Principal</code> with which to initialize
  51. * the <code>value</code> field of the newly-created
  52. * <code>PrincipalHolder</code> object
  53. */
  54. public PrincipalHolder(Principal initial) {
  55. value = initial;
  56. }
  57. public void _read(InputStream input) {
  58. value = input.read_Principal();
  59. }
  60. public void _write(OutputStream output) {
  61. output.write_Principal(value);
  62. }
  63. public org.omg.CORBA.TypeCode _type() {
  64. return ORB.init().get_primitive_tc(TCKind.tk_Principal);
  65. }
  66. }