duke@1: /* ohair@158: * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@158: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@158: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@158: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@158: * or visit www.oracle.com if you need additional information or have any ohair@158: * questions. duke@1: */ duke@1: package org.omg.CORBA; duke@1: duke@1: duke@1: /** duke@1: * The Stub for Policy. For more information on duke@1: * Stub files, see duke@1: * "Generated Files: Stubs".

duke@1: * org/omg/CORBA/_PolicyStub.java duke@1: * Generated by the IDL-to-Java compiler (portable), version "3.0" duke@1: * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl. duke@1: * Saturday, July 17, 1999 12:26:20 AM PDT duke@1: */ duke@1: duke@1: public class _PolicyStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.Policy duke@1: { duke@1: /** Constructors duke@1: * NOTE: If the default constructor is used, the duke@1: * object is useless until _set_delegate (...) duke@1: * is called. duke@1: */ duke@1: public _PolicyStub () duke@1: { duke@1: super (); duke@1: } duke@1: duke@1: /** Constructs a _PolicyStub object initialized duke@1: * with the given Delegate object. duke@1: * duke@1: * @param delegate a Delegate Object duke@1: */ duke@1: public _PolicyStub (org.omg.CORBA.portable.Delegate delegate) duke@1: { duke@1: super (); duke@1: _set_delegate (delegate); duke@1: } duke@1: duke@1: duke@1: /** Returns the constant value that corresponds to the duke@1: * type of the policy object. The values of duke@1: * the polivy objectys are allocated by the OMG. duke@1: * New values for PolicyType should be obtained from the OMG by duke@1: * sending mail to request@omg.org. In general the constant duke@1: * values that are allocated are defined in conjunction with duke@1: * the definition of the corresponding policy object. duke@1: * @return the constant value that corresponds to the type of duke@1: * the policy object. duke@1: */ duke@1: public int policy_type () duke@1: { duke@1: org.omg.CORBA.portable.InputStream _in = null; duke@1: try { duke@1: org.omg.CORBA.portable.OutputStream _out = _request ("_get_policy_type", true); duke@1: _in = _invoke (_out); duke@1: int __result = org.omg.CORBA.PolicyTypeHelper.read (_in); duke@1: return __result; duke@1: } catch (org.omg.CORBA.portable.ApplicationException _ex) { duke@1: _in = _ex.getInputStream (); duke@1: String _id = _ex.getId (); duke@1: throw new org.omg.CORBA.MARSHAL (_id); duke@1: } catch (org.omg.CORBA.portable.RemarshalException _rm) { duke@1: return policy_type (); duke@1: } finally { duke@1: _releaseReply (_in); duke@1: } duke@1: } // policy_type duke@1: duke@1: duke@1: /** Copies the policy object. The copy does not retain any duke@1: * relationships that the policy had with any domain or object. duke@1: * @return the copy of the policy object. duke@1: */ duke@1: public org.omg.CORBA.Policy copy () duke@1: { duke@1: org.omg.CORBA.portable.InputStream _in = null; duke@1: try { duke@1: org.omg.CORBA.portable.OutputStream _out = _request ("copy", true); duke@1: _in = _invoke (_out); duke@1: org.omg.CORBA.Policy __result = org.omg.CORBA.PolicyHelper.read (_in); duke@1: return __result; duke@1: } catch (org.omg.CORBA.portable.ApplicationException _ex) { duke@1: _in = _ex.getInputStream (); duke@1: String _id = _ex.getId (); duke@1: throw new org.omg.CORBA.MARSHAL (_id); duke@1: } catch (org.omg.CORBA.portable.RemarshalException _rm) { duke@1: return copy (); duke@1: } finally { duke@1: _releaseReply (_in); duke@1: } duke@1: } // copy duke@1: duke@1: duke@1: /** Destroys the policy object. It is the responsibility of duke@1: * the policy object to determine whether it can be destroyed. duke@1: */ duke@1: public void destroy () duke@1: { duke@1: org.omg.CORBA.portable.InputStream _in = null; duke@1: try { duke@1: org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true); duke@1: _in = _invoke (_out); duke@1: } catch (org.omg.CORBA.portable.ApplicationException _ex) { duke@1: _in = _ex.getInputStream (); duke@1: String _id = _ex.getId (); duke@1: throw new org.omg.CORBA.MARSHAL (_id); duke@1: } catch (org.omg.CORBA.portable.RemarshalException _rm) { duke@1: destroy (); duke@1: } finally { duke@1: _releaseReply (_in); duke@1: } duke@1: } // destroy duke@1: duke@1: // Type-specific CORBA::Object operations duke@1: private static String[] __ids = { duke@1: "IDL:omg.org/CORBA/Policy:1.0"}; duke@1: duke@1: public String[] _ids () duke@1: { duke@1: return (String[])__ids.clone (); duke@1: } duke@1: duke@1: private void readObject (java.io.ObjectInputStream s) duke@1: { duke@1: try duke@1: { duke@1: String str = s.readUTF (); duke@1: org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str); duke@1: org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); duke@1: _set_delegate (delegate); duke@1: } catch (java.io.IOException e) {} duke@1: } duke@1: duke@1: private void writeObject (java.io.ObjectOutputStream s) duke@1: { duke@1: try duke@1: { duke@1: String str = org.omg.CORBA.ORB.init ().object_to_string (this); duke@1: s.writeUTF (str); duke@1: } catch (java.io.IOException e) {} duke@1: } duke@1: } // class _PolicyStub