001: /*
002: * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: package org.omg.CORBA;
026:
027: /**
028: * The Stub for <tt>Policy</tt>. For more information on
029: * Stub files, see <a href="doc-files/generatedfiles.html#stub">
030: * "Generated Files: Stubs"</a>.<P>
031: * org/omg/CORBA/_PolicyStub.java
032: * Generated by the IDL-to-Java compiler (portable), version "3.0"
033: * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl.
034: * Saturday, July 17, 1999 12:26:20 AM PDT
035: */
036:
037: public class _PolicyStub extends org.omg.CORBA.portable.ObjectImpl
038: implements org.omg.CORBA.Policy {
039: /** Constructors
040: * NOTE: If the default constructor is used, the
041: * object is useless until _set_delegate (...)
042: * is called.
043: */
044: public _PolicyStub() {
045: super ();
046: }
047:
048: /** Constructs a <code>_PolicyStub</code> object initialized
049: * with the given <code>Delegate</code> object.
050: *
051: * @param delegate a Delegate Object
052: */
053: public _PolicyStub(org.omg.CORBA.portable.Delegate delegate) {
054: super ();
055: _set_delegate(delegate);
056: }
057:
058: /** Returns the constant value that corresponds to the
059: * type of the policy object. The values of
060: * the polivy objectys are allocated by the OMG.
061: * New values for PolicyType should be obtained from the OMG by
062: * sending mail to request@omg.org. In general the constant
063: * values that are allocated are defined in conjunction with
064: * the definition of the corresponding policy object.
065: * @return the constant value that corresponds to the type of
066: * the policy object.
067: */
068: public int policy_type() {
069: org.omg.CORBA.portable.InputStream _in = null;
070: try {
071: org.omg.CORBA.portable.OutputStream _out = _request(
072: "_get_policy_type", true);
073: _in = _invoke(_out);
074: int __result = org.omg.CORBA.PolicyTypeHelper.read(_in);
075: return __result;
076: } catch (org.omg.CORBA.portable.ApplicationException _ex) {
077: _in = _ex.getInputStream();
078: String _id = _ex.getId();
079: throw new org.omg.CORBA.MARSHAL(_id);
080: } catch (org.omg.CORBA.portable.RemarshalException _rm) {
081: return policy_type();
082: } finally {
083: _releaseReply(_in);
084: }
085: } // policy_type
086:
087: /** Copies the policy object. The copy does not retain any
088: * relationships that the policy had with any domain or object.
089: * @return the copy of the policy object.
090: */
091: public org.omg.CORBA.Policy copy() {
092: org.omg.CORBA.portable.InputStream _in = null;
093: try {
094: org.omg.CORBA.portable.OutputStream _out = _request("copy",
095: true);
096: _in = _invoke(_out);
097: org.omg.CORBA.Policy __result = org.omg.CORBA.PolicyHelper
098: .read(_in);
099: return __result;
100: } catch (org.omg.CORBA.portable.ApplicationException _ex) {
101: _in = _ex.getInputStream();
102: String _id = _ex.getId();
103: throw new org.omg.CORBA.MARSHAL(_id);
104: } catch (org.omg.CORBA.portable.RemarshalException _rm) {
105: return copy();
106: } finally {
107: _releaseReply(_in);
108: }
109: } // copy
110:
111: /** Destroys the policy object. It is the responsibility of
112: * the policy object to determine whether it can be destroyed.
113: */
114: public void destroy() {
115: org.omg.CORBA.portable.InputStream _in = null;
116: try {
117: org.omg.CORBA.portable.OutputStream _out = _request(
118: "destroy", true);
119: _in = _invoke(_out);
120: } catch (org.omg.CORBA.portable.ApplicationException _ex) {
121: _in = _ex.getInputStream();
122: String _id = _ex.getId();
123: throw new org.omg.CORBA.MARSHAL(_id);
124: } catch (org.omg.CORBA.portable.RemarshalException _rm) {
125: destroy();
126: } finally {
127: _releaseReply(_in);
128: }
129: } // destroy
130:
131: // Type-specific CORBA::Object operations
132: private static String[] __ids = { "IDL:omg.org/CORBA/Policy:1.0" };
133:
134: public String[] _ids() {
135: return (String[]) __ids.clone();
136: }
137:
138: private void readObject(java.io.ObjectInputStream s) {
139: try {
140: String str = s.readUTF();
141: org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init()
142: .string_to_object(str);
143: org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)
144: ._get_delegate();
145: _set_delegate(delegate);
146: } catch (java.io.IOException e) {
147: }
148: }
149:
150: private void writeObject(java.io.ObjectOutputStream s) {
151: try {
152: String str = org.omg.CORBA.ORB.init()
153: .object_to_string(this );
154: s.writeUTF(str);
155: } catch (java.io.IOException e) {
156: }
157: }
158: } // class _PolicyStub
|