KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)_PolicyStub.java 1.10 03/12/19
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
9
10 /**
11 * The Stub for <tt>Policy</tt>. For more information on
12 * Stub files, see <a HREF="doc-files/generatedfiles.html#stub">
13 * "Generated Files: Stubs"</a>.<P>
14 * org/omg/CORBA/_PolicyStub.java
15 * Generated by the IDL-to-Java compiler (portable), version "3.0"
16 * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl.
17 * Saturday, July 17, 1999 12:26:20 AM PDT
18 */

19
20 public class _PolicyStub extends org.omg.CORBA.portable.ObjectImpl JavaDoc implements org.omg.CORBA.Policy JavaDoc
21 {
22   /** Constructors
23    * NOTE: If the default constructor is used, the
24    * object is useless until _set_delegate (...)
25    * is called.
26    */

27   public _PolicyStub ()
28   {
29     super ();
30   }
31
32   /** Constructs a <code>_PolicyStub</code> object initialized
33    * with the given <code>Delegate</code> object.
34    *
35    * @param delegate a Delegate Object
36    */

37   public _PolicyStub (org.omg.CORBA.portable.Delegate JavaDoc delegate)
38   {
39     super ();
40     _set_delegate (delegate);
41   }
42
43
44   /** Returns the constant value that corresponds to the
45         * type of the policy object. The values of
46         * the polivy objectys are allocated by the OMG.
47         * New values for PolicyType should be obtained from the OMG by
48         * sending mail to request@omg.org. In general the constant
49         * values that are allocated are defined in conjunction with
50         * the definition of the corresponding policy object.
51         * @return the constant value that corresponds to the type of
52         * the policy object.
53         */

54   public int policy_type ()
55   {
56     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
57     try {
58        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("_get_policy_type", true);
59        _in = _invoke (_out);
60        int __result = org.omg.CORBA.PolicyTypeHelper.read (_in);
61        return __result;
62     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
63        _in = _ex.getInputStream ();
64        String JavaDoc _id = _ex.getId ();
65        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
66     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
67        return policy_type ();
68     } finally {
69         _releaseReply (_in);
70     }
71   } // policy_type
72

73
74   /** Copies the policy object. The copy does not retain any
75         * relationships that the policy had with any domain or object.
76         * @return the copy of the policy object.
77         */

78   public org.omg.CORBA.Policy JavaDoc copy ()
79   {
80     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
81     try {
82        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("copy", true);
83        _in = _invoke (_out);
84        org.omg.CORBA.Policy JavaDoc __result = org.omg.CORBA.PolicyHelper.read (_in);
85        return __result;
86     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
87        _in = _ex.getInputStream ();
88        String JavaDoc _id = _ex.getId ();
89        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
90     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
91        return copy ();
92     } finally {
93         _releaseReply (_in);
94     }
95   } // copy
96

97
98   /** Destroys the policy object. It is the responsibility of
99         * the policy object to determine whether it can be destroyed.
100         */

101   public void destroy ()
102   {
103     org.omg.CORBA.portable.InputStream JavaDoc _in = null;
104     try {
105        org.omg.CORBA.portable.OutputStream JavaDoc _out = _request ("destroy", true);
106        _in = _invoke (_out);
107     } catch (org.omg.CORBA.portable.ApplicationException JavaDoc _ex) {
108        _in = _ex.getInputStream ();
109        String JavaDoc _id = _ex.getId ();
110        throw new org.omg.CORBA.MARSHAL JavaDoc (_id);
111     } catch (org.omg.CORBA.portable.RemarshalException JavaDoc _rm) {
112        destroy ();
113     } finally {
114         _releaseReply (_in);
115     }
116   } // destroy
117

118   // Type-specific CORBA::Object operations
119
private static String JavaDoc[] __ids = {
120     "IDL:omg.org/CORBA/Policy:1.0"};
121
122   public String JavaDoc[] _ids ()
123   {
124     return (String JavaDoc[])__ids.clone ();
125   }
126
127   private void readObject (java.io.ObjectInputStream JavaDoc s)
128   {
129      try
130      {
131        String JavaDoc str = s.readUTF ();
132        org.omg.CORBA.Object JavaDoc obj = org.omg.CORBA.ORB.init ().string_to_object (str);
133        org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc) obj)._get_delegate ();
134        _set_delegate (delegate);
135      } catch (java.io.IOException JavaDoc e) {}
136   }
137
138   private void writeObject (java.io.ObjectOutputStream JavaDoc s)
139   {
140      try
141      {
142        String JavaDoc str = org.omg.CORBA.ORB.init ().object_to_string (this);
143        s.writeUTF (str);
144      } catch (java.io.IOException JavaDoc e) {}
145   }
146 } // class _PolicyStub
147
Popular Tags