src/share/classes/org/omg/PortableInterceptor/Interceptors.idl

Tue, 28 Dec 2010 15:52:36 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:36 -0800
changeset 240
f90b3e014e83
parent 158
91006f157c46
child 748
6845b95cba6b
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

duke@1 1 /*
ohair@240 2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
ohair@158 7 * published by the Free Software Foundation. Oracle designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
ohair@158 9 * by Oracle in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
ohair@158 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@158 22 * or visit www.oracle.com if you need additional information or have any
ohair@158 23 * questions.
duke@1 24 */
duke@1 25
duke@1 26 /*
duke@1 27 * Differences from original:
duke@1 28 *
duke@1 29 * - do not include orb.idl
duke@1 30 * - include IOP.idl, Messaging.idl and CORBAX.idl
duke@1 31 * - renamed component parameter names to tagged_component (so that they
duke@1 32 * do not conflict with the CORBA 3.0 "component" keyword).
duke@1 33 * - javadocs added (synchronized with orbos/00-08-06)
duke@1 34 *
duke@1 35 * NOTE: After compilation of this IDL file, all Helper and Holder classes
duke@1 36 * that are not needed are removed.
duke@1 37 */
duke@1 38 #include "IOP.idl"
duke@1 39 #include "Messaging.idl"
duke@1 40 #include "CORBAX.idl"
duke@1 41 #include "corba.idl"
duke@1 42
duke@1 43 #pragma prefix "omg.org"
duke@1 44
duke@1 45 #ifndef CORBA3
duke@1 46 #define local
duke@1 47 #endif
duke@1 48
duke@1 49 module Dynamic {
duke@1 50
duke@1 51 /**
duke@1 52 * <code>NVList</code> PIDL represented by <code>ParameterList</code> IDL.
duke@1 53 * This exists in order to keep the Portable Interceptor IDL from becoming
duke@1 54 * PIDL.
duke@1 55 */
duke@1 56 struct Parameter {
duke@1 57 any argument;
duke@1 58 CORBA::ParameterMode mode;
duke@1 59 };
duke@1 60
duke@1 61 /**
duke@1 62 * <code>NVList</code> PIDL represented by <code>ParameterList</code> IDL.
duke@1 63 * This exists in order to keep the Portable Interceptor IDL from becoming
duke@1 64 * PIDL.
duke@1 65 */
duke@1 66 typedef sequence<Parameter> ParameterList;
duke@1 67
duke@1 68 /**
duke@1 69 * <code>ContextList</code> PIDL represented by <code>ContextList</code>
duke@1 70 * IDL. This exists in order to keep the Portable Interceptor IDL from
duke@1 71 * becoming PIDL.
duke@1 72 */
duke@1 73 typedef CORBA::StringSeq ContextList;
duke@1 74
duke@1 75 /**
duke@1 76 * <code>ExceptionList</code> PIDL represented by <code>ExceptionList</code>
duke@1 77 * IDL. This exists in order to keep the Portable Interceptor IDL from
duke@1 78 * becoming PIDL.
duke@1 79 */
duke@1 80 typedef sequence<CORBA::TypeCode> ExceptionList;
duke@1 81
duke@1 82 /**
duke@1 83 * <code>Context</code> PIDL represented by <code>RequestContext</code>
duke@1 84 * IDL. This exists in order to keep the Portable Interceptor IDL from o
duke@1 85 * becoming PIDL.
duke@1 86 * <p>
duke@1 87 * <code>Context</code> objects are encoded as <code>String[]</code>. The
duke@1 88 * <code>Strings</code> occur in pairs. The first <code>String</code> in
duke@1 89 * each pair is the context property name and the second <code>String</code>
duke@1 90 * in each pair is the associated value.
duke@1 91 */
duke@1 92 typedef CORBA::StringSeq RequestContext;
duke@1 93 };
duke@1 94
duke@1 95 module PortableInterceptor {
duke@1 96 /**
duke@1 97 * All Portable Interceptors implement Interceptor.
duke@1 98 */
duke@1 99 local interface Interceptor {
duke@1 100 /**
duke@1 101 * Returns the name of the interceptor.
duke@1 102 * <p>
duke@1 103 * Each Interceptor may have a name that may be used administratively
duke@1 104 * to order the lists of Interceptors. Only one Interceptor of a given
duke@1 105 * name can be registered with the ORB for each Interceptor type. An
duke@1 106 * Interceptor may be anonymous, i.e., have an empty string as the name
duke@1 107 * attribute. Any number of anonymous Interceptors may be registered with
duke@1 108 * the ORB.
duke@1 109 *
duke@1 110 * @return the name of the interceptor.
duke@1 111 */
duke@1 112 readonly attribute string name;
duke@1 113
duke@1 114 // Added in ptc/00-08-06
duke@1 115 /**
duke@1 116 * Provides an opportunity to destroy this interceptor.
duke@1 117 * The destroy method is called during <code>ORB.destroy</code>. When an
duke@1 118 * application calls <code>ORB.destroy</code>, the ORB:
duke@1 119 * <ol>
duke@1 120 * <li>waits for all requests in progress to complete</li>
duke@1 121 * <li>calls the <code>Interceptor.destroy</code> operation for each
duke@1 122 * interceptor</li>
duke@1 123 * <li>completes destruction of the ORB</li>
duke@1 124 * </ol>
duke@1 125 * Method invocations from within <code>Interceptor.destroy</code> on
duke@1 126 * object references for objects implemented on the ORB being destroyed
duke@1 127 * result in undefined behavior. However, method invocations on objects
duke@1 128 * implemented on an ORB other than the one being destroyed are
duke@1 129 * permitted. (This means that the ORB being destroyed is still capable
duke@1 130 * of acting as a client, but not as a server.)
duke@1 131 */
duke@1 132 void destroy();
duke@1 133 };
duke@1 134
duke@1 135
duke@1 136 /**
duke@1 137 * The <code>ForwardRequest</code> exception is the means by which an
duke@1 138 * Interceptor can indicate to the ORB that a retry of the request should
duke@1 139 * occur with the new object given in the exception. This behavior of
duke@1 140 * causing a retry only occurs if the ORB receives a ForwardRequest from
duke@1 141 * an interceptor. If <code>ForwardRequest</code> is thrown anywhere else
duke@1 142 * it is passed through the ORB as is normal for a user exception.
duke@1 143 * <p>
duke@1 144 * If an Interceptor throws a <code>ForwardRequest</code> exception in
duke@1 145 * response to a call of an interceptor, no other Interceptors are called
duke@1 146 * for that interception point. The remaining Interceptors in the Flow Stack
duke@1 147 * shall have their appropriate ending interception point called:
duke@1 148 * <code>receive_other</code> on the client, or <code>send_other</code> on
duke@1 149 * the server. The <code>reply_status</code> in the
duke@1 150 * <code>receive_other</code> or <code>send_other</code> would be
duke@1 151 * <code>LOCATION_FORWARD</code>.
duke@1 152 */
duke@1 153 exception ForwardRequest {
duke@1 154 /**
duke@1 155 * The new object to forward the request to.
duke@1 156 */
duke@1 157 Object forward;
duke@1 158 // Change in ptc/00-08-06
duke@1 159 // boolean permanent;
duke@1 160 };
duke@1 161
duke@1 162 /** Reply status, represented as an int */
duke@1 163 typedef short ReplyStatus;
duke@1 164
duke@1 165 // Valid reply_status values:
duke@1 166
duke@1 167 /**
duke@1 168 * Indicates a successful Reply Status. One possible value for
duke@1 169 * <code>RequestInfo.reply_status</code>.
duke@1 170 * @see RequestInfo#reply_status
duke@1 171 * @see SYSTEM_EXCEPTION
duke@1 172 * @see USER_EXCEPTION
duke@1 173 * @see LOCATION_FORWARD
duke@1 174 * @see TRANSPORT_RETRY
duke@1 175 */
duke@1 176 const ReplyStatus SUCCESSFUL = 0;
duke@1 177
duke@1 178 /**
duke@1 179 * Indicates a SystemException reply status. One possible value for
duke@1 180 * <code>RequestInfo.reply_status</code>.
duke@1 181 * @see RequestInfo#reply_status
duke@1 182 * @see SUCCESSFUL
duke@1 183 * @see USER_EXCEPTION
duke@1 184 * @see LOCATION_FORWARD
duke@1 185 * @see TRANSPORT_RETRY
duke@1 186 */
duke@1 187 const ReplyStatus SYSTEM_EXCEPTION = 1;
duke@1 188
duke@1 189 /**
duke@1 190 * Indicates a UserException reply status. One possible value for
duke@1 191 * <code>RequestInfo.reply_status</code>.
duke@1 192 * @see RequestInfo#reply_status
duke@1 193 * @see SUCCESSFUL
duke@1 194 * @see SYSTEM_EXCEPTION
duke@1 195 * @see LOCATION_FORWARD
duke@1 196 * @see TRANSPORT_RETRY
duke@1 197 */
duke@1 198 const ReplyStatus USER_EXCEPTION = 2;
duke@1 199
duke@1 200 /**
duke@1 201 * Indicates a LocationForward reply status. One possible value for
duke@1 202 * <code>RequestInfo.reply_status</code>.
duke@1 203 * @see RequestInfo#reply_status
duke@1 204 * @see SUCCESSFUL
duke@1 205 * @see SYSTEM_EXCEPTION
duke@1 206 * @see USER_EXCEPTION
duke@1 207 * @see TRANSPORT_RETRY
duke@1 208 */
duke@1 209 const ReplyStatus LOCATION_FORWARD = 3;
duke@1 210
duke@1 211 // Changes in ptc/00-08-06
duke@1 212 // const ReplyStatus LOCATION_FORWARD_PERMANENT = 4;
duke@1 213
duke@1 214 /**
duke@1 215 * Indicates a Transport Retry reply status. One possible value for
duke@1 216 * <code>RequestInfo.reply_status</code>.
duke@1 217 * @see RequestInfo#reply_status
duke@1 218 * @see SUCCESSFUL
duke@1 219 * @see SYSTEM_EXCEPTION
duke@1 220 * @see USER_EXCEPTION
duke@1 221 * @see LOCATION_FORWARD
duke@1 222 */
duke@1 223 const ReplyStatus TRANSPORT_RETRY = 4;
duke@1 224
duke@1 225 /**
duke@1 226 * XXX
duke@1 227 */
duke@1 228 const ReplyStatus UNKNOWN = 5;
duke@1 229
duke@1 230 /** Slot id, represented as an int */
duke@1 231 typedef unsigned long SlotId;
duke@1 232
duke@1 233 /**
duke@1 234 * This exception is thrown when <code>get_slot</code> or
duke@1 235 * <code>set_slot</code> is called on a slot that has not been allocated.
duke@1 236 */
duke@1 237 exception InvalidSlot {};
duke@1 238
duke@1 239 /**
duke@1 240 * Portable Interceptors Current (also known as <code>PICurrent</code>)
duke@1 241 * is merely a slot table, the slots of which are used by each service to
duke@1 242 * transfer their context data between their context and the request's or
duke@1 243 * reply's service context. Each service which wishes to use PICurrent
duke@1 244 * reserves a slot or slots at initialization time and uses those slots
duke@1 245 * during the processing of requests and replies.
duke@1 246 * <p>
duke@1 247 * Before an invocation is made, PICurrent is obtained via a call to
duke@1 248 * <code>ORB.resolve_initial_references( "PICurrent" )</code>. From within
duke@1 249 * the interception points, the data on PICurrent that has moved from the
duke@1 250 * thread scope to the request scope is available via the
duke@1 251 * <code>get_slot</code> operation on the <code>RequestInfo</code> object.
duke@1 252 * A PICurrent can still be obtained via
duke@1 253 * <code>resolve_initial_references</code>, but that is the Interceptor's
duke@1 254 * thread scope PICurrent.
duke@1 255 */
duke@1 256 local interface Current : CORBA::Current {
duke@1 257
duke@1 258 /**
duke@1 259 * Retrieves the slot data the application set in PICurrent via
duke@1 260 * <code>get_slot</code>. The data is in the form of an Any.
duke@1 261 * <p>
duke@1 262 * If the given slot has not been set, an Any containing a type code
duke@1 263 * with a <code>TCKind</code> value of <code>tk_null</code> and no value
duke@1 264 * is returned.
duke@1 265 *
duke@1 266 * @param id The <code>SlotId</code> of the slot from which the data will
duke@1 267 * be returned.
duke@1 268 * @return The data, in the form of an Any, of the given slot identifier.
duke@1 269 * @exception InvalidSlot thrown if get_slot is called on a slot that
duke@1 270 * has not been allocated.
duke@1 271 * @exception BAD_INV_ORDER thrown if <code>get_slot</code> is called
duke@1 272 * from within an ORB initializer
duke@1 273 */
duke@1 274 any get_slot (in SlotId id) raises (InvalidSlot);
duke@1 275
duke@1 276 /**
duke@1 277 * Sets data in a slot. The data is in the form of an Any. If data
duke@1 278 * already exists in that slot, it is overridden.
duke@1 279 *
duke@1 280 * @param id The <code>SlotId</code> of the slot to which the data will
duke@1 281 * be set.
duke@1 282 * @param data The data, in the form of an Any, which will be set
duke@1 283 * to the identified slot.
duke@1 284 * @exception InvalidSlot thrown if <code>set_slot</code> is called on
duke@1 285 * a slot that has not been allocated.
duke@1 286 * @exception BAD_INV_ORDER thrown if <code>set_slot</code> is called
duke@1 287 * from within an ORB initializer.
duke@1 288 */
duke@1 289 void set_slot (in SlotId id, in any data) raises (InvalidSlot);
duke@1 290 };
duke@1 291
duke@1 292 /**
duke@1 293 * Request Information, accessible to Interceptors.
duke@1 294 * <p>
duke@1 295 * Each interception point is given an object through which the
duke@1 296 * Interceptor can access request information. Client-side and server-side
duke@1 297 * interception points are concerned with different information, so there
duke@1 298 * are two information objects: <code>ClientRequestInfo</code> is passed
duke@1 299 * to the client-side interception points and <code>ServerRequestInfo</code>
duke@1 300 * is passed to the server-side interception points. But there is
duke@1 301 * information that is common to both, so they both inherit from a common
duke@1 302 * interface: <code>RequestInfo</code>.
duke@1 303 *
duke@1 304 * @see ClientRequestInfo
duke@1 305 * @see ServerRequestInfo
duke@1 306 */
duke@1 307 local interface RequestInfo {
duke@1 308 /**
duke@1 309 * Returns an id that uniquely identifies an active request/reply
duke@1 310 * sequence. Once a request/reply sequence is concluded this ID may be
duke@1 311 * reused. Note that this id is not the same as the GIOP
duke@1 312 * <code>request_id</code>. If GIOP is the transport mechanism used,
duke@1 313 * then these IDs may very well be the same, but this is not guaranteed
duke@1 314 * nor required.
duke@1 315 */
duke@1 316 readonly attribute unsigned long request_id;
duke@1 317
duke@1 318 /**
duke@1 319 * Returns the name of the operation being invoked.
duke@1 320 */
duke@1 321 readonly attribute string operation;
duke@1 322
duke@1 323 /**
duke@1 324 * Returns an array of <code>Parameter</code> objects, containing the
duke@1 325 * arguments on the operation being invoked. If there are no arguments,
duke@1 326 * this attribute will be a zero length array.
duke@1 327 * <p>
duke@1 328 * Not all environments provide access to the arguments. With the Java
duke@1 329 * portable bindings, for example, the arguments are not available.
duke@1 330 * In these environments, when this attribute is accessed,
duke@1 331 * <code>NO_RESOURCES</code> will be thrown with a standard minor code
duke@1 332 * of 1.
duke@1 333 * <p>
duke@1 334 * <i>Note: Arguments are available for DSI/DII calls.</i>
duke@1 335 *
duke@1 336 * @exception NO_RESOURCES thrown if arguments are not available.
duke@1 337 * @see <a href="package-summary.html#unimpl">
duke@1 338 * <code>PortableInterceptor</code> package comments for
duke@1 339 * limitations / unimplemented features</a>
duke@1 340 */
duke@1 341 readonly attribute Dynamic::ParameterList arguments;
duke@1 342
duke@1 343 /**
duke@1 344 * Returns an array of <code>TypeCode</code> objects describing the
duke@1 345 * <code>TypeCode</code>s of the user exceptions that this operation
duke@1 346 * invocation may throw. If there are no user exceptions, this
duke@1 347 * will return a zero length array.
duke@1 348 * <p>
duke@1 349 * Not all environments provide access to the exception list. With
duke@1 350 * the Java portable bindings, for example, the exception list is
duke@1 351 * not available. In these environments, when this attribute is
duke@1 352 * accessed, <code>NO_RESOURCES</code> will be thrown with a
duke@1 353 * standard minor code of 1.
duke@1 354 * <p>
duke@1 355 * <i>Note: Exceptions are available for DSI/DII calls.</i>
duke@1 356 *
duke@1 357 * @exception NO_RESOURCES thrown if exceptions are not available.
duke@1 358 * @see <a href="package-summary.html#unimpl">
duke@1 359 * <code>PortableInterceptor</code> package comments for
duke@1 360 * limitations / unimplemented features</a>
duke@1 361 */
duke@1 362 readonly attribute Dynamic::ExceptionList exceptions;
duke@1 363
duke@1 364 /**
duke@1 365 * Returns an array of <code>String</code> objects describing the
duke@1 366 * contexts that may be passed on this operation invocation. If there
duke@1 367 * are no contexts, this will return a zero length array.
duke@1 368 * <p>
duke@1 369 * Not all environments provide access to the context list. With the
duke@1 370 * Java portable bindings, for example, the context list is not
duke@1 371 * available. In these environments, when this attribute is accessed,
duke@1 372 * <code>NO_RESOURCES</code> will be thrown with a standard minor code
duke@1 373 * of 1.
duke@1 374 * <p>
duke@1 375 * <i>Note: Contexts are available for DSI/DII calls.</i>
duke@1 376 *
duke@1 377 * @exception NO_RESOURCES thrown if contexts are not available.
duke@1 378 * @see <a href="package-summary.html#unimpl">
duke@1 379 * <code>PortableInterceptor</code> package comments for
duke@1 380 * limitations / unimplemented features</a>
duke@1 381 */
duke@1 382 readonly attribute Dynamic::ContextList contexts;
duke@1 383
duke@1 384 /**
duke@1 385 * Returns an array of <code>String</code> objects containing the
duke@1 386 * contexts being sent on the request.
duke@1 387 * <p>
duke@1 388 * Not all environments provide access to the context. With the Java
duke@1 389 * portable bindings, for example, the context is not available. In
duke@1 390 * these environments, when this attribute is accessed, NO_RESOURCES will
duke@1 391 * be thrown with standard minor code of 1.
duke@1 392 * <p>
duke@1 393 * <i>Note: <code>operation_context</code> is available for
duke@1 394 * DSI/DII calls.</i>
duke@1 395 *
duke@1 396 * @exception NO_RESOURCES thrown if operation context is not available.
duke@1 397 * @see <a href="package-summary.html#unimpl">
duke@1 398 * <code>PortableInterceptor</code> package comments for
duke@1 399 * limitations / unimplemented features</a>
duke@1 400 */
duke@1 401 readonly attribute Dynamic::RequestContext operation_context;
duke@1 402
duke@1 403 /**
duke@1 404 * Returns an any containing the result of the operation invocation.
duke@1 405 * If the operation return type is void, this attribute will be an any
duke@1 406 * containing a type code with a <code>TCKind</code> value of
duke@1 407 * <code>tk_void</code> and no value.
duke@1 408 * <p>
duke@1 409 * Not all environments provide access to the result. With the Java
duke@1 410 * portable bindings, for example, the result is not available. In
duke@1 411 * these environments, when this attribute is accessed,
duke@1 412 * <code>NO_RESOURCES</code> will be thrown with a standard minor code of
duke@1 413 * 1.
duke@1 414 * <p>
duke@1 415 * <i>Note: Result is available for DSI/DII calls.</i>
duke@1 416 *
duke@1 417 * @exception NO_RESOURCES thrown if result is not available.
duke@1 418 * @see <a href="package-summary.html#unimpl">
duke@1 419 * <code>PortableInterceptor</code> package comments for
duke@1 420 * limitations / unimplemented features</a>
duke@1 421 */
duke@1 422 readonly attribute any result;
duke@1 423
duke@1 424 /**
duke@1 425 * Indicates whether a response is expected.
duke@1 426 * <p>
duke@1 427 * On the client, a reply is not returned when
duke@1 428 * <code>response_expected</code> is false, so <code>receive_reply</code>
duke@1 429 * cannot be called. <code>receive_other</code> is called unless an
duke@1 430 * exception occurs, in which case <code>receive_exception</code> is
duke@1 431 * called.
duke@1 432 * <p>
duke@1 433 * On the client, within <code>send_poll</code>, this attribute is true.
duke@1 434 */
duke@1 435 readonly attribute boolean response_expected;
duke@1 436
duke@1 437 /**
duke@1 438 * Defines how far the request shall progress before control is returned
duke@1 439 * to the client. This is defined in the Messaging specification, and
duke@1 440 * is pertinent only when <code>response_expected</code> is false. If
duke@1 441 * <code>response_expected</code> is true, the value of
duke@1 442 * <code>sync_scope</code> is undefined. This attribute may have one of
duke@1 443 * the following values:
duke@1 444 * <ul>
duke@1 445 * <li><code>Messaging.SYNC_NONE</code></li>
duke@1 446 * <li><code>Messaging.SYNC_WITH_TRANSPORT</code></li>
duke@1 447 * <li><code>Messaging.SYNC_WITH_SERVER</code></li>
duke@1 448 * <li><code>Messaging.SYNC_WITH_TARGET</code></li>
duke@1 449 * </ul>
duke@1 450 * On the server, for all scopes, a reply will be created from the
duke@1 451 * return of the target operation call, but the reply will not return
duke@1 452 * to the client. Although it does not return to the client, it does
duke@1 453 * occur, so the normal server-side interception points are
duke@1 454 * followed (i.e., <code>receive_request_service_contexts</code>,
duke@1 455 * <code>receive_request</code>, <code>send_reply</code> or
duke@1 456 * <code>send_exception</code>).
duke@1 457 * <p>
duke@1 458 * For <code>SYNC_WITH_SERVER</code> and <code>SYNC_WITH_TARGET</code>,
duke@1 459 * the server does send an empty reply back to the client before the
duke@1 460 * target is invoked. This reply is not intercepted by server-side
duke@1 461 * Interceptors.
duke@1 462 *
duke@1 463 * @see <a href="package-summary.html#unimpl">
duke@1 464 * <code>PortableInterceptor</code> package comments for
duke@1 465 * limitations / unimplemented features</a>
duke@1 466 */
duke@1 467 readonly attribute Messaging::SyncScope sync_scope;
duke@1 468
duke@1 469 /**
duke@1 470 * Describes the state of the result of the operation invocation. The
duke@1 471 * return value can be one of the following:
duke@1 472 * <ul>
duke@1 473 * <li><code>PortableInterceptor.SUCCESSFUL</code></li>
duke@1 474 * <li><code>PortableInterceptor.SYSTEM_EXCEPTION</code></li>
duke@1 475 * <li><code>PortableInterceptor.USER_EXCEPTION</code></li>
duke@1 476 * <li><code>PortableInterceptor.LOCATION_FORWARD</code></li>
duke@1 477 * <li><code>PortableInterceptor.TRANSPORT_RETRY</code></li>
duke@1 478 * </ul>
duke@1 479 * On the client:
duke@1 480 * <ul>
duke@1 481 * <li>Within the <code>receive_reply</code> interception point, this
duke@1 482 * will only return <code>SUCCESSFUL</code></li>.
duke@1 483 * <li>Within the <code>receive_exception</code> interception point,
duke@1 484 * this will be either <code>SYSTEM_EXCEPTION</code> or
duke@1 485 * <code>USER_EXCEPTION</code>.</li>
duke@1 486 * <li>Within the <code>receive_other</code> interception point, this
duke@1 487 * will be any of: <code>SUCCESSFUL</code>,
duke@1 488 * <code>LOCATION_FORWARD</code>, or <code>TRANSPORT_RETRY</code>.
duke@1 489 * <code>SUCCESSFUL</code> means an asynchronous request returned
duke@1 490 * successfully. <code>LOCATION_FORWARD</code> means that a reply
duke@1 491 * came back with <code>LOCATION_FORWARD</code> as its status.
duke@1 492 * <code>TRANSPORT_RETRY</code> means that the transport
duke@1 493 * mechanism indicated a retry - a GIOP reply with a status of
duke@1 494 * <code>NEEDS_ADDRESSING_MODE</code>, for instance. </li>
duke@1 495 * </ul>
duke@1 496 * On the server:
duke@1 497 * <ul>
duke@1 498 * <li>Within the <code>send_reply</code> interception point, this
duke@1 499 * will only be <code>SUCCESSFUL</code>.</li>
duke@1 500 * <li>Within the <code>send_exception</code> interception point,
duke@1 501 * this will be either <code>SYSTEM_EXCEPTION</code> or
duke@1 502 * <code>USER_EXCEPTION</code>.</li>
duke@1 503 * <li>Within the <code>send_other</code> interception point, this
duke@1 504 * attribute will be any of: <code>SUCCESSFUL</code>, or
duke@1 505 * <code>LOCATION_FORWARD</code>. <code>SUCCESSFUL</code> means
duke@1 506 * an asynchronous request returned successfully.
duke@1 507 * <code>LOCATION_FORWARD</code> means that a reply came back
duke@1 508 * with <code>LOCATION_FORWARD</code> as its status.</li>
duke@1 509 * </ul>
duke@1 510 *
duke@1 511 * @see SUCCESSFUL
duke@1 512 * @see SYSTEM_EXCEPTION
duke@1 513 * @see USER_EXCEPTION
duke@1 514 * @see LOCATION_FORWARD
duke@1 515 * @see TRANSPORT_RETRY
duke@1 516 */
duke@1 517 readonly attribute ReplyStatus reply_status;
duke@1 518
duke@1 519 /**
duke@1 520 * Contains the object to which the request will be forwarded, if the
duke@1 521 * <code>reply_status</code> attribute is <code>LOCATION_FORWARD</code>.
duke@1 522 * It is indeterminate whether a forwarded request will actually occur.
duke@1 523 */
duke@1 524 readonly attribute Object forward_reference;
duke@1 525
duke@1 526 /**
duke@1 527 * Returns the data from the given slot of the
duke@1 528 * <code>PortableInterceptor.Current</code> that is in the scope of
duke@1 529 * the request.
duke@1 530 * <p>
duke@1 531 * If the given slot has not been set, then an any containing a
duke@1 532 * type code with a <code>TCKind</code> value of <code>tk_null</code> is
duke@1 533 * returned.
duke@1 534 *
duke@1 535 * @param id The <code>SlotId</code> of the slot which is to be
duke@1 536 * returned.
duke@1 537 * @return The slot data, in the form of an any, obtained with the
duke@1 538 * given identifier.
duke@1 539 * @exception InvalidSlot thrown if the ID does not define an
duke@1 540 * allocated slot.
duke@1 541 * @see Current
duke@1 542 */
duke@1 543 any get_slot (in SlotId id) raises (InvalidSlot);
duke@1 544
duke@1 545 /**
duke@1 546 * Returns a copy of the service context with the given ID that
duke@1 547 * is associated with the request.
duke@1 548 * <p>
duke@1 549 * @param id The <code>IOP.ServiceId</code> of the service context
duke@1 550 * which is to be returned.
duke@1 551 * @return The <code>IOP.ServiceContext</code> obtained with the
duke@1 552 * given identifier.
duke@1 553 * @exception BAD_PARAM thrown with a standard minor code of 26, if the
duke@1 554 * request's service context does not contain an entry for that ID.
duke@1 555 */
duke@1 556 IOP::ServiceContext get_request_service_context
duke@1 557 (in IOP::ServiceId id);
duke@1 558
duke@1 559 /**
duke@1 560 * Returns a copy of the service context with the given ID that
duke@1 561 * is associated with the reply.
duke@1 562 *
duke@1 563 * @param id The <code>IOP.ServiceId</code> of the service context
duke@1 564 * which is to be returned.
duke@1 565 * @return The <code>IOP.ServiceContext</code> obtained with the given
duke@1 566 * identifier.
duke@1 567 * @exception BAD_PARAM thrown with a standard minor code of 26 if the
duke@1 568 * request's service context does not contain an entry for that ID.
duke@1 569 */
duke@1 570 IOP::ServiceContext get_reply_service_context
duke@1 571 (in IOP::ServiceId id);
duke@1 572 };
duke@1 573
duke@1 574 /**
duke@1 575 * Request Information, accessible to client-side request interceptors.
duke@1 576 * <p>
duke@1 577 * Some attributes and operations on <code>ClientRequestInfo</code> are
duke@1 578 * not valid at all interception points. The following table shows the
duke@1 579 * validity of each attribute or operation. If it is not valid, attempting
duke@1 580 * to access it will result in a <code>BAD_INV_ORDER</code> being thrown
duke@1 581 * with a standard minor code of 14.
duke@1 582 * <p>
duke@1 583 *
duke@1 584 * <table border=1 summary="Shows the validity of each attribute or operation">
duke@1 585 * <thead>
duke@1 586 * <tr>
duke@1 587 * <th>&nbsp;</th>
duke@1 588 * <th id="send_req">send_request</th>
duke@1 589 * <th id="send_poll">send_poll</th>
duke@1 590 * <th id="rec_reply">receive_reply</th>
duke@1 591 * <th id="rec_ex">receive_exception</th>
duke@1 592 * <th id="rec_oth">receive_other</th>
duke@1 593 * </tr>
duke@1 594 * </thead>
duke@1 595 * <tbody>
duke@1 596 *
duke@1 597 * <tr>
duke@1 598 * <td id="ri" colspan=6><i>Inherited from RequestInfo:</i></td>
duke@1 599 * </tr>
duke@1 600 *
duke@1 601 * <tr><th id="req_id"><p align="left">request_id</p></th>
duke@1 602 * <td headers="ri req_id send_req">yes</td>
duke@1 603 * <td headers="ri req_id send_poll">yes</td>
duke@1 604 * <td headers="ri req_id rec_reply">yes</td>
duke@1 605 * <td headers="ri req_id rec_ex">yes</td>
duke@1 606 * <td headers="ri req_id rec_oth">yes</td></tr>
duke@1 607 *
duke@1 608 * <tr><th id="op"><p align="left">operation</p></th>
duke@1 609 * <td headers="ri op send_req">yes</td>
duke@1 610 * <td headers="ri op send_poll">yes</td>
duke@1 611 * <td headers="ri op rec_reply">yes</td>
duke@1 612 * <td headers="ri op rec_ex">yes</td>
duke@1 613 * <td headers="ri op rec_oth">yes</td></tr>
duke@1 614 *
duke@1 615 * <tr><th id="arg"><p align="left">arguments</p></th>
duke@1 616 * <td headers="ri arg send_req">yes<sub>1</sub></td>
duke@1 617 * <td headers="ri arg send_poll">no </td>
duke@1 618 * <td headers="ri arg rec_reply">yes</td>
duke@1 619 * <td headers="ri arg rec_ex">no </td>
duke@1 620 * <td headers="ri arg rec_oth">no </td></tr>
duke@1 621 *
duke@1 622 * <tr><th id="exc"><p align="left">exceptions</p></th>
duke@1 623 * <td headers="ri exc send_req">yes</td>
duke@1 624 * <td headers="ri exc send_poll">no </td>
duke@1 625 * <td headers="ri exc rec_reply">yes</td>
duke@1 626 * <td headers="ri exc rec_ex">yes</td>
duke@1 627 * <td headers="ri exc rec_oth">yes</td></tr>
duke@1 628 *
duke@1 629 * <tr><th id="con"><p align="left">contexts</p></th>
duke@1 630 * <td headers="ri con send_req">yes</td>
duke@1 631 * <td headers="ri con send_poll">no </td>
duke@1 632 * <td headers="ri con rec_reply">yes</td>
duke@1 633 * <td headers="ri con rec_ex">yes</td>
duke@1 634 * <td headers="ri con rec_oth">yes</td></tr>
duke@1 635 *
duke@1 636 * <tr><th id="op_con"><p align="left">operation_context</p></th>
duke@1 637 * <td headers="ri op_con send_req">yes</td>
duke@1 638 * <td headers="ri op_con send_poll">no </td>
duke@1 639 * <td headers="ri op_con rec_reply">yes</td>
duke@1 640 * <td headers="ri op_con rec_ex">yes</td>
duke@1 641 * <td headers="ri op_con rec_oth">yes</td>
duke@1 642 * </tr>
duke@1 643 *
duke@1 644 * <tr><th id="result"><p align="left">result</p></th>
duke@1 645 * <td headers="ri result send_req">no </td>
duke@1 646 * <td headers="ri result send_poll">no </td>
duke@1 647 * <td headers="ri result rec_reply">yes</td>
duke@1 648 * <td headers="ri result rec_ex">no </td>
duke@1 649 * <td headers="ri result rec_oth">no </td>
duke@1 650 * </tr>
duke@1 651 *
duke@1 652 * <tr><th id="res_exp"><p align="left">response_expected</p></th>
duke@1 653 * <td headers="ri res_exp send_req">yes</td>
duke@1 654 * <td headers="ri res_exp send_poll">yes</td>
duke@1 655 * <td headers="ri res_exp rec_reply">yes</td>
duke@1 656 * <td headers="ri res_exp rec_ex">yes</td>
duke@1 657 * <td headers="ri res_exp rec_oth">yes</td></tr>
duke@1 658 *
duke@1 659 * <tr><th id="sync_sco"><p align="left">sync_scope</p></th>
duke@1 660 * <td headers="ri sync_sco send_req">yes</td>
duke@1 661 * <td headers="ri sync_sco send_poll">no </td>
duke@1 662 * <td headers="ri sync_sco rec_reply">yes</td>
duke@1 663 * <td headers="ri sync_sco rec_ex">yes</td>
duke@1 664 * <td headers="ri sync_sco rec_oth">yes</td>
duke@1 665 * </tr>
duke@1 666 *
duke@1 667 * <tr><th id="rep_stat"><p align="left">reply_status</p></th>
duke@1 668 * <td headers="ri rep_stat send_req">no </td>
duke@1 669 * <td headers="ri rep_stat send_poll">no </td>
duke@1 670 * <td headers="ri rep_stat rec_reply">yes</td>
duke@1 671 * <td headers="ri rep_stat rec_ex">yes</td>
duke@1 672 * <td headers="ri rep_stat rec_oth">yes</td></tr>
duke@1 673 *
duke@1 674 * <tr><th id="for_ref"><p align="left">forward_reference</p></th>
duke@1 675 * <td headers="ri for_ref send_req">no </td>
duke@1 676 * <td headers="ri for_ref send_poll">no </td>
duke@1 677 * <td headers="ri for_ref rec_reply">no </td>
duke@1 678 * <td headers="ri for_ref rec_ex">no </td>
duke@1 679 * <td headers="ri for_ref rec_oth">yes<sub>2</sub>
duke@1 680 * </td></tr>
duke@1 681 *
duke@1 682 * <tr><th id="get_slot"><p align="left">get_slot</p></th>
duke@1 683 * <td headers="ri get_slot send_req">yes</td>
duke@1 684 * <td headers="ri get_slot send_poll">yes</td>
duke@1 685 * <td headers="ri get_slot rec_reply">yes</td>
duke@1 686 * <td headers="ri get_slot rec_ex">yes</td>
duke@1 687 * <td headers="ri get_slot rec_oth">yes</td></tr>
duke@1 688 *
duke@1 689 * <tr><th id="grsc"><p align="left">get_request_service_context</p></th>
duke@1 690 * <td headers="ri grsc send_req">yes</td>
duke@1 691 * <td headers="ri grsc send_poll">no </td>
duke@1 692 * <td headers="ri grsc rec_reply">yes</td>
duke@1 693 * <td headers="ri grsc rec_ex">yes</td>
duke@1 694 * <td headers="ri grsc rec_oth">yes</td></tr>
duke@1 695 *
duke@1 696 * <tr><th id="gpsc"><p align="left">get_reply_service_context</p></th>
duke@1 697 * <td headers="ri gpsc send_req">no </td>
duke@1 698 * <td headers="ri gpsc send_poll">no </td>
duke@1 699 * <td headers="ri gpsc rec_reply">yes</td>
duke@1 700 * <td headers="ri gpsc rec_ex">yes</td>
duke@1 701 * <td headers="ri gpsc rec_oth">yes</td>
duke@1 702 * </tr>
duke@1 703 *
duke@1 704 * <tr>
duke@1 705 * <td id="cri" colspan=6><i>ClientRequestInfo-specific:</i></td>
duke@1 706 * </tr>
duke@1 707 *
duke@1 708 * <tr><th id="target"><p align="left">target</p></th>
duke@1 709 * <td headers="cri target send_req">yes</td>
duke@1 710 * <td headers="cri target send_poll">yes</td>
duke@1 711 * <td headers="cri target rec_reply">yes</td>
duke@1 712 * <td headers="cri target rec_ex">yes</td>
duke@1 713 * <td headers="cri target rec_oth">yes</td></tr>
duke@1 714 *
duke@1 715 * <tr><th id="eftarget"><p align="left">effective_target</p></th>
duke@1 716 * <td headers="cri eftarget send_req">yes</td>
duke@1 717 * <td headers="cri eftarget send_poll">yes</td>
duke@1 718 * <td headers="cri eftarget rec_reply">yes</td>
duke@1 719 * <td headers="cri eftarget rec_ex">yes</td>
duke@1 720 * <td headers="cri eftarget rec_oth">yes</td>
duke@1 721 * </tr>
duke@1 722 *
duke@1 723 * <tr><th id="efprof"><p align="left">effective_profile</p></th>
duke@1 724 * <td headers="cri efprof send_req">yes</td>
duke@1 725 * <td headers="cri efprof send_poll">yes</td>
duke@1 726 * <td headers="cri efprof rec_reply">yes</td>
duke@1 727 * <td headers="cri efprof rec_ex">yes</td>
duke@1 728 * <td headers="cri efprof rec_oth">yes</td></tr>
duke@1 729 *
duke@1 730 * <tr><th id="rxp"><p align="left">received_exception</p></th>
duke@1 731 * <td headers="cri rxp send_req">no </td>
duke@1 732 * <td headers="cri rxp send_poll">no </td>
duke@1 733 * <td headers="cri rxp rec_reply">no </td>
duke@1 734 * <td headers="cri rxp rec_ex">yes</td>
duke@1 735 * <td headers="cri rxp rec_oth">no </td></tr>
duke@1 736 *
duke@1 737 * <tr><th id="rei"><p align="left">received_exception_id</p></th>
duke@1 738 * <td headers="cri rei send_req">no </td>
duke@1 739 * <td headers="cri rei send_poll">no </td>
duke@1 740 * <td headers="cri rei rec_reply">no </td>
duke@1 741 * <td headers="cri rei rec_ex">yes</td>
duke@1 742 * <td headers="cri rei rec_oth">no </td></tr>
duke@1 743 *
duke@1 744 * <tr><th id="gec"><p align="left">get_effective_component</p></th>
duke@1 745 * <td headers="cri gec send_req">yes</td>
duke@1 746 * <td headers="cri gec send_poll">no </td>
duke@1 747 * <td headers="cri gec rec_reply">yes</td>
duke@1 748 * <td headers="cri gec rec_ex">yes</td>
duke@1 749 * <td headers="cri gec rec_oth">yes</td></tr>
duke@1 750 *
duke@1 751 * <tr><th id="gecs"><p align="left">get_effective_components</p></th>
duke@1 752 * <td headers="cri gecs send_req">yes</td>
duke@1 753 * <td headers="cri gecs send_poll">no </td>
duke@1 754 * <td headers="cri gecs rec_reply">yes</td>
duke@1 755 * <td headers="cri gecs rec_ex">yes</td>
duke@1 756 * <td headers="cri gecs rec_oth">yes</td></tr>
duke@1 757 *
duke@1 758 * <tr><th id="grpcy"><p align="left">get_request_policy</p></th>
duke@1 759 * <td headers="cri grpcy send_req">yes</td>
duke@1 760 * <td headers="cri grpcy send_poll">no </td>
duke@1 761 * <td headers="cri grpcy rec_reply">yes</td>
duke@1 762 * <td headers="cri grpcy rec_ex">yes</td>
duke@1 763 * <td headers="cri grpcy rec_oth">yes</td></tr>
duke@1 764 *
duke@1 765 * <tr><th id="arsc"><p align="left">add_request_service_context</p></th>
duke@1 766 * <td headers="cri arsc send_req">yes</td>
duke@1 767 * <td headers="cri arsc send_poll">no </td>
duke@1 768 * <td headers="cri arsc rec_reply">no </td>
duke@1 769 * <td headers="cri arsc rec_ex">no </td>
duke@1 770 * <td headers="cri arsc rec_oth">no </td></tr>
duke@1 771 *
duke@1 772 * </tbody>
duke@1 773 * </table>
duke@1 774 *
duke@1 775 * <ol>
duke@1 776 * <li>When <code>ClientRequestInfo</code> is passed to
duke@1 777 * <code>send_request</code>, there is an entry in the list for every
duke@1 778 * argument, whether in, inout, or out. But only the in and inout
duke@1 779 * arguments will be available.</li>
duke@1 780 * <li>If the <code>reply_status</code> atribute is not
duke@1 781 * <code>LOCATION_FORWARD</code>, accessing this attribute will
duke@1 782 * throw <code>BAD_INV_ORDER</code> with a standard minor code of
duke@1 783 * 14.</li>
duke@1 784 * </ol>
duke@1 785 *
duke@1 786 * @see ClientRequestInterceptor
duke@1 787 */
duke@1 788 local interface ClientRequestInfo : RequestInfo {
duke@1 789
duke@1 790 /**
duke@1 791 * Returns the object which the client called to perform the
duke@1 792 * operation.
duke@1 793 *
duke@1 794 * @see #effective_target
duke@1 795 */
duke@1 796 readonly attribute Object target;
duke@1 797
duke@1 798 /**
duke@1 799 * Returns the actual object on which the operation will be invoked.
duke@1 800 * If the <code>reply_status</code> is <code>LOCATION_FORWARD</code>,
duke@1 801 * then on subsequent requests, <code>effective_target</code> will
duke@1 802 * contain the forwarded IOR while target will remain unchanged.
duke@1 803 *
duke@1 804 * @see #target
duke@1 805 */
duke@1 806 readonly attribute Object effective_target;
duke@1 807
duke@1 808 /**
duke@1 809 * Returns the profile that will be used to send the request. If a
duke@1 810 * location forward has occurred for this operation's object and
duke@1 811 * that object's profile changed accordingly, then this profile will
duke@1 812 * be that located profile.
duke@1 813 */
duke@1 814 readonly attribute IOP::TaggedProfile effective_profile;
duke@1 815
duke@1 816 /**
duke@1 817 * Returns an any which contains the exception to be returned to
duke@1 818 * the client.
duke@1 819 * <p>
duke@1 820 * If the exception is a user exception which cannot be inserted
duke@1 821 * into an any (e.g., it is unknown or the bindings don t provide
duke@1 822 * the <code>TypeCode</code>), then this attribute will be an any
duke@1 823 * containing the system exception <code>UNKNOWN</code> with a
duke@1 824 * standard minor code of 1. However, the repository id of
duke@1 825 * the exception is available in the <code>received_exception_id</code>
duke@1 826 * attribute.
duke@1 827 *
duke@1 828 * @see #received_exception_id
duke@1 829 */
duke@1 830 readonly attribute any received_exception;
duke@1 831
duke@1 832 /**
duke@1 833 * Returns the repository id of the exception to be returned to
duke@1 834 * the client.
duke@1 835 *
duke@1 836 * @see #received_exception
duke@1 837 * @see <a href="package-summary.html#unimpl">
duke@1 838 * <code>PortableInterceptor</code> package comments for
duke@1 839 * limitations / unimplemented features</a>
duke@1 840 */
duke@1 841 readonly attribute CORBA::RepositoryId received_exception_id;
duke@1 842
duke@1 843 /**
duke@1 844 * Returns the <code>IOP.TaggedComponent</code> with the given ID from
duke@1 845 * the profile selected for this request.
duke@1 846 * <p>
duke@1 847 * If there is more than one component for a given component ID, it
duke@1 848 * is undefined which component this operation returns. If there is
duke@1 849 * more than one component for a given component ID,
duke@1 850 * <code>get_effective_components</code> should be called instead.
duke@1 851 *
duke@1 852 * @param id The component id of the component which
duke@1 853 * is to be returned.
duke@1 854 * @return The <code>IOP.TaggedComponent</code> obtained with the
duke@1 855 * given identifier.
duke@1 856 * @exception BAD_PARAM thrown, with a standard minor code of 28, if
duke@1 857 * no component exists for the given component ID.
duke@1 858 * @see #get_effective_components
duke@1 859 */
duke@1 860 IOP::TaggedComponent get_effective_component
duke@1 861 (in IOP::ComponentId id);
duke@1 862
duke@1 863 /**
duke@1 864 * Returns an array of all tagged components with the given ID from the
duke@1 865 * profile selected for this request.
duke@1 866 *
duke@1 867 * @param id The component id of the components which are to be returned.
duke@1 868 * @return An array of <code>TaggedComponent</code> objects, each of
duke@1 869 * which contains the given identifier.
duke@1 870 * @exception BAD_PARAM thrown, with a standard minor code of 28, if
duke@1 871 * no component exists for the given component ID.
duke@1 872 * @see #get_effective_component
duke@1 873 */
duke@1 874 IOP::TaggedComponentSeq get_effective_components
duke@1 875 (in IOP::ComponentId id);
duke@1 876
duke@1 877 /**
duke@1 878 * Returns the given policy in effect for this operation.
duke@1 879 *
duke@1 880 * @exception INV_POLICY thrown, with a standard minor code of 1, if the
duke@1 881 * policy type is not valid either because the specified type is
duke@1 882 * not supported by this ORB or because a policy object of that type
duke@1 883 * is not associated with this Object
duke@1 884 * @param type The policy type which specifies the policy to be
duke@1 885 * returned.
duke@1 886 * @return The <code>CORBA.Policy</code> obtained with the given type.
duke@1 887 * @see <a href="package-summary.html#unimpl">
duke@1 888 * <code>PortableInterceptor</code> package comments for
duke@1 889 * limitations / unimplemented features</a>
duke@1 890 */
duke@1 891 CORBA::Policy get_request_policy
duke@1 892 (in CORBA::PolicyType type);
duke@1 893
duke@1 894 /**
duke@1 895 * Allows Interceptors to add service contexts to the request.
duke@1 896 * <p>
duke@1 897 * There is no declaration of the order of the service contexts.
duke@1 898 * They may or may not appear in the order that they are added.
duke@1 899 *
duke@1 900 * @param service_context The <code>IOP.ServiceContext</code> to be
duke@1 901 * added to the request.
duke@1 902 * @param replace Indicates the behavior of this operation when a
duke@1 903 * service context already exists with the given ID. If false,
duke@1 904 * then <code>BAD_INV_ORDER</code> with a standard minor code of 15
duke@1 905 * is thrown. If true, then the existing service context is
duke@1 906 * replaced by the new one.
duke@1 907 */
duke@1 908 void add_request_service_context (
duke@1 909 in IOP::ServiceContext service_context,
duke@1 910 in boolean replace);
duke@1 911 };
duke@1 912
duke@1 913 // Should be type string
duke@1 914 typedef string ServerId ;
duke@1 915
duke@1 916 // This should actually be the CORBA::ORBid type once that is available
duke@1 917 typedef string ORBId ;
duke@1 918
duke@1 919 /** The name of an object adapter. This is unique only within
duke@1 920 * the scope of the ORB that created the object adapter.
duke@1 921 */
duke@1 922 typedef org::omg::CORBA::StringSeq AdapterName ;
duke@1 923
duke@1 924 /** Type of an object id. This provides the identity of a particular
duke@1 925 * object that was created by an object adapter.
duke@1 926 */
duke@1 927 typedef org::omg::CORBA::OctetSeq ObjectId ;
duke@1 928
duke@1 929 /**
duke@1 930 * Request Information, accessible to server-side request interceptors.
duke@1 931 * <p>
duke@1 932 * Some attributes and operations on <code>ServerRequestInfo</code> are not
duke@1 933 * valid at all interception points. The following table shows the validity
duke@1 934 * of each attribute or operation. If it is not valid, attempting to access
duke@1 935 * it will result in a <code>BAD_INV_ORDER</code> being thrown with a
duke@1 936 * standard minor code of 14.
duke@1 937 * <p>
duke@1 938 *
duke@1 939 *
duke@1 940 * <table border=1 summary="Shows the validity of each attribute or operation">
duke@1 941 * <thead>
duke@1 942 * <tr>
duke@1 943 * <th>&nbsp;</th>
duke@1 944 * <th id="rec_req_ser_con" valign="bottom">receive_request_<br>service_contexts</th>
duke@1 945 * <th id="rec_req" valign="bottom">receive_request</th>
duke@1 946 * <th id="send_rep" valign="bottom">send_reply</th>
duke@1 947 * <th id="send_exc" valign="bottom">send_exception</th>
duke@1 948 * <th id="send_oth" valign="bottom">send_other</th>
duke@1 949 * </tr>
duke@1 950 * </thead>
duke@1 951 * <tbody>
duke@1 952 *
duke@1 953 *
duke@1 954 * <tr>
duke@1 955 * <td id="ri" colspan=6><i>Inherited from RequestInfo:</i></td>
duke@1 956 * </tr>
duke@1 957 *
duke@1 958 * <tr><th id="req_id"><p align="left">request_id</p></th>
duke@1 959 * <td headers="ri req_id rec_req_ser_con">yes</td>
duke@1 960 * <td headers="ri req_id rec_req">yes</td>
duke@1 961 * <td headers="ri req_id send_rep">yes</td>
duke@1 962 * <td headers="ri req_id send_exc">yes</td>
duke@1 963 * <td headers="ri req_id send_oth">yes</td></tr>
duke@1 964 *
duke@1 965 * <tr><th id="op"><p align="left">operation</p></th>
duke@1 966 * <td headers="ri op rec_req_ser_con">yes</td>
duke@1 967 * <td headers="ri op rec_req">yes</td>
duke@1 968 * <td headers="ri op send_rep">yes</td>
duke@1 969 * <td headers="ri op send_exc">yes</td>
duke@1 970 * <td headers="ri op send_oth">yes</td></tr>
duke@1 971 *
duke@1 972 * <tr><th id="args"><p align="left">arguments</p></th>
duke@1 973 * <td headers="ri args rec_req_ser_con">no </td>
duke@1 974 * <td headers="ri args rec_req">yes<sub>1</sub></td>
duke@1 975 * <td headers="ri args send_rep">yes</td>
duke@1 976 * <td headers="ri args send_exc">no<sub>2</sub></td>
duke@1 977 * <td headers="ri args send_oth">no<sub>2</sub>
duke@1 978 * </td></tr>
duke@1 979 *
duke@1 980 * <tr><th id="exps"><p align="left">exceptions</p></th>
duke@1 981 * <td headers="ri exps rec_req_ser_con">no </td>
duke@1 982 * <td headers="ri exps rec_req">yes</td>
duke@1 983 * <td headers="ri exps send_rep">yes</td>
duke@1 984 * <td headers="ri exps send_exc">yes</td>
duke@1 985 * <td headers="ri exps send_oth">yes</td></tr>
duke@1 986 *
duke@1 987 * <tr><th id="contexts"><p align="left">contexts</p></th>
duke@1 988 * <td headers="ri contexts rec_req_ser_con">no </td>
duke@1 989 * <td headers="ri contexts rec_req">yes</td>
duke@1 990 * <td headers="ri contexts send_rep">yes</td>
duke@1 991 * <td headers="ri contexts send_exc">yes</td>
duke@1 992 * <td headers="ri contexts send_oth">yes</td></tr>
duke@1 993 *
duke@1 994 * <tr><th id="op_con"><p align="left">operation_context</p></th>
duke@1 995 * <td headers="ri op_con rec_req_ser_con">no </td>
duke@1 996 * <td headers="ri op_con rec_req">yes</td>
duke@1 997 * <td headers="ri op_con send_rep">yes</td>
duke@1 998 * <td headers="ri op_con send_exc">no </td>
duke@1 999 * <td headers="ri op_con send_oth">no </td>
duke@1 1000 * </tr>
duke@1 1001 *
duke@1 1002 * <tr><th id="result"><p align="left">result</p></th>
duke@1 1003 * <td headers="ri result rec_req_ser_con">no </td>
duke@1 1004 * <td headers="ri result rec_req">no </td>
duke@1 1005 * <td headers="ri result send_rep">yes</td>
duke@1 1006 * <td headers="ri result send_exc">no </td>
duke@1 1007 * <td headers="ri result send_oth">no </td>
duke@1 1008 * </tr>
duke@1 1009 *
duke@1 1010 * <tr><th id="res_ex"><p align="left">response_expected</p></th>
duke@1 1011 * <td headers="ri res_ex rec_req_ser_con">yes</td>
duke@1 1012 * <td headers="ri res_ex rec_req">yes</td>
duke@1 1013 * <td headers="ri res_ex send_rep">yes</td>
duke@1 1014 * <td headers="ri res_ex send_exc">yes</td>
duke@1 1015 * <td headers="ri res_ex send_oth">yes</td></tr>
duke@1 1016 *
duke@1 1017 * <tr><th id="syn_scp"><p align="left">sync_scope</p></th>
duke@1 1018 * <td headers="ri syn_scp rec_req_ser_con">yes</td>
duke@1 1019 * <td headers="ri syn_scp rec_req">yes</td>
duke@1 1020 * <td headers="ri syn_scp send_rep">yes</td>
duke@1 1021 * <td headers="ri syn_scp send_exc">yes</td>
duke@1 1022 * <td headers="ri syn_scp send_oth">yes</td></tr>
duke@1 1023 *
duke@1 1024 * <tr><td><b>request_id</b></td>
duke@1 1025 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1026 *
duke@1 1027 * <tr><td><b>operation</b></td>
duke@1 1028 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1029 *
duke@1 1030 * <tr><td><b>arguments</b></td>
duke@1 1031 * <td>no </td> <td>yes<sub>1</sub</td>
duke@1 1032 * <td>yes</td> <td>no<sub>2</sub></td>
duke@1 1033 * <td>no<sub>2</sub>
duke@1 1034 * </td></tr>
duke@1 1035 *
duke@1 1036 * <tr><td><b>exceptions</b></td>
duke@1 1037 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1038 *
duke@1 1039 * <tr><td><b>contexts</b></td>
duke@1 1040 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1041 *
duke@1 1042 * <tr><td><b>operation_context</b></td>
duke@1 1043 * <td>no </td> <td>yes</td> <td>yes</td> <td>no </td> <td>no </td></tr>
duke@1 1044 *
duke@1 1045 * <tr><td><b>result</b></td>
duke@1 1046 * <td>no </td> <td>no </td> <td>yes</td> <td>no </td> <td>no </td></tr>
duke@1 1047 *
duke@1 1048 * <tr><td><b>response_expected</b></td>
duke@1 1049 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1050 *
duke@1 1051 * <tr><td><b>sync_scope</b></td>
duke@1 1052 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1053 *
duke@1 1054 * <tr><td><b>reply_status</b></td>
duke@1 1055 * <td>no </td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1056 *
duke@1 1057 * <tr><td><b>forward_reference</b></td>
duke@1 1058 * <td>no </td> <td>no </td> <td>no </td> <td>no </td> <td>yes<sub>2</sub>
duke@1 1059 * </td></tr>
duke@1 1060 *
duke@1 1061 * <tr><td><b>get_slot</b></td>
duke@1 1062 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1063 *
duke@1 1064 * <tr><td><b>get_request_service_context</b></td>
duke@1 1065 * <td>yes</td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1066 *
duke@1 1067 * <tr><td><b>get_reply_service_context</b></td>
duke@1 1068 * <td>no </td> <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1069 *
duke@1 1070 * <tr>
duke@1 1071 * <td colspan=6><i>ServerRequestInfo-specific:</i></td>
duke@1 1072 * </tr>
duke@1 1073 *
duke@1 1074 * <tr><td><b>sending_exception</b></td>
duke@1 1075 * <td>no </td> <td>no </td> <td>no </td> <td>yes</td> <td>no </td></tr>
duke@1 1076 *
duke@1 1077 * <tr><td><b>object_id</b></td>
duke@1 1078 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes<sub>3</sub></td>
duke@1 1079 * <td>yes<sub>3</sub>
duke@1 1080 * </td></tr>
duke@1 1081 *
duke@1 1082 * <tr><td><b>adapter_id</b></td>
duke@1 1083 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes<sub>3</sub></td>
duke@1 1084 * <td>yes<sub>3</sub>
duke@1 1085 * </td></tr>
duke@1 1086 *
duke@1 1087 * <tr><td><b>server_id</b></td>
duke@1 1088 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1089 *
duke@1 1090 * <tr><td><b>orb_id</b></td>
duke@1 1091 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1092 *
duke@1 1093 * <tr><td><b>adapter_name</b></td>
duke@1 1094 * <td>no </td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1095 *
duke@1 1096 * <tr><td><b>target_most_derived_interface</b></td>
duke@1 1097 * <td>no </td> <td>yes</td> <td>no<sub>4</sub></td>
duke@1 1098 * <td>no<sub>4</sub></td>
duke@1 1099 * <td>no<sub>4</sub>
duke@1 1100 * </td></tr>
duke@1 1101 *
duke@1 1102 * <tr><td><b>get_server_policy</b></td>
duke@1 1103 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1104 *
duke@1 1105 * <tr><td><b>set_slot</b></td>
duke@1 1106 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1107 *
duke@1 1108 * <tr><td><b>target_is_a</b></td>
duke@1 1109 * <td>no </td> <td>yes</td> <td>no<sub>4</sub></td>
duke@1 1110 * <td>no<sub>4</sub></td>
duke@1 1111 * <td>no<sub>4</sub>
duke@1 1112 * </td></tr>
duke@1 1113 *
duke@1 1114 * <tr><td><b>add_reply_service_context</b></td>
duke@1 1115 * <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td> <td>yes</td></tr>
duke@1 1116 * </tbody>
duke@1 1117 * </table>
duke@1 1118 *
duke@1 1119 * <ol>
duke@1 1120 * <li>When <code>ServerRequestInfo</code> is passed to
duke@1 1121 * <code>receive_request</code>, there is an entry in the list for
duke@1 1122 * every argument, whether in, inout, or out. But only the in and
duke@1 1123 * inout arguments will be available.</li>
duke@1 1124 * <li>If the <code>reply_status</code> attribute is not
duke@1 1125 * <code>LOCATION_FORWARD</code>, accessing this attribute will throw
duke@1 1126 * <code>BAD_INV_ORDER</code> with a standard minor code of 14.</li>
duke@1 1127 * <li>If the servant locator caused a location forward, or thrown an
duke@1 1128 * exception, this attribute/operation may not be available in this
duke@1 1129 * interception point. <code>NO_RESOURCES</code> with a standard minor
duke@1 1130 * code of 1 will be thrown if it is not available.</li>
duke@1 1131 * <li>The operation is not available in this interception point because
duke@1 1132 * the necessary information requires access to the target object's
duke@1 1133 * servant, which may no longer be available to the ORB. For example,
duke@1 1134 * if the object's adapter is a POA that uses a
duke@1 1135 * <code>ServantLocator</code>, then the ORB invokes the interception
duke@1 1136 * point after it calls <code>ServantLocator.postinvoke()</code></li>.
duke@1 1137 * </ol>
duke@1 1138 *
duke@1 1139 * @see ServerRequestInterceptor
duke@1 1140 */
duke@1 1141 local interface ServerRequestInfo : RequestInfo {
duke@1 1142
duke@1 1143 /**
duke@1 1144 * Returns an any which contains the exception to be returned to
duke@1 1145 * the client.
duke@1 1146 * <p>
duke@1 1147 * If the exception is a user exception which cannot be inserted into
duke@1 1148 * an any (e.g., it is unknown or the bindings don't provide the
duke@1 1149 * <code>TypeCode</code>), then this attribute will be an any
duke@1 1150 * containing the system exception <code>UNKNOWN</code> with a
duke@1 1151 * standard minor code of 1.
duke@1 1152 *
duke@1 1153 * @see <a href="package-summary.html#unimpl">
duke@1 1154 * <code>PortableInterceptor</code> package comments for
duke@1 1155 * limitations / unimplemented features</a>
duke@1 1156 */
duke@1 1157 readonly attribute any sending_exception;
duke@1 1158
duke@1 1159 /**
duke@1 1160 * Returns the opaque <code>object_id</code> describing the target of
duke@1 1161 * the operation invocation.
duke@1 1162 */
duke@1 1163 readonly attribute ObjectId object_id;
duke@1 1164
duke@1 1165 /**
duke@1 1166 * Returns the opaque identifier for the object adapter.
duke@1 1167 */
duke@1 1168 readonly attribute CORBA::OctetSeq adapter_id;
duke@1 1169
duke@1 1170 /**
duke@1 1171 * Returns the server ID that was specified on ORB::init using the -ORBServerId
duke@1 1172 * argument.
duke@1 1173 */
duke@1 1174 readonly attribute ServerId server_id ;
duke@1 1175
duke@1 1176 /**
duke@1 1177 * Returns the ID that was used to create the ORB.
duke@1 1178 */
duke@1 1179 readonly attribute ORBId orb_id ;
duke@1 1180
duke@1 1181 /**
duke@1 1182 * Returns the sequence of strings that identifies the object
duke@1 1183 * adapter instance that is handling this request.
duke@1 1184 */
duke@1 1185 readonly attribute AdapterName adapter_name ;
duke@1 1186
duke@1 1187 /**
duke@1 1188 * Returns the repository id for the most derived interface of the
duke@1 1189 * servant.
duke@1 1190 */
duke@1 1191 readonly attribute CORBA::RepositoryId
duke@1 1192 target_most_derived_interface;
duke@1 1193
duke@1 1194 /**
duke@1 1195 * Returns the policy in effect for this operation for the given
duke@1 1196 * policy type. The returned <code>CORBA.Policy</code> object shall
duke@1 1197 * only be a policy whose type was registered via
duke@1 1198 * <code>register_policy_factory</code>.
duke@1 1199 *
duke@1 1200 * @param type The <code>CORBA.PolicyType</code> which specifies the
duke@1 1201 * policy to be returned.
duke@1 1202 * @return The <code>CORBA.Policy</code> obtained with the given
duke@1 1203 * policy type.
duke@1 1204 * @exception INV_POLICY thrown, with a standard minor code of 2, if
duke@1 1205 * a policy for the given type was not registered via
duke@1 1206 * <code>register_policy_factory</code>.
duke@1 1207 * @see ORBInitInfo#register_policy_factory
duke@1 1208 */
duke@1 1209 CORBA::Policy get_server_policy
duke@1 1210 (in CORBA::PolicyType type);
duke@1 1211
duke@1 1212 /**
duke@1 1213 * Allows an Interceptor to set a slot in the
duke@1 1214 * <code>PortableInterceptor.Current</code> that is in the scope of
duke@1 1215 * the request. If data already exists in that slot, it will be
duke@1 1216 * overwritten.
duke@1 1217 *
duke@1 1218 * @param id The id of the slot.
duke@1 1219 * @param data The data, in the form of an any, to store in that slot.
duke@1 1220 * @exception InvalidSlot thrown if the ID does not define an allocated
duke@1 1221 * slot.
duke@1 1222 * @see Current
duke@1 1223 */
duke@1 1224 void set_slot (in SlotId id, in any data) raises (InvalidSlot);
duke@1 1225
duke@1 1226 /**
duke@1 1227 * Returns true if the servant is the given repository id,
duke@1 1228 * false if it is not.
duke@1 1229 *
duke@1 1230 * @param id The caller wants to know if the servant is this
duke@1 1231 * repository id.
duke@1 1232 * @return Is the servant the given RepositoryId?
duke@1 1233 */
duke@1 1234 boolean target_is_a (in CORBA::RepositoryId id);
duke@1 1235
duke@1 1236 /**
duke@1 1237 * Allows Interceptors to add service contexts to the request.
duke@1 1238 * <p>
duke@1 1239 * There is no declaration of the order of the service contexts.
duke@1 1240 * They may or may not appear in the order that they are added.
duke@1 1241 *
duke@1 1242 * @param service_context The <code>IOP.ServiceContext</code> to add to
duke@1 1243 * the reply.
duke@1 1244 * @param replace Indicates the behavior of this operation when a
duke@1 1245 * service context already exists with the given ID. If false,
duke@1 1246 * then <code>BAD_INV_ORDER</code> with a standard minor code of 15
duke@1 1247 * is thrown. If true, then the existing service context is
duke@1 1248 * replaced by the new one.
duke@1 1249 * @exception BAD_INV_ORDER thrown, with a standard minor code of 15, if
duke@1 1250 * replace is false and a service context already exists with the
duke@1 1251 * given ID.
duke@1 1252 */
duke@1 1253 void add_reply_service_context (
duke@1 1254 in IOP::ServiceContext service_context,
duke@1 1255 in boolean replace);
duke@1 1256 };
duke@1 1257
duke@1 1258 /**
duke@1 1259 * Client-side request interceptor.
duke@1 1260 * <p>
duke@1 1261 * A request Interceptor is designed to intercept the flow of a
duke@1 1262 * request/reply sequence through the ORB at specific points so that
duke@1 1263 * services can query the request information and manipulate the service
duke@1 1264 * contexts which are propagated between clients and servers. The primary
duke@1 1265 * use of request Interceptors is to enable ORB services to transfer
duke@1 1266 * context information between clients and servers. There are two types
duke@1 1267 * of request Interceptors: client-side and server-side.
duke@1 1268 * <p>
duke@1 1269 * To write a client-side Interceptor, implement the
duke@1 1270 * <code>ClientRequestInterceptor</code> interface.
duke@1 1271 *
duke@1 1272 * @see ClientRequestInfo
duke@1 1273 */
duke@1 1274 local interface ClientRequestInterceptor : Interceptor {
duke@1 1275 /**
duke@1 1276 * Allows an Interceptor to query request information and modify the
duke@1 1277 * service context before the request is sent to the server.
duke@1 1278 * <p>
duke@1 1279 * This interception point may throw a system exception. If it does,
duke@1 1280 * no other Interceptors' <code>send_request</code> operations are called.
duke@1 1281 * Those Interceptors on the Flow Stack are popped and their
duke@1 1282 * <code>receive_exception</code> interception points are called. This
duke@1 1283 * interception point may also throw a <code>ForwardRequest</code>
duke@1 1284 * exception. If an Interceptor throws this exception, no other
duke@1 1285 * Interceptors' <code>send_request</code> operations are
duke@1 1286 * called. Those Interceptors on the Flow Stack are popped and their
duke@1 1287 * <code>receive_other</code> interception points are called.
duke@1 1288 * <p>
duke@1 1289 * Compliant Interceptors shall properly follow completion_status
duke@1 1290 * semantics if they throw a system exception from this interception
duke@1 1291 * point. The <code>completion_status</code> shall be
duke@1 1292 * <code>COMPLETED_NO</code>.
duke@1 1293 *
duke@1 1294 * @param ri Information about the current request being intercepted.
duke@1 1295 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1296 * retry of the request should occur with the new object given in
duke@1 1297 * the exception.
duke@1 1298 */
duke@1 1299 void send_request (in ClientRequestInfo ri) raises (ForwardRequest);
duke@1 1300
duke@1 1301 /**
duke@1 1302 * Allows an Interceptor to query information during a Time-Independent
duke@1 1303 * Invocation (TII) polling get reply sequence.
duke@1 1304 * <p>
duke@1 1305 * With TII, an application may poll for a response to a request sent
duke@1 1306 * previously by the polling client or some other client. This poll is
duke@1 1307 * reported to Interceptors through the <code>send_poll</code>
duke@1 1308 * interception point and the response is returned through the
duke@1 1309 * <code>receive_reply</code> or <code>receive_exception</code>
duke@1 1310 * interception points. If the response is not available before the
duke@1 1311 * poll time-out expires, the system exception <code>TIMEOUT</code> is
duke@1 1312 * thrown and <code>receive_exception</code> is called with this
duke@1 1313 * exception.
duke@1 1314 * <p>
duke@1 1315 * This interception point may throw a system exception. If it does,
duke@1 1316 * no other Interceptors' <code>send_poll</code> operations are
duke@1 1317 * called. Those Interceptors on the Flow Stack are popped and their
duke@1 1318 * <code>receive_exception</code> interception points are called.
duke@1 1319 * <p>
duke@1 1320 * Compliant Interceptors shall properly follow
duke@1 1321 * <code>completion_status</code> semantics if they throw a system
duke@1 1322 * exception from this interception point. The completion_status shall be
duke@1 1323 * <code>COMPLETED_NO</code>.
duke@1 1324 *
duke@1 1325 * @param ri Information about the current request being intercepted.
duke@1 1326 * @exception TIMEOUT thrown if the response is not available before
duke@1 1327 * the poll time-out expires
duke@1 1328 */
duke@1 1329 void send_poll (in ClientRequestInfo ri);
duke@1 1330
duke@1 1331 /**
duke@1 1332 * Allows an Interceptor to query the information on a reply after it
duke@1 1333 * is returned from the server and before control is returned to the
duke@1 1334 * client.
duke@1 1335 * <p>
duke@1 1336 * This interception point may throw a system exception. If it does,
duke@1 1337 * no other Interceptors' <code>receive_reply</code> operations are
duke@1 1338 * called. The remaining Interceptors in the Flow Stack shall have
duke@1 1339 * their <code>receive_exception</code> interception point called.
duke@1 1340 * <p>
duke@1 1341 * Compliant Interceptors shall properly follow
duke@1 1342 * <code>completion_status</code> semantics if they throw a system
duke@1 1343 * exception from this interception point. The
duke@1 1344 * <code>completion_status</code> shall be <code>COMPLETED_YES</code>.
duke@1 1345 *
duke@1 1346 * @param ri Information about the current request being intercepted.
duke@1 1347 */
duke@1 1348 void receive_reply (in ClientRequestInfo ri);
duke@1 1349
duke@1 1350 /**
duke@1 1351 * Indicates to the interceptor that an exception occurred. Allows
duke@1 1352 * an Interceptor to query the exception's information before it is
duke@1 1353 * thrown to the client.
duke@1 1354 * <p>
duke@1 1355 * This interception point may throw a system exception. This has the
duke@1 1356 * effect of changing the exception which successive Interceptors
duke@1 1357 * popped from the Flow Stack receive on their calls to
duke@1 1358 * <code>receive_exception</code>. The exception thrown to the client
duke@1 1359 * will be the last exception thrown by an Interceptor, or the original
duke@1 1360 * exception if no Interceptor changes the exception.
duke@1 1361 * <p>
duke@1 1362 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1363 * exception. If an Interceptor throws this exception, no other
duke@1 1364 * Interceptors' <code>receive_exception</code> operations are called.
duke@1 1365 * The remaining Interceptors in the Flow Stack are popped and have their
duke@1 1366 * <code>receive_other</code> interception point called.
duke@1 1367 * <p>
duke@1 1368 * If the <code>completion_status</code> of the exception is not
duke@1 1369 * <code>COMPLETED_NO</code>, then it is inappropriate for this
duke@1 1370 * interception point to throw a <code>ForwardRequest</code> exception.
duke@1 1371 * The request s at-most-once semantics would be lost.
duke@1 1372 * <p>
duke@1 1373 * Compliant Interceptors shall properly follow
duke@1 1374 * <code>completion_status</code> semantics if they throw a system
duke@1 1375 * exception from this interception point. If the original exception is
duke@1 1376 * a system exception, the <code>completion_status</code> of the new
duke@1 1377 * exception shall be the same as on the original. If the original
duke@1 1378 * exception is a user exception, then the <code>completion_status</code>
duke@1 1379 * of the new exception shall be <code>COMPLETED_YES</code>.
duke@1 1380 * <p>
duke@1 1381 * Under some conditions, depending on what policies are in effect, an
duke@1 1382 * exception (such as <code>COMM_FAILURE</code>) may result in a retry
duke@1 1383 * of the request. While this retry is a new request with respect to
duke@1 1384 * Interceptors, there is one point of correlation between the original
duke@1 1385 * request and the retry: because control has not returned to the
duke@1 1386 * client, the <code>PortableInterceptor.Current</code> for both the
duke@1 1387 * original request and the retrying request is the same.
duke@1 1388 *
duke@1 1389 * @param ri Information about the current request being intercepted.
duke@1 1390 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1391 * retry of the request should occur with the new object given in
duke@1 1392 * the exception.
duke@1 1393 */
duke@1 1394 void receive_exception (in ClientRequestInfo ri) raises (ForwardRequest);
duke@1 1395
duke@1 1396 /**
duke@1 1397 * Allows an Interceptor to query the information available when a
duke@1 1398 * request results in something other than a normal reply or an
duke@1 1399 * exception. For example, a request could result in a retry
duke@1 1400 * (e.g., a GIOP Reply with a <code>LOCATION_FORWARD</code> status was
duke@1 1401 * received); or on asynchronous calls, the reply does not immediately
duke@1 1402 * follow the request, but control shall return to the client and an
duke@1 1403 * ending interception point shall be called.
duke@1 1404 * <p>
duke@1 1405 * For retries, depending on the policies in effect, a new request may or
duke@1 1406 * may not follow when a retry has been indicated. If a new request does
duke@1 1407 * follow, while this request is a new request, with respect to
duke@1 1408 * Interceptors, there is one point of correlation between the original
duke@1 1409 * request and the retry: because control has not returned to the client,
duke@1 1410 * the request scoped <code>PortableInterceptor.Current</code> for both
duke@1 1411 * the original request and the retrying request is the same.
duke@1 1412 * <p>
duke@1 1413 * This interception point may throw a system exception. If it does, no
duke@1 1414 * other Interceptors' <code>receive_other</code> operations are called.
duke@1 1415 * The remaining Interceptors in the Flow Stack are popped and have
duke@1 1416 * their <code>receive_exception</code> interception point called.
duke@1 1417 * <p>
duke@1 1418 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1419 * exception. If an Interceptor throws this exception, successive
duke@1 1420 * Interceptors' <code>receive_other</code> operations are called with
duke@1 1421 * the new information provided by the <code>ForwardRequest</code>
duke@1 1422 * exception.
duke@1 1423 * <p>
duke@1 1424 * Compliant Interceptors shall properly follow
duke@1 1425 * <code>completion_status</code> semantics if they throw a system
duke@1 1426 * exception from this interception point. The
duke@1 1427 * <code>completion_status</code> shall be <code>COMPLETED_NO</code>.
duke@1 1428 * If the target invocation had completed, this interception point
duke@1 1429 * would not be called.
duke@1 1430 *
duke@1 1431 * @param ri Information about the current request being intercepted.
duke@1 1432 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1433 * retry of the request should occur with the new object given in
duke@1 1434 * the exception.
duke@1 1435 */
duke@1 1436 void receive_other (in ClientRequestInfo ri) raises (ForwardRequest);
duke@1 1437 };
duke@1 1438
duke@1 1439 /**
duke@1 1440 * Server-side request interceptor.
duke@1 1441 * <p>
duke@1 1442 * A request Interceptor is designed to intercept the flow of a
duke@1 1443 * request/reply sequence through the ORB at specific points so that
duke@1 1444 * services can query the request information and manipulate the service
duke@1 1445 * contexts which are propagated between clients and servers. The primary
duke@1 1446 * use of request Interceptors is to enable ORB services to transfer
duke@1 1447 * context information between clients and servers. There are two types
duke@1 1448 * of request Interceptors: client-side and server-side.
duke@1 1449 * <p>
duke@1 1450 * To write a server-side Interceptor, implement the
duke@1 1451 * ServerRequestInterceptor interface.
duke@1 1452 *
duke@1 1453 * @see ServerRequestInfo
duke@1 1454 */
duke@1 1455 local interface ServerRequestInterceptor : Interceptor {
duke@1 1456 /**
duke@1 1457 * Allows the interceptor to process service context information.
duke@1 1458 * <p>
duke@1 1459 * At this interception point, Interceptors must get their service
duke@1 1460 * context information from the incoming request transfer it to
duke@1 1461 * <code>PortableInterceptor.Current</code>'s slots.
duke@1 1462 * <p>
duke@1 1463 * This interception point is called before the servant manager is called.
duke@1 1464 * Operation parameters are not yet available at this point. This
duke@1 1465 * interception point may or may not execute in the same thread as
duke@1 1466 * the target invocation.
duke@1 1467 * <p>
duke@1 1468 * This interception point may throw a system exception. If it does,
duke@1 1469 * no other Interceptors' <code>receive_request_service_contexts</code>
duke@1 1470 * operations are called. Those Interceptors on the Flow Stack are
duke@1 1471 * popped and their <code>send_exception</code> interception points are
duke@1 1472 * called.
duke@1 1473 * <p>
duke@1 1474 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1475 * exception. If an Interceptor throws this exception, no other
duke@1 1476 * Interceptors' <code>receive_request_service_contexts</code> operations
duke@1 1477 * are called. Those Interceptors on the Flow Stack are popped and
duke@1 1478 * their <code>send_other</code> interception points are called.
duke@1 1479 * <p>
duke@1 1480 * Compliant Interceptors shall properly follow
duke@1 1481 * <code>completion_status</code> semantics if they throw a system
duke@1 1482 * exception from this interception point. The
duke@1 1483 * <code>completion_status</code> shall be COMPLETED_NO.
duke@1 1484 *
duke@1 1485 * @param ri Information about the current request being intercepted.
duke@1 1486 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1487 * retry of the request should occur with the new object given in
duke@1 1488 * the exception.
duke@1 1489 */
duke@1 1490 void receive_request_service_contexts (in ServerRequestInfo ri)
duke@1 1491 raises (ForwardRequest);
duke@1 1492
duke@1 1493 /**
duke@1 1494 * Allows an Interceptor to query request information after all the
duke@1 1495 * information, including operation parameters, are available. This
duke@1 1496 * interception point shall execute in the same thread as the target
duke@1 1497 * invocation.
duke@1 1498 * <p>
duke@1 1499 * In the DSI model, since the parameters are first available when
duke@1 1500 * the user code calls <code>arguments</code>, <code>receive_request</code>
duke@1 1501 * is called from within <code>arguments</code>. It is possible that
duke@1 1502 * <code>arguments</code> is not called in the DSI model. The target
duke@1 1503 * may call <code>set_exception</code> before calling
duke@1 1504 * <code>arguments</code>. The ORB shall guarantee that
duke@1 1505 * <code>receive_request</code> is called once, either through
duke@1 1506 * <code>arguments</code> or through <code>set_exception</code>. If it
duke@1 1507 * is called through <code>set_exception</code>, requesting the
duke@1 1508 * arguments will result in <code>NO_RESOURCES</code> being thrown with
duke@1 1509 * a standard minor code of 1.
duke@1 1510 * <p>
duke@1 1511 * This interception point may throw a system exception. If it does, no
duke@1 1512 * other Interceptors' <code>receive_request</code> operations are
duke@1 1513 * called. Those Interceptors on the Flow Stack are popped and their
duke@1 1514 * <code>send_exception</code> interception points are called.
duke@1 1515 * <p>
duke@1 1516 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1517 * exception. If an Interceptor throws this exception, no other
duke@1 1518 * Interceptors' <code>receive_request</code> operations are called.
duke@1 1519 * Those Interceptors on the Flow Stack are popped and their
duke@1 1520 * <code>send_other</code> interception points are called.
duke@1 1521 * <p>
duke@1 1522 * Compliant Interceptors shall properly follow
duke@1 1523 * <code>completion_status</code> semantics if they throw a system
duke@1 1524 * exception from this interception point. The
duke@1 1525 * <code>completion_status</code> shall be <code>COMPLETED_NO</code>.
duke@1 1526 *
duke@1 1527 * @param ri Information about the current request being intercepted.
duke@1 1528 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1529 * retry of the request should occur with the new object given in
duke@1 1530 * the exception.
duke@1 1531 */
duke@1 1532 void receive_request (in ServerRequestInfo ri) raises (ForwardRequest);
duke@1 1533
duke@1 1534 /**
duke@1 1535 * Allows an Interceptor to query reply information and modify the
duke@1 1536 * reply service context after the target operation has been invoked
duke@1 1537 * and before the reply is returned to the client. This interception
duke@1 1538 * point shall execute in the same thread as the target invocation.
duke@1 1539 * <p>
duke@1 1540 * This interception point may throw a system exception. If it does,
duke@1 1541 * no other Interceptors' <code>send_reply</code> operations are called.
duke@1 1542 * The remaining Interceptors in the Flow Stack shall have their
duke@1 1543 * <code>send_exception</code> interception point called.
duke@1 1544 * <p>
duke@1 1545 * Compliant Interceptors shall properly follow
duke@1 1546 * <code>completion_status</code> semantics if they throw a
duke@1 1547 * system exception from this interception point. The
duke@1 1548 * <code>completion_status</code> shall be <code>COMPLETED_YES</code>.
duke@1 1549 *
duke@1 1550 * @param ri Information about the current request being intercepted.
duke@1 1551 */
duke@1 1552 void send_reply (in ServerRequestInfo ri);
duke@1 1553
duke@1 1554 /**
duke@1 1555 * Allows an Interceptor to query the exception information and modify
duke@1 1556 * the reply service context before the exception is thrown to the client.
duke@1 1557 * When an exception occurs, this interception point is called. This
duke@1 1558 * interception point shall execute in the same thread as the target
duke@1 1559 * invocation.
duke@1 1560 * <p>
duke@1 1561 * This interception point may throw a system exception. This has the
duke@1 1562 * effect of changing the exception which successive Interceptors
duke@1 1563 * popped from the Flow Stack receive on their calls to
duke@1 1564 * <code>send_exception</code>. The exception thrown to the client will
duke@1 1565 * be the last exception thrown by an Interceptor, or the original
duke@1 1566 * exception if no Interceptor changes the exception.
duke@1 1567 * <p>
duke@1 1568 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1569 * exception. If an Interceptor throws this exception, no other
duke@1 1570 * Interceptors' <code>send_exception</code> operations are called. The
duke@1 1571 * remaining Interceptors in the Flow Stack shall have their
duke@1 1572 * <code>send_other</code> interception points called.
duke@1 1573 * <p>
duke@1 1574 * If the <code>completion_status</code> of the exception is not
duke@1 1575 * <code>COMPLETED_NO</code>, then it is inappropriate for this
duke@1 1576 * interception point to throw a <code>ForwardRequest</code> exception.
duke@1 1577 * The request's at-most-once semantics would be lost.
duke@1 1578 * <p>
duke@1 1579 * Compliant Interceptors shall properly follow
duke@1 1580 * <code>completion_status</code> semantics if they throw a system
duke@1 1581 * exception from this interception point. If the original exception
duke@1 1582 * is a system exception, the <code>completion_status</code> of the new
duke@1 1583 * exception shall be the same as on the original. If the original
duke@1 1584 * exception is a user exception, then the <code>completion_status</code>
duke@1 1585 * of the new exception shall be <code>COMPLETED_YES</code>.
duke@1 1586 *
duke@1 1587 * @param ri Information about the current request being intercepted.
duke@1 1588 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1589 * retry of the request should occur with the new object given in
duke@1 1590 * the exception.
duke@1 1591 */
duke@1 1592 void send_exception (in ServerRequestInfo ri) raises (ForwardRequest);
duke@1 1593
duke@1 1594 /**
duke@1 1595 * Allows an Interceptor to query the information available when a
duke@1 1596 * request results in something other than a normal reply or an
duke@1 1597 * exception. For example, a request could result in a retry
duke@1 1598 * (e.g., a GIOP Reply with a <code>LOCATION_FORWARD</code> status was
duke@1 1599 * received). This interception point shall execute in the same thread
duke@1 1600 * as the target invocation.
duke@1 1601 * <p>
duke@1 1602 * This interception point may throw a system exception. If it does,
duke@1 1603 * no other Interceptors' <code>send_other</code> operations are called.
duke@1 1604 * The remaining Interceptors in the Flow Stack shall have their
duke@1 1605 * <code>send_exception</code> interception points called.
duke@1 1606 * <p>
duke@1 1607 * This interception point may also throw a <code>ForwardRequest</code>
duke@1 1608 * exception. If an Interceptor throws this exception, successive
duke@1 1609 * Interceptors' <code>send_other</code> operations are called with
duke@1 1610 * the new information provided by the <code>ForwardRequest</code>
duke@1 1611 * exception.
duke@1 1612 * <p>
duke@1 1613 * Compliant Interceptors shall properly follow
duke@1 1614 * <code>completion_status</code> semantics if they throw a system
duke@1 1615 * exception from this interception point. The
duke@1 1616 * <code>completion_status</code> shall be <code>COMPLETED_NO</code>.
duke@1 1617 *
duke@1 1618 * @param ri Information about the current request being intercepted.
duke@1 1619 * @exception ForwardRequest If thrown, indicates to the ORB that a
duke@1 1620 * retry of the request should occur with the new object given in
duke@1 1621 * the exception.
duke@1 1622 */
duke@1 1623 void send_other (in ServerRequestInfo ri) raises (ForwardRequest);
duke@1 1624 };
duke@1 1625
duke@1 1626 /** The object reference factory. This provides the capability of
duke@1 1627 * creating an object reference.
duke@1 1628 */
duke@1 1629 abstract valuetype ObjectReferenceFactory {
duke@1 1630 /** make_object creates a CORBA object reference according
duke@1 1631 * to the data in this template, with the given repository ID and
duke@1 1632 * object ID.
duke@1 1633 */
duke@1 1634 Object make_object( in string repositoryId, in ObjectId object_id ) ;
duke@1 1635 } ;
duke@1 1636
duke@1 1637 /** The object reference template. An instance of this must
duke@1 1638 * exist for each object adapter created in an ORB. The server_id,
duke@1 1639 * orb_id, and adapter_name attributes uniquely identify this template
duke@1 1640 * within the scope of an IMR. Note that adapter_id is similarly unique
duke@1 1641 * within the same scope, but it is opaque, and less useful in many
duke@1 1642 * cases.
duke@1 1643 */
duke@1 1644 abstract valuetype ObjectReferenceTemplate : ObjectReferenceFactory {
duke@1 1645
duke@1 1646 readonly attribute ServerId server_id ;
duke@1 1647
duke@1 1648 readonly attribute ORBId orb_id ;
duke@1 1649
duke@1 1650 readonly attribute AdapterName adapter_name ;
duke@1 1651 } ;
duke@1 1652
duke@1 1653 /** Sequence of object reference templates is used for reporting state
duke@1 1654 * changes that do not occur on the adapter manager.
duke@1 1655 */
duke@1 1656 typedef sequence<ObjectReferenceTemplate> ObjectReferenceTemplateSeq ;
duke@1 1657
duke@1 1658 /** Adapter manager identifier. Every object adapter has an adapter manager,
duke@1 1659 * indicated in this API only through the ID. A group of object adapter
duke@1 1660 * instances may share the same adapter manager, in which case state transitions
duke@1 1661 * reported for the adapter manager are observed by all object adapters with the
duke@1 1662 * same adapter manager ID.
duke@1 1663 */
duke@1 1664 typedef long AdapterManagerId ;
duke@1 1665
duke@1 1666 /** Type of object adapter state. State changes are reported either to
duke@1 1667 * the object adapter or to the adapter manager.
duke@1 1668 */
duke@1 1669 typedef short AdapterState ;
duke@1 1670
duke@1 1671 /** Object adapter state that holds requests temporarily until the
duke@1 1672 * state is changed.
duke@1 1673 */
duke@1 1674 const AdapterState HOLDING = 0 ;
duke@1 1675
duke@1 1676 /** Object adapter state that indicates normal request processing.
duke@1 1677 */
duke@1 1678 const AdapterState ACTIVE = 1 ;
duke@1 1679
duke@1 1680 /** Object adapter state that causes all requests to be discarded.
duke@1 1681 */
duke@1 1682 const AdapterState DISCARDING = 2 ;
duke@1 1683
duke@1 1684 /** Object adapter state that causes all requests to be discarded.
duke@1 1685 * This state indicates that the adapter is shutting down.
duke@1 1686 */
duke@1 1687 const AdapterState INACTIVE = 3 ;
duke@1 1688
duke@1 1689 /** Object adapter state indicating that the adapter has been destroyed.
duke@1 1690 */
duke@1 1691 const AdapterState NON_EXISTENT = 4 ;
duke@1 1692
duke@1 1693 /**
duke@1 1694 * Provides the server-side ORB service with access to the applicable
duke@1 1695 * policies during IOR construction and the ability to add components.
duke@1 1696 * The ORB passes an instance of its implementation of this interface as
duke@1 1697 * a parameter to <code>IORInterceptor.establish_components</code>.
duke@1 1698 *
duke@1 1699 * @see IORInterceptor
duke@1 1700 */
duke@1 1701 local interface IORInfo {
duke@1 1702
duke@1 1703 /**
duke@1 1704 * Allows an ORB service implementation to determine what server side
duke@1 1705 * policy of a particular type is in effect for an IOR being
duke@1 1706 * constructed. When the IOR being constructed is for an object
duke@1 1707 * implemented using a POA, all Policy objects passed to the
duke@1 1708 * <code>PortableServer.POA.create_POA</code> call that created that
duke@1 1709 * POA are accessable via <code>get_effective_policy</code>.
duke@1 1710 * <p>
duke@1 1711 * If a policy for the given type is not known to the ORB, then this
duke@1 1712 * operation will throw <code>INV_POLICY</code> with a standard minor
duke@1 1713 * code of 2.
duke@1 1714 *
duke@1 1715 * @param type an int specifying the type of policy to return.
duke@1 1716 * @return The effective <code>CORBA.Policy</code> object of the
duke@1 1717 * requested type. If the given policy type is known, but no policy
duke@1 1718 * of that type is in effect, then this operation will return a
duke@1 1719 * nil object reference.
duke@1 1720 */
duke@1 1721 CORBA::Policy get_effective_policy
duke@1 1722 (in CORBA::PolicyType type);
duke@1 1723
duke@1 1724 /**
duke@1 1725 * A portable ORB service implementation calls
duke@1 1726 * <code>add_ior_component</code> from its implementation of
duke@1 1727 * <code>establish_components</code> to add a tagged component to the
duke@1 1728 * set which will be included when constructing IORs. The components in
duke@1 1729 * this set will be included in all profiles.
duke@1 1730 * <p>
duke@1 1731 * Any number of components may exist with the same component ID.
duke@1 1732 *
andrew@135 1733 * @param tagged_component The IOP.TaggedComponent to add.
duke@1 1734 */
duke@1 1735 void add_ior_component
duke@1 1736 (in IOP::TaggedComponent tagged_component);
duke@1 1737
duke@1 1738 /**
duke@1 1739 * A portable ORB service implementation calls
duke@1 1740 * <code>add_ior_component_to_profile</code> from its implementation of
duke@1 1741 * <code>establish_components</code> to add a tagged component to the
duke@1 1742 * set which will be included when constructing IORs. The components in
duke@1 1743 * this set will be included in the specified profile.
duke@1 1744 * <p>
duke@1 1745 * Any number of components may exist with the same component ID.
duke@1 1746 *
andrew@135 1747 * @param tagged_component The <code>IOP.TaggedComponent</code> to add.
duke@1 1748 * @param profile_id The profile id of the profile to
duke@1 1749 * which this component will be added.
duke@1 1750 * @exception BAD_PARAM thrown, with a standard minor code of 29, if the
duke@1 1751 * given profile ID does not define a known profile or it is
duke@1 1752 * impossible to add components to that profile.
duke@1 1753 */
duke@1 1754 void add_ior_component_to_profile (
duke@1 1755 in IOP::TaggedComponent tagged_component,
duke@1 1756 in IOP::ProfileId profile_id);
duke@1 1757
duke@1 1758 /** Return the adapter manager id of the object adapter
duke@1 1759 * that was just created and is running IOR interceptors.
duke@1 1760 */
duke@1 1761 readonly attribute AdapterManagerId manager_id ;
duke@1 1762
duke@1 1763 /** Return the adapter state of the object adapter
duke@1 1764 * that was just created and is running IOR interceptors.
duke@1 1765 */
duke@1 1766 readonly attribute AdapterState state ;
duke@1 1767
duke@1 1768 /** Return the object reference template of the object adapter
duke@1 1769 * that was just created and is running IOR interceptors.
duke@1 1770 */
duke@1 1771 readonly attribute ObjectReferenceTemplate adapter_template ;
duke@1 1772
duke@1 1773 /** On read, returns the current factory that will be used to create
duke@1 1774 * object references for the object adapter that was just created
duke@1 1775 * and is running IOR interceptors. By default, this factory is the same
duke@1 1776 * as the value of the adapter_template attribute. The current_factory
duke@1 1777 * may also be set to another object reference template inside an
duke@1 1778 * IORInterceptor_3_0.
duke@1 1779 */
duke@1 1780 attribute ObjectReferenceFactory current_factory ;
duke@1 1781 };
duke@1 1782
duke@1 1783 /**
duke@1 1784 * Interceptor used to establish tagged components in the profiles within
duke@1 1785 * an IOR.
duke@1 1786 * <p>
duke@1 1787 * In some cases, a portable ORB service implementation may need to add
duke@1 1788 * information describing the server's or object's ORB service related
duke@1 1789 * capabilities to object references in order to enable the ORB service
duke@1 1790 * implementation in the client to function properly.
duke@1 1791 * <p>
duke@1 1792 * This is supported through the <code>IORInterceptor</code> and
duke@1 1793 * <code>IORInfo</code> interfaces.
duke@1 1794 *
duke@1 1795 * @see IORInfo
duke@1 1796 */
duke@1 1797 local interface IORInterceptor : Interceptor {
duke@1 1798 /**
duke@1 1799 * A server side ORB calls the <code>establish_components</code>
duke@1 1800 * operation on all registered <code>IORInterceptor</code> instances
duke@1 1801 * when it is assembling the list of components that will be included
duke@1 1802 * in the profile or profiles of an object reference. This operation
duke@1 1803 * is not necessarily called for each individual object reference.
duke@1 1804 * In the case of the POA, this operation is called each time POA::create_POA
duke@1 1805 * is called. In any case, <code>establish_components</code> is
duke@1 1806 * guaranteed to be called at least once for each distinct set of
duke@1 1807 * server policies.
duke@1 1808 * <p>
duke@1 1809 * An implementation of <code>establish_components</code> must not
duke@1 1810 * throw exceptions. If it does, the ORB shall ignore the exception
duke@1 1811 * and proceed to call the next IOR Interceptor's
duke@1 1812 * <code>establish_components</code> operation.
duke@1 1813 *
duke@1 1814 * @param info The <code>IORInfo</code> instance used by the ORB
duke@1 1815 * service to query applicable policies and add components to be
duke@1 1816 * included in the generated IORs.
duke@1 1817 */
duke@1 1818 void establish_components (in IORInfo info);
duke@1 1819 };
duke@1 1820
duke@1 1821 local interface IORInterceptor_3_0 : IORInterceptor {
duke@1 1822 /** The components_established method is invoked on all registered
duke@1 1823 * IORInterceptor_3_0 instances after establish_components
duke@1 1824 * has been invoked on all registered IORInterceptor instances.
duke@1 1825 * The adapter_template is available in info during this call.
duke@1 1826 * The current_factory may be get or set in info during this call.
duke@1 1827 * <p>
duke@1 1828 * Any exception thrown from this method is handled by the Object
duke@1 1829 * Adapter that called this interceptor. In the case of the POA,
duke@1 1830 * an exception results in a OBJ_ADAPTER exception with an OMG
duke@1 1831 * standard minor code of 6.
duke@1 1832 * @param info The IORInfo for the object adapter being created.
duke@1 1833 */
duke@1 1834 void components_established( in IORInfo info ) ;
duke@1 1835
duke@1 1836 /** Called whenever the state of an adapter manager changes.
duke@1 1837 * For the POA, that is the POAManager. If the state change
duke@1 1838 * is reported through <code>adapter_manager_state_changed</code>,
duke@1 1839 * it is not reported through <code>adapter_state_changed</code>.
duke@1 1840 * @param id the adapter manager id of the adapter manager that
duke@1 1841 * changed state
duke@1 1842 * @param state the new state of the adapter manager
duke@1 1843 */
duke@1 1844 void adapter_manager_state_changed( in AdapterManagerId id,
duke@1 1845 in AdapterState state ) ;
duke@1 1846
duke@1 1847 /** Called whenever the state of an object adapter changes, and
duke@1 1848 * the state change is not caused by an adapter manager. Such
duke@1 1849 * changes are reported to all registered <code>IORInterceptor_3_0</code>
duke@1 1850 * instances.
duke@1 1851 * @param templates the sequence of <code>ObjectReferenceTemplate</code> instances
duke@1 1852 * on which this state change occurred.
duke@1 1853 * @param state the new <code>AdapterState</code> shared by all of the templates.
duke@1 1854 */
duke@1 1855 void adapter_state_changed( in ObjectReferenceTemplateSeq templates,
duke@1 1856 in AdapterState state ) ;
duke@1 1857 };
duke@1 1858
duke@1 1859 /**
duke@1 1860 * Enables policy types to be constructed using
duke@1 1861 * <code>CORBA.ORB.create_policy</code>.
duke@1 1862 * <p>
duke@1 1863 * A portable ORB service implementation registers an instance of the
duke@1 1864 * <code>PolicyFactory</code> interface during ORB initialization in order
duke@1 1865 * to enable its policy types to be constructed using
duke@1 1866 * <code>CORBA.ORB.create_policy</code>. The POA is required to preserve
duke@1 1867 * any policy which is registered with <code>ORBInitInfo</code> in this
duke@1 1868 * manner.
duke@1 1869 *
duke@1 1870 * @see ORBInitInfo#register_policy_factory
duke@1 1871 */
duke@1 1872 local interface PolicyFactory
duke@1 1873 {
duke@1 1874 /**
duke@1 1875 * Returns an instance of the appropriate interface derived from
duke@1 1876 * <code>CORBA.Policy</code> whose value corresponds to the
duke@1 1877 * specified any.
duke@1 1878 * <p>
duke@1 1879 * The ORB calls <code>create_policy</code> on a registered
duke@1 1880 * <code>PolicyFactory</code> instance when
duke@1 1881 * <code>CORBA.ORB.create_policy</code> is called for the
duke@1 1882 * <code>PolicyType</code> under which the <code>PolicyFactory</code> has
duke@1 1883 * been registered. The <code>create_policy</code> operation then
duke@1 1884 * returns an instance of the appropriate interface derived from
duke@1 1885 * <code>CORBA.Policy</code> whose value corresponds to the specified
duke@1 1886 * any. If it cannot, it shall throw an exception as described for
duke@1 1887 * <code>CORBA.ORB.create_policy</code>.
duke@1 1888 *
duke@1 1889 * @param type An int specifying the type of policy being created.
duke@1 1890 * @param value An any containing data with which to construct the
duke@1 1891 * <code>CORBA.Policy</code>.
duke@1 1892 * @return A <code>CORBA.Policy<code> object of the specified type and
duke@1 1893 * value.
duke@1 1894 */
duke@1 1895 CORBA::Policy create_policy
duke@1 1896 (in CORBA::PolicyType type, in any value)
duke@1 1897 raises (CORBA::PolicyError);
duke@1 1898 };
duke@1 1899
duke@1 1900 /**
duke@1 1901 * Passed to each <code>ORBInitializer</code>, allowing it to
duke@1 1902 * to register interceptors and perform other duties while the ORB is
duke@1 1903 * initializing.
duke@1 1904 * <p>
duke@1 1905 * The <code>ORBInitInfo</code> object is only valid during
duke@1 1906 * <code>ORB.init</code>. If a service keeps a reference to its
duke@1 1907 * <code>ORBInitInfo</code> object and tries to use it after
duke@1 1908 * <code>ORB.init</code> returns, the object no longer exists and an
duke@1 1909 * <code>OBJECT_NOT_EXIST</code> exception shall be thrown.
duke@1 1910 *
duke@1 1911 * @see ORBInitializer
duke@1 1912 */
duke@1 1913 local interface ORBInitInfo {
duke@1 1914
duke@1 1915 /** Object id, represented as a String */
duke@1 1916 typedef string ObjectId;
duke@1 1917
duke@1 1918 /**
duke@1 1919 * Only one Interceptor of a given name can be registered with the
duke@1 1920 * ORB for each Interceptor type. If an attempt is made to register a
duke@1 1921 * second Interceptor with the same name, DuplicateName is thrown.
duke@1 1922 * <p>
duke@1 1923 * An Interceptor may be anonymous, i.e., have an empty string as the
duke@1 1924 * name attribute. Any number of anonymous Interceptors may be
duke@1 1925 * registered with the ORB so, if the Interceptor being registered
duke@1 1926 * is anonymous, the registration operation will not throw
duke@1 1927 * <code>DuplicateName</code>.
duke@1 1928 */
duke@1 1929 exception DuplicateName {
duke@1 1930 /**
duke@1 1931 * The name for which there was already an interceptor registered.
duke@1 1932 */
duke@1 1933 string name;
duke@1 1934 };
duke@1 1935
duke@1 1936 /**
duke@1 1937 * This exception is thrown by
duke@1 1938 * <code>register_initial_reference</code> and
duke@1 1939 * <code>resolve_initial_references</code>.
duke@1 1940 * <code>register_initial_reference</code> throws <code>InvalidName</code>
duke@1 1941 * if:
duke@1 1942 * <ul>
duke@1 1943 * <li>this operation is called with an empty string id; or</li>
duke@1 1944 * <li>this operation is called with an id that is already registered,
duke@1 1945 * including the default names defined by OMG.</li>
duke@1 1946 * </ul>
duke@1 1947 * <code>resolve_initial_references</code> throws
duke@1 1948 * <code>InvalidName</code> if the name to be resolved is invalid.
duke@1 1949 */
duke@1 1950 exception InvalidName {};
duke@1 1951
duke@1 1952 /**
duke@1 1953 * Returns the arguments passed to <code>ORB.init</code>. They may or
duke@1 1954 * may not contain the ORB's arguments.
duke@1 1955 */
duke@1 1956 readonly attribute CORBA::StringSeq arguments;
duke@1 1957
duke@1 1958 /**
duke@1 1959 * Returns the ID of the ORB being initialized.
duke@1 1960 */
duke@1 1961 readonly attribute string orb_id;
duke@1 1962
duke@1 1963 /**
duke@1 1964 * Returns the <code>IOP.CodecFactory</code>. The
duke@1 1965 * <code>CodecFactory</code> is normally obtained via a call to
duke@1 1966 * <code>ORB.resolve_initial_references( "CodecFactory" )</code>, but
duke@1 1967 * since the ORB is not yet available and Interceptors, particularly when
duke@1 1968 * processing service contexts, will require a <code>Codec</code>, a
duke@1 1969 * means of obtaining a <code>Codec</code> is necessary during ORB
duke@1 1970 * initialization.
duke@1 1971 */
duke@1 1972 readonly attribute IOP::CodecFactory codec_factory;
duke@1 1973
duke@1 1974 /**
duke@1 1975 * Identical to <code>ORB.register_initial_reference</code>. This same
duke@1 1976 * functionality exists here because the ORB, not yet fully initialized,
duke@1 1977 * is not yet available but initial references may need to be
duke@1 1978 * registered as part of Interceptor registration. The only difference
duke@1 1979 * is that the version of this operation on the ORB uses PIDL
duke@1 1980 * (<code>CORBA.ORB.ObjectId</code>) and
duke@1 1981 * (<code>CORBA.ORB.InvalidName</code>) whereas the version in this
duke@1 1982 * interface uses IDL defined in this interface; the semantics are
duke@1 1983 * identical.
duke@1 1984 */
duke@1 1985 void register_initial_reference (in ObjectId id, in Object obj)
duke@1 1986 raises (InvalidName);
duke@1 1987
duke@1 1988 // This was incorrectly returning void in orbos/99-12-02, correction
duke@1 1989 // from errata in orbos/00-01-01
duke@1 1990 /**
duke@1 1991 * Identical to <code>ORB.resolve_initial_references</code>. This same
duke@1 1992 * functionality exists here because the ORB, not yet fully initialized,
duke@1 1993 * is not yet available but initial references may be required from the
duke@1 1994 * ORB as part of Interceptor registration. The only difference is that
duke@1 1995 * the version of this operation on the ORB uses PIDL
duke@1 1996 * (<code>CORBA::ORB::ObjectId</code> and
duke@1 1997 * <code>CORBA::ORB::InvalidName</code>) whereas the version in this
duke@1 1998 * interface uses IDL defined in this interface; the semantics
duke@1 1999 * are identical.
duke@1 2000 * <p>
duke@1 2001 * This operation is only valid during post_init.
duke@1 2002 */
duke@1 2003 Object resolve_initial_references (in ObjectId id) raises (InvalidName);
duke@1 2004
duke@1 2005 /**
duke@1 2006 * Used to add a client-side request Interceptor to the list of
duke@1 2007 * client-side request Interceptors.
duke@1 2008 *
duke@1 2009 * @param interceptor The <code>ClientRequestInterceptor</code> to be
duke@1 2010 * added.
duke@1 2011 * @exception DuplicateName thrown if a client-side request Interceptor
duke@1 2012 * has already been registered with this Interceptor's name.
duke@1 2013 */
duke@1 2014 void add_client_request_interceptor
duke@1 2015 (in ClientRequestInterceptor interceptor)
duke@1 2016 raises (DuplicateName);
duke@1 2017
duke@1 2018 /**
duke@1 2019 * Used to add a server-side request Interceptor to the list of
duke@1 2020 * server-side request Interceptors.
duke@1 2021 *
duke@1 2022 * @param interceptor The ServerRequestInterceptor to be added.
duke@1 2023 * @exception DuplicateName thrown if a server-side request Interceptor
duke@1 2024 * has already been registered with this Interceptor's name
duke@1 2025 */
duke@1 2026 void add_server_request_interceptor (
duke@1 2027 in ServerRequestInterceptor interceptor)
duke@1 2028 raises (DuplicateName);
duke@1 2029
duke@1 2030 /**
duke@1 2031 * Used to add an IOR Interceptor to the list of IOR Interceptors.
duke@1 2032 *
duke@1 2033 * @param interceptor The IORInterceptor to be added.
duke@1 2034 * @exception DuplicateName thrown if an IOR Interceptor has already
duke@1 2035 * been registered with this Interceptor's name.
duke@1 2036 */
duke@1 2037 void add_ior_interceptor (in IORInterceptor interceptor)
duke@1 2038 raises (DuplicateName);
duke@1 2039
duke@1 2040 /**
duke@1 2041 * Called to allocate a slot on <code>PortableInterceptor.Current</code>.
duke@1 2042 * <p>
duke@1 2043 * Note that while slot id's can be allocated within an ORB initializer,
duke@1 2044 * the slots themselves cannot be initialized.
duke@1 2045 *
duke@1 2046 * @return The index to the slot which has been allocated.
duke@1 2047 * @exception BAD_INV_ORDER thrown, with a standard minor code of 14, if
duke@1 2048 * <code>set_slot</code> or <code>get_slot</code> is called on the
duke@1 2049 * <code>PICurrent</code> within an ORB initializer.
duke@1 2050 * @see Current
duke@1 2051 */
duke@1 2052 SlotId allocate_slot_id ();
duke@1 2053
duke@1 2054 /**
duke@1 2055 * Registers a <code>PolicyFactory</code> for the given
duke@1 2056 * <code>PolicyType</code>.
duke@1 2057 *
duke@1 2058 * @param type The policy type that the given <code>PolicyFactory</code>
duke@1 2059 * serves.
duke@1 2060 * @param policy_factory The factory for the given policy type.
duke@1 2061 * @exception BAD_INV_ORDER thrown, with a standard minor code of 16, if
duke@1 2062 * a <code>PolicyFactory</code> already exists for the given
duke@1 2063 * <code>PolicyType</code>.
duke@1 2064 */
duke@1 2065 void register_policy_factory (
duke@1 2066 in CORBA::PolicyType type,
duke@1 2067 in PolicyFactory policy_factory);
duke@1 2068 };
duke@1 2069
duke@1 2070 /**
duke@1 2071 * Facilitates interceptor registration and ORB initialization.
duke@1 2072 * <p>
duke@1 2073 * Interceptors are intended to be a means by which ORB services gain
duke@1 2074 * access to ORB processing, effectively becoming part of the ORB.
duke@1 2075 * Since Interceptors are part of the ORB, when <code>ORB.init</code>
duke@1 2076 * returns an ORB, the Interceptors shall have been registered.
duke@1 2077 * Interceptors cannot be registered on an ORB after it has been
duke@1 2078 * returned by a call to <code>ORB.init</code>.
duke@1 2079 * <p>
duke@1 2080 * An Interceptor is registered by registering an associated
duke@1 2081 * <code>ORBInitializer</code> object which implements the
duke@1 2082 * <code>ORBInitializer</code> interface. When an ORB is initializing,
duke@1 2083 * it shall call each registered <code>ORBInitializer</code>, passing it
duke@1 2084 * an <code>ORBInitInfo</code> object which is used to register its
duke@1 2085 * Interceptor.
duke@1 2086 * <p>
duke@1 2087 * <b>Registering ORB Initializers in Java</b>
duke@1 2088 * <p>
duke@1 2089 * ORBInitializers are registered via Java ORB properties.
duke@1 2090 * <p>
duke@1 2091 * The property names are of the form:
duke@1 2092 * <blockquote><code>
duke@1 2093 * org.omg.PortableInterceptor.ORBInitializerClass.&lt;Service&gt;
duke@1 2094 * </code></blockquote>
duke@1 2095 * where <code>&lt;Service&gt;</code> is the string name of a class
duke@1 2096 * which implements
duke@1 2097 * <blockquote><code>
duke@1 2098 * org.omg.PortableInterceptor.ORBInitializer
duke@1 2099 * </code></blockquote>
duke@1 2100 * To avoid name collisions, the reverse DNS name convention should be
duke@1 2101 * used. For example, if company X has three initializers, it could define
duke@1 2102 * the following properties:
duke@1 2103 * <ul>
duke@1 2104 * <li><code>
duke@1 2105 * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init1
duke@1 2106 * </code></li>
duke@1 2107 * <li><code>
duke@1 2108 * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init2
duke@1 2109 * </code></li>
duke@1 2110 * <li><code>
duke@1 2111 * org.omg.PortableInterceptor.ORBInitializerClass.com.x.Init3
duke@1 2112 * </code></li>
duke@1 2113 * </ul>
duke@1 2114 * During ORB.init, these ORB properties which begin with
duke@1 2115 * <code>org.omg.PortableInterceptor.ORBInitializerClass</code> shall be
duke@1 2116 * collected, the <code>&lt;Service&gt;</code> portion of each property
duke@1 2117 * shall be extracted, an object shall be instantiated with the
duke@1 2118 * <code>&lt;Service&gt;</code> string as its class name, and the
duke@1 2119 * <code>pre_init</code> and <code>post_init</code> methods shall be
duke@1 2120 * called on that object. If there are any exceptions, the ORB shall
duke@1 2121 * ignore them and proceed.
duke@1 2122 * <p>
duke@1 2123 * <b><i>Example</i></b>
duke@1 2124 * <p>
duke@1 2125 * A client-side logging service written by company X, for example, may
duke@1 2126 * have the following ORBInitializer implementation:
duke@1 2127 * <code><pre>
duke@1 2128 * package com.x.logging;
duke@1 2129 *
duke@1 2130 * import org.omg.PortableInterceptor.Interceptor;
duke@1 2131 * import org.omg.PortableInterceptor.ORBInitializer;
duke@1 2132 * import org.omg.PortableInterceptor.ORBInitInfo;
duke@1 2133 *
duke@1 2134 * public class LoggingService implements ORBInitializer {
duke@1 2135 * void pre_init( ORBInitInfo info ) {
duke@1 2136 * // Instantiate the Logging Service s Interceptor.
duke@1 2137 * Interceptor interceptor = new LoggingInterceptor();
duke@1 2138 *
duke@1 2139 * // Register the Logging Service s Interceptor.
duke@1 2140 * info.add_client_request_interceptor( interceptor );
duke@1 2141 * }
duke@1 2142 *
duke@1 2143 * void post_init( ORBInitInfo info ) {
duke@1 2144 * // This service does not need two init points.
duke@1 2145 * }
duke@1 2146 * }
duke@1 2147 * </pre></code>
duke@1 2148 * To run a program called <code>MyApp</code> using this logging
duke@1 2149 * service, the user could type:
duke@1 2150 * <blockquote><code>
duke@1 2151 * java
duke@1 2152 *-Dorg.omg.PortableInterceptor.ORBInitializerClass.com.x.Logging.LoggingService
duke@1 2153 * MyApp
duke@1 2154 * </code></blockquote>
duke@1 2155 * <p>
duke@1 2156 * <b>Notes about Registering Interceptors</b>
duke@1 2157 * <p>
duke@1 2158 * Request Interceptors are registered on a per-ORB basis.
duke@1 2159 * <p>
duke@1 2160 * To achieve virtual per-object Interceptors, query the policies on the
duke@1 2161 * target from within the interception points to determine whether they
duke@1 2162 * should do any work.
duke@1 2163 * <p>
duke@1 2164 * To achieve virtual per-POA Interceptors, instantiate each POA with a
duke@1 2165 * different ORB. While Interceptors may be ordered administratively,
duke@1 2166 * there is no concept of order with respect to the registration of
duke@1 2167 * Interceptors. Request Interceptors are concerned with service contexts.
duke@1 2168 * Service contexts have no order, so there is no purpose for request
duke@1 2169 * Interceptors to have an order. IOR Interceptors are concerned with
duke@1 2170 * tagged components. Tagged components also have no order, so there
duke@1 2171 * is no purpose for IOR Interceptors to have an order.
duke@1 2172 * <p>
duke@1 2173 * Registration code should avoid using the ORB (i.e., calling
duke@1 2174 * <code>ORB.init</code> with the provided <code>orb_id</code>). Since
duke@1 2175 * registration occurs during ORB initialization, results of invocations
duke@1 2176 * on this ORB while it is in this state are undefined.
duke@1 2177 *
duke@1 2178 * @see ORBInitInfo
duke@1 2179 */
duke@1 2180 local interface ORBInitializer {
duke@1 2181
duke@1 2182 /**
duke@1 2183 * Called during ORB initialization. If it is expected that initial
duke@1 2184 * services registered by an interceptor will be used by other
duke@1 2185 * interceptors, then those initial services shall be registered at
duke@1 2186 * this point via calls to
duke@1 2187 * <code>ORBInitInfo.register_initial_reference</code>.
duke@1 2188 *
duke@1 2189 * @param info provides initialization attributes and operations by
duke@1 2190 * which Interceptors can be registered.
duke@1 2191 */
duke@1 2192 void pre_init (in ORBInitInfo info);
duke@1 2193
duke@1 2194 /**
duke@1 2195 * Called during ORB initialization. If a service must resolve initial
duke@1 2196 * references as part of its initialization, it can assume that all
duke@1 2197 * initial references will be available at this point.
duke@1 2198 * <p>
duke@1 2199 * Calling the <code>post_init</code> operations is not the final
duke@1 2200 * task of ORB initialization. The final task, following the
duke@1 2201 * <code>post_init</code> calls, is attaching the lists of registered
duke@1 2202 * interceptors to the ORB. Therefore, the ORB does not contain the
duke@1 2203 * interceptors during calls to <code>post_init</code>. If an
duke@1 2204 * ORB-mediated call is made from within <code>post_init</code>, no
duke@1 2205 * request interceptors will be invoked on that call.
duke@1 2206 * Likewise, if an operation is performed which causes an IOR to be
duke@1 2207 * created, no IOR interceptors will be invoked.
duke@1 2208 *
duke@1 2209 * @param info provides initialization attributes and
duke@1 2210 * operations by which Interceptors can be registered.
duke@1 2211 */
duke@1 2212 void post_init (in ORBInitInfo info);
duke@1 2213 };
duke@1 2214 };

mercurial