KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > CORBA > PrincipalHolder


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
8 package org.omg.CORBA;
9
10 import org.omg.CORBA.portable.Streamable JavaDoc;
11 import org.omg.CORBA.portable.InputStream JavaDoc;
12 import org.omg.CORBA.portable.OutputStream JavaDoc;
13
14
15 /**
16  * The Holder for <tt>Principal</tt>. For more information on
17  * Holder files, see <a HREF="doc-files/generatedfiles.html#holder">
18  * "Generated Files: Holder Files"</a>.<P>
19  * A container class for values of type <code>Principal</code>
20  * that is used to store "out" and "inout" parameters in IDL methods.
21  * If an IDL method signature has an IDL <code>Principal</code> as an "out"
22  * or "inout" parameter, the programmer must pass an instance of
23  * <code>PrincipalHolder</code> as the corresponding
24  * parameter in the method invocation; for "inout" parameters, the programmer
25  * must also fill the "in" value to be sent to the server.
26  * Before the method invocation returns, the ORB will fill in the
27  * value corresponding to the "out" value returned from the server.
28  * <P>
29  * If <code>myPrincipalHolder</code> is an instance of <code>PrincipalHolder</code>,
30  * the value stored in its <code>value</code> field can be accessed with
31  * <code>myPrincipalHolder.value</code>.
32  *
33  * @version 1.14, 09/09/97
34  * @since JDK1.2
35  * @deprecated Deprecated by CORBA 2.2.
36  */

37 @Deprecated JavaDoc
38 public final class PrincipalHolder implements Streamable JavaDoc {
39     /**
40      * The <code>Principal</code> value held by this <code>PrincipalHolder</code>
41      * object.
42      */

43     public Principal JavaDoc value;
44
45     /**
46      * Constructs a new <code>PrincipalHolder</code> object with its
47      * <code>value</code> field initialized to <code>null</code>.
48      */

49     public PrincipalHolder() {
50     }
51
52     /**
53      * Constructs a new <code>PrincipalHolder</code> object with its
54      * <code>value</code> field initialized to the given
55      * <code>Principal</code> object.
56      * @param initial the <code>Principal</code> with which to initialize
57      * the <code>value</code> field of the newly-created
58      * <code>PrincipalHolder</code> object
59      */

60     public PrincipalHolder(Principal JavaDoc initial) {
61     value = initial;
62     }
63
64     public void _read(InputStream JavaDoc input) {
65     value = input.read_Principal();
66     }
67
68     public void _write(OutputStream JavaDoc output) {
69     output.write_Principal(value);
70     }
71
72     public org.omg.CORBA.TypeCode JavaDoc _type() {
73     return ORB.init().get_primitive_tc(TCKind.tk_Principal);
74     }
75
76 }
77
Popular Tags