src/share/classes/org/omg/CORBA/Request.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) 1996, 1999, 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
aoqi@0 26 package org.omg.CORBA;
aoqi@0 27
aoqi@0 28 /**
aoqi@0 29 * An object containing the information necessary for
aoqi@0 30 * invoking a method. This class is
aoqi@0 31 * the cornerstone of the ORB Dynamic
aoqi@0 32 * Invocation Interface (DII), which allows dynamic creation and
aoqi@0 33 * invocation of requests.
aoqi@0 34 * A server cannot tell the difference between a client
aoqi@0 35 * invocation using a client stub and a request using the DII.
aoqi@0 36 * <P>
aoqi@0 37 * A <code>Request</code> object consists of:
aoqi@0 38 * <UL>
aoqi@0 39 * <LI>the name of the operation to be invoked
aoqi@0 40 * <LI>an <code>NVList</code> containing arguments for the operation.<BR>
aoqi@0 41 * Each item in the list is a <code>NamedValue</code> object, which has three
aoqi@0 42 * parts:
aoqi@0 43 * <OL>
aoqi@0 44 * <LI>the name of the argument
aoqi@0 45 * <LI>the value of the argument (as an <code>Any</code> object)
aoqi@0 46 * <LI>the argument mode flag indicating whether the argument is
aoqi@0 47 * for input, output, or both
aoqi@0 48 * </OL>
aoqi@0 49 * </UL>
aoqi@0 50 * <P>
aoqi@0 51 * <code>Request</code> objects may also contain additional information,
aoqi@0 52 * depending on how an operation was defined in the original IDL
aoqi@0 53 * interface definition. For example, where appropriate, they may contain
aoqi@0 54 * a <code>NamedValue</code> object to hold the return value or exception,
aoqi@0 55 * a context, a list of possible exceptions, and a list of
aoqi@0 56 * context strings that need to be resolved.
aoqi@0 57 * <P>
aoqi@0 58 * New <code>Request</code> objects are created using one of the
aoqi@0 59 * <code>create_request</code> methods in the <code>Object</code> class.
aoqi@0 60 * In other words, a <code>create_request</code> method is performed on the
aoqi@0 61 * object which is to be invoked.
aoqi@0 62 *
aoqi@0 63 * @see org.omg.CORBA.NamedValue
aoqi@0 64 *
aoqi@0 65 */
aoqi@0 66
aoqi@0 67 public abstract class Request {
aoqi@0 68
aoqi@0 69 /**
aoqi@0 70 * Retrieves the the target object reference.
aoqi@0 71 *
aoqi@0 72 * @return the object reference that points to the
aoqi@0 73 * object implementation for the method
aoqi@0 74 * to be invoked
aoqi@0 75 */
aoqi@0 76
aoqi@0 77 public abstract org.omg.CORBA.Object target();
aoqi@0 78
aoqi@0 79 /**
aoqi@0 80 * Retrieves the name of the method to be invoked.
aoqi@0 81 *
aoqi@0 82 * @return the name of the method to be invoked
aoqi@0 83 */
aoqi@0 84
aoqi@0 85 public abstract String operation();
aoqi@0 86
aoqi@0 87 /**
aoqi@0 88 * Retrieves the <code>NVList</code> object containing the arguments
aoqi@0 89 * to the method being invoked. The elements in the list are
aoqi@0 90 * <code>NamedValue</code> objects, with each one describing an argument
aoqi@0 91 * to the method.
aoqi@0 92 *
aoqi@0 93 * @return the <code>NVList</code> object containing the arguments
aoqi@0 94 * for the method
aoqi@0 95 *
aoqi@0 96 */
aoqi@0 97
aoqi@0 98 public abstract NVList arguments();
aoqi@0 99
aoqi@0 100 /**
aoqi@0 101 * Retrieves the <code>NamedValue</code> object containing the return
aoqi@0 102 * value for the method.
aoqi@0 103 *
aoqi@0 104 * @return the <code>NamedValue</code> object containing the result
aoqi@0 105 * of the method
aoqi@0 106 */
aoqi@0 107
aoqi@0 108 public abstract NamedValue result();
aoqi@0 109
aoqi@0 110 /**
aoqi@0 111 * Retrieves the <code>Environment</code> object for this request.
aoqi@0 112 * It contains the exception that the method being invoked has
aoqi@0 113 * thrown (after the invocation returns).
aoqi@0 114 *
aoqi@0 115 *
aoqi@0 116 * @return the <code>Environment</code> object for this request
aoqi@0 117 */
aoqi@0 118
aoqi@0 119 public abstract Environment env();
aoqi@0 120
aoqi@0 121 /**
aoqi@0 122 * Retrieves the <code>ExceptionList</code> object for this request.
aoqi@0 123 * This list contains <code>TypeCode</code> objects describing the
aoqi@0 124 * exceptions that may be thrown by the method being invoked.
aoqi@0 125 *
aoqi@0 126 * @return the <code>ExceptionList</code> object describing the exceptions
aoqi@0 127 * that may be thrown by the method being invoked
aoqi@0 128 */
aoqi@0 129
aoqi@0 130 public abstract ExceptionList exceptions();
aoqi@0 131
aoqi@0 132 /**
aoqi@0 133 * Retrieves the <code>ContextList</code> object for this request.
aoqi@0 134 * This list contains context <code>String</code>s that need to
aoqi@0 135 * be resolved and sent with the invocation.
aoqi@0 136 *
aoqi@0 137 *
aoqi@0 138 * @return the list of context strings whose values
aoqi@0 139 * need to be resolved and sent with the
aoqi@0 140 * invocation.
aoqi@0 141 */
aoqi@0 142
aoqi@0 143 public abstract ContextList contexts();
aoqi@0 144
aoqi@0 145 /**
aoqi@0 146 * Retrieves the <code>Context</code> object for this request.
aoqi@0 147 * This is a list of properties giving information about the
aoqi@0 148 * client, the environment, or the circumstances of this request.
aoqi@0 149 *
aoqi@0 150 * @return the <code>Context</code> object that is to be used
aoqi@0 151 * to resolve any context strings whose
aoqi@0 152 * values need to be sent with the invocation
aoqi@0 153 */
aoqi@0 154
aoqi@0 155 public abstract Context ctx();
aoqi@0 156
aoqi@0 157 /**
aoqi@0 158 * Sets this request's <code>Context</code> object to the one given.
aoqi@0 159 *
aoqi@0 160 * @param c the new <code>Context</code> object to be used for
aoqi@0 161 * resolving context strings
aoqi@0 162 */
aoqi@0 163
aoqi@0 164 public abstract void ctx(Context c);
aoqi@0 165
aoqi@0 166
aoqi@0 167 /**
aoqi@0 168 * Creates an input argument and adds it to this <code>Request</code>
aoqi@0 169 * object.
aoqi@0 170 *
aoqi@0 171 * @return an <code>Any</code> object that contains the
aoqi@0 172 * value and typecode for the input argument added
aoqi@0 173 */
aoqi@0 174
aoqi@0 175 public abstract Any add_in_arg();
aoqi@0 176
aoqi@0 177 /**
aoqi@0 178 * Creates an input argument with the given name and adds it to
aoqi@0 179 * this <code>Request</code> object.
aoqi@0 180 *
aoqi@0 181 * @param name the name of the argument being added
aoqi@0 182 * @return an <code>Any</code> object that contains the
aoqi@0 183 * value and typecode for the input argument added
aoqi@0 184 */
aoqi@0 185
aoqi@0 186 public abstract Any add_named_in_arg(String name);
aoqi@0 187
aoqi@0 188 /**
aoqi@0 189 * Adds an input/output argument to this <code>Request</code> object.
aoqi@0 190 *
aoqi@0 191 * @return an <code>Any</code> object that contains the
aoqi@0 192 * value and typecode for the input/output argument added
aoqi@0 193 */
aoqi@0 194
aoqi@0 195 public abstract Any add_inout_arg();
aoqi@0 196
aoqi@0 197 /**
aoqi@0 198 * Adds an input/output argument with the given name to this
aoqi@0 199 * <code>Request</code> object.
aoqi@0 200 *
aoqi@0 201 * @param name the name of the argument being added
aoqi@0 202 * @return an <code>Any</code> object that contains the
aoqi@0 203 * value and typecode for the input/output argument added
aoqi@0 204 */
aoqi@0 205
aoqi@0 206 public abstract Any add_named_inout_arg(String name);
aoqi@0 207
aoqi@0 208
aoqi@0 209 /**
aoqi@0 210 * Adds an output argument to this <code>Request</code> object.
aoqi@0 211 *
aoqi@0 212 * @return an <code>Any</code> object that contains the
aoqi@0 213 * value and typecode for the output argument added
aoqi@0 214 */
aoqi@0 215
aoqi@0 216 public abstract Any add_out_arg();
aoqi@0 217
aoqi@0 218 /**
aoqi@0 219 * Adds an output argument with the given name to this
aoqi@0 220 * <code>Request</code> object.
aoqi@0 221 *
aoqi@0 222 * @param name the name of the argument being added
aoqi@0 223 * @return an <code>Any</code> object that contains the
aoqi@0 224 * value and typecode for the output argument added
aoqi@0 225 */
aoqi@0 226
aoqi@0 227 public abstract Any add_named_out_arg(String name);
aoqi@0 228
aoqi@0 229 /**
aoqi@0 230 * Sets the typecode for the return
aoqi@0 231 * value of the method.
aoqi@0 232 *
aoqi@0 233 * @param tc the <code>TypeCode</code> object containing type information
aoqi@0 234 * for the return value
aoqi@0 235 */
aoqi@0 236
aoqi@0 237 public abstract void set_return_type(TypeCode tc);
aoqi@0 238
aoqi@0 239 /**
aoqi@0 240 * Returns the <code>Any</code> object that contains the value for the
aoqi@0 241 * result of the method.
aoqi@0 242 *
aoqi@0 243 * @return an <code>Any</code> object containing the value and
aoqi@0 244 * typecode for the return value
aoqi@0 245 */
aoqi@0 246
aoqi@0 247 public abstract Any return_value();
aoqi@0 248
aoqi@0 249 /**
aoqi@0 250 * Makes a synchronous invocation using the
aoqi@0 251 * information in the <code>Request</code> object. Exception information is
aoqi@0 252 * placed into the <code>Request</code> object's environment object.
aoqi@0 253 */
aoqi@0 254
aoqi@0 255 public abstract void invoke();
aoqi@0 256
aoqi@0 257 /**
aoqi@0 258 * Makes a oneway invocation on the
aoqi@0 259 * request. In other words, it does not expect or wait for a
aoqi@0 260 * response. Note that this can be used even if the operation was
aoqi@0 261 * not declared as oneway in the IDL declaration. No response or
aoqi@0 262 * exception information is returned.
aoqi@0 263 */
aoqi@0 264
aoqi@0 265 public abstract void send_oneway();
aoqi@0 266
aoqi@0 267 /**
aoqi@0 268 * Makes an asynchronous invocation on
aoqi@0 269 * the request. In other words, it does not wait for a response before it
aoqi@0 270 * returns to the user. The user can then later use the methods
aoqi@0 271 * <code>poll_response</code> and <code>get_response</code> to get
aoqi@0 272 * the result or exception information for the invocation.
aoqi@0 273 */
aoqi@0 274
aoqi@0 275 public abstract void send_deferred();
aoqi@0 276
aoqi@0 277 /**
aoqi@0 278 * Allows the user to determine
aoqi@0 279 * whether a response has been received for the invocation triggered
aoqi@0 280 * earlier with the <code>send_deferred</code> method.
aoqi@0 281 *
aoqi@0 282 * @return <code>true</code> if the method response has
aoqi@0 283 * been received; <code>false</code> otherwise
aoqi@0 284 */
aoqi@0 285
aoqi@0 286 public abstract boolean poll_response();
aoqi@0 287
aoqi@0 288 /**
aoqi@0 289 * Allows the user to access the
aoqi@0 290 * response for the invocation triggered earlier with the
aoqi@0 291 * <code>send_deferred</code> method.
aoqi@0 292 *
aoqi@0 293 * @exception WrongTransaction if the method <code>get_response</code> was invoked
aoqi@0 294 * from a different transaction's scope than the one from which the
aoqi@0 295 * request was originally sent. See the OMG Transaction Service specification
aoqi@0 296 * for details.
aoqi@0 297 */
aoqi@0 298
aoqi@0 299 public abstract void get_response() throws WrongTransaction;
aoqi@0 300
aoqi@0 301 };

mercurial