src/share/classes/org/omg/CORBA/_PolicyStub.java

Thu, 31 Aug 2017 18:10:36 +0800

author
aoqi
date
Thu, 31 Aug 2017 18:10:36 +0800
changeset 748
6845b95cba6b
parent 158
91006f157c46
parent 0
7ef37b2cdcad
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation. Oracle designates this
aoqi@0 8 * particular file as subject to the "Classpath" exception as provided
aoqi@0 9 * by Oracle in the LICENSE file that accompanied this code.
aoqi@0 10 *
aoqi@0 11 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 14 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 15 * accompanied this code).
aoqi@0 16 *
aoqi@0 17 * You should have received a copy of the GNU General Public License version
aoqi@0 18 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 20 *
aoqi@0 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 22 * or visit www.oracle.com if you need additional information or have any
aoqi@0 23 * questions.
aoqi@0 24 */
aoqi@0 25 package org.omg.CORBA;
aoqi@0 26
aoqi@0 27
aoqi@0 28 /**
aoqi@0 29 * The Stub for <tt>Policy</tt>. For more information on
aoqi@0 30 * Stub files, see <a href="doc-files/generatedfiles.html#stub">
aoqi@0 31 * "Generated Files: Stubs"</a>.<P>
aoqi@0 32 * org/omg/CORBA/_PolicyStub.java
aoqi@0 33 * Generated by the IDL-to-Java compiler (portable), version "3.0"
aoqi@0 34 * from ../../../../../src/share/classes/org/omg/PortableServer/corba.idl.
aoqi@0 35 * Saturday, July 17, 1999 12:26:20 AM PDT
aoqi@0 36 */
aoqi@0 37
aoqi@0 38 public class _PolicyStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.CORBA.Policy
aoqi@0 39 {
aoqi@0 40 /** Constructors
aoqi@0 41 * NOTE: If the default constructor is used, the
aoqi@0 42 * object is useless until _set_delegate (...)
aoqi@0 43 * is called.
aoqi@0 44 */
aoqi@0 45 public _PolicyStub ()
aoqi@0 46 {
aoqi@0 47 super ();
aoqi@0 48 }
aoqi@0 49
aoqi@0 50 /** Constructs a <code>_PolicyStub</code> object initialized
aoqi@0 51 * with the given <code>Delegate</code> object.
aoqi@0 52 *
aoqi@0 53 * @param delegate a Delegate Object
aoqi@0 54 */
aoqi@0 55 public _PolicyStub (org.omg.CORBA.portable.Delegate delegate)
aoqi@0 56 {
aoqi@0 57 super ();
aoqi@0 58 _set_delegate (delegate);
aoqi@0 59 }
aoqi@0 60
aoqi@0 61
aoqi@0 62 /** Returns the constant value that corresponds to the
aoqi@0 63 * type of the policy object. The values of
aoqi@0 64 * the polivy objectys are allocated by the OMG.
aoqi@0 65 * New values for PolicyType should be obtained from the OMG by
aoqi@0 66 * sending mail to request@omg.org. In general the constant
aoqi@0 67 * values that are allocated are defined in conjunction with
aoqi@0 68 * the definition of the corresponding policy object.
aoqi@0 69 * @return the constant value that corresponds to the type of
aoqi@0 70 * the policy object.
aoqi@0 71 */
aoqi@0 72 public int policy_type ()
aoqi@0 73 {
aoqi@0 74 org.omg.CORBA.portable.InputStream _in = null;
aoqi@0 75 try {
aoqi@0 76 org.omg.CORBA.portable.OutputStream _out = _request ("_get_policy_type", true);
aoqi@0 77 _in = _invoke (_out);
aoqi@0 78 int __result = org.omg.CORBA.PolicyTypeHelper.read (_in);
aoqi@0 79 return __result;
aoqi@0 80 } catch (org.omg.CORBA.portable.ApplicationException _ex) {
aoqi@0 81 _in = _ex.getInputStream ();
aoqi@0 82 String _id = _ex.getId ();
aoqi@0 83 throw new org.omg.CORBA.MARSHAL (_id);
aoqi@0 84 } catch (org.omg.CORBA.portable.RemarshalException _rm) {
aoqi@0 85 return policy_type ();
aoqi@0 86 } finally {
aoqi@0 87 _releaseReply (_in);
aoqi@0 88 }
aoqi@0 89 } // policy_type
aoqi@0 90
aoqi@0 91
aoqi@0 92 /** Copies the policy object. The copy does not retain any
aoqi@0 93 * relationships that the policy had with any domain or object.
aoqi@0 94 * @return the copy of the policy object.
aoqi@0 95 */
aoqi@0 96 public org.omg.CORBA.Policy copy ()
aoqi@0 97 {
aoqi@0 98 org.omg.CORBA.portable.InputStream _in = null;
aoqi@0 99 try {
aoqi@0 100 org.omg.CORBA.portable.OutputStream _out = _request ("copy", true);
aoqi@0 101 _in = _invoke (_out);
aoqi@0 102 org.omg.CORBA.Policy __result = org.omg.CORBA.PolicyHelper.read (_in);
aoqi@0 103 return __result;
aoqi@0 104 } catch (org.omg.CORBA.portable.ApplicationException _ex) {
aoqi@0 105 _in = _ex.getInputStream ();
aoqi@0 106 String _id = _ex.getId ();
aoqi@0 107 throw new org.omg.CORBA.MARSHAL (_id);
aoqi@0 108 } catch (org.omg.CORBA.portable.RemarshalException _rm) {
aoqi@0 109 return copy ();
aoqi@0 110 } finally {
aoqi@0 111 _releaseReply (_in);
aoqi@0 112 }
aoqi@0 113 } // copy
aoqi@0 114
aoqi@0 115
aoqi@0 116 /** Destroys the policy object. It is the responsibility of
aoqi@0 117 * the policy object to determine whether it can be destroyed.
aoqi@0 118 */
aoqi@0 119 public void destroy ()
aoqi@0 120 {
aoqi@0 121 org.omg.CORBA.portable.InputStream _in = null;
aoqi@0 122 try {
aoqi@0 123 org.omg.CORBA.portable.OutputStream _out = _request ("destroy", true);
aoqi@0 124 _in = _invoke (_out);
aoqi@0 125 } catch (org.omg.CORBA.portable.ApplicationException _ex) {
aoqi@0 126 _in = _ex.getInputStream ();
aoqi@0 127 String _id = _ex.getId ();
aoqi@0 128 throw new org.omg.CORBA.MARSHAL (_id);
aoqi@0 129 } catch (org.omg.CORBA.portable.RemarshalException _rm) {
aoqi@0 130 destroy ();
aoqi@0 131 } finally {
aoqi@0 132 _releaseReply (_in);
aoqi@0 133 }
aoqi@0 134 } // destroy
aoqi@0 135
aoqi@0 136 // Type-specific CORBA::Object operations
aoqi@0 137 private static String[] __ids = {
aoqi@0 138 "IDL:omg.org/CORBA/Policy:1.0"};
aoqi@0 139
aoqi@0 140 public String[] _ids ()
aoqi@0 141 {
aoqi@0 142 return (String[])__ids.clone ();
aoqi@0 143 }
aoqi@0 144
aoqi@0 145 private void readObject (java.io.ObjectInputStream s)
aoqi@0 146 {
aoqi@0 147 try
aoqi@0 148 {
aoqi@0 149 String str = s.readUTF ();
aoqi@0 150 org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init ().string_to_object (str);
aoqi@0 151 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
aoqi@0 152 _set_delegate (delegate);
aoqi@0 153 } catch (java.io.IOException e) {}
aoqi@0 154 }
aoqi@0 155
aoqi@0 156 private void writeObject (java.io.ObjectOutputStream s)
aoqi@0 157 {
aoqi@0 158 try
aoqi@0 159 {
aoqi@0 160 String str = org.omg.CORBA.ORB.init ().object_to_string (this);
aoqi@0 161 s.writeUTF (str);
aoqi@0 162 } catch (java.io.IOException e) {}
aoqi@0 163 }
aoqi@0 164 } // class _PolicyStub

mercurial