Thu, 11 Jul 2019 00:03:18 +0100
Added tag jdk8u222-b10 for changeset d44170c2cece
duke@1 | 1 | /* |
ohair@158 | 2 | * Copyright (c) 1997, 2001, 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 | #include "corba.idl" |
duke@1 | 27 | #include "CORBAX.idl" |
duke@1 | 28 | |
duke@1 | 29 | #pragma prefix "omg.org" |
duke@1 | 30 | /** |
duke@1 | 31 | * All Mapping corresponds to the Chapter 11 of |
duke@1 | 32 | * CORBA V2.3.1 specified by OMG document formal/99-10-07.pdf. |
duke@1 | 33 | * The exception to this is the id attribute, which is added in ptc/00-08-06, |
duke@1 | 34 | * section 11.3.8.26. |
duke@1 | 35 | */ |
duke@1 | 36 | module PortableServer { |
duke@1 | 37 | |
duke@1 | 38 | #pragma version PortableServer 2.3 |
duke@1 | 39 | |
duke@1 | 40 | // forward reference |
duke@1 | 41 | interface POA; |
duke@1 | 42 | |
duke@1 | 43 | /** |
duke@1 | 44 | * List of POAs |
duke@1 | 45 | */ |
duke@1 | 46 | typedef sequence<POA> POAList; |
duke@1 | 47 | |
duke@1 | 48 | /** |
duke@1 | 49 | * Values of type Servant support a language specific |
duke@1 | 50 | * programming interface that can be used by the ORB to |
duke@1 | 51 | * obtain a default POA for that servant. |
duke@1 | 52 | * Some language mappings may allow Servant values to |
duke@1 | 53 | * be implicitly converted to object references under |
duke@1 | 54 | * appropriate conditions. |
duke@1 | 55 | */ |
duke@1 | 56 | native Servant; |
duke@1 | 57 | |
duke@1 | 58 | /** |
duke@1 | 59 | * ObjectId value associated with the object reference. |
duke@1 | 60 | */ |
duke@1 | 61 | typedef sequence<octet> ObjectId; |
duke@1 | 62 | |
duke@1 | 63 | /** |
duke@1 | 64 | * ForwardRequest to indicate to the ORB |
duke@1 | 65 | * that it is responsible for delivering |
duke@1 | 66 | * the current request and subsequent |
duke@1 | 67 | * requests to the object denoted in the |
duke@1 | 68 | * forward_reference member of the exception. |
duke@1 | 69 | */ |
duke@1 | 70 | exception ForwardRequest { Object forward_reference; }; |
duke@1 | 71 | |
duke@1 | 72 | // ********************************************** |
duke@1 | 73 | // |
duke@1 | 74 | // Policy interfaces |
duke@1 | 75 | // |
duke@1 | 76 | // ********************************************** |
duke@1 | 77 | |
duke@1 | 78 | /** |
duke@1 | 79 | * The value representing THREAD_POLICY_ID. |
duke@1 | 80 | */ |
duke@1 | 81 | const CORBA::PolicyType THREAD_POLICY_ID = 16; |
duke@1 | 82 | /** |
duke@1 | 83 | * The value representing LIFESPAN_POLICY_ID. |
duke@1 | 84 | */ |
duke@1 | 85 | const CORBA::PolicyType LIFESPAN_POLICY_ID = 17; |
duke@1 | 86 | /** |
duke@1 | 87 | * The value representing ID_UNIQUENESS_POLICY_ID. |
duke@1 | 88 | */ |
duke@1 | 89 | const CORBA::PolicyType ID_UNIQUENESS_POLICY_ID = 18; |
duke@1 | 90 | /** |
duke@1 | 91 | * The value representing ID_ASSIGNMENT_POLICY_ID. |
duke@1 | 92 | */ |
duke@1 | 93 | const CORBA::PolicyType ID_ASSIGNMENT_POLICY_ID = 19; |
duke@1 | 94 | /** |
duke@1 | 95 | * The value representing IMPLICIT_ACTIVATION_POLICY_ID. |
duke@1 | 96 | */ |
duke@1 | 97 | const CORBA::PolicyType IMPLICIT_ACTIVATION_POLICY_ID = 20; |
duke@1 | 98 | /** |
duke@1 | 99 | * The value representing SERVANT_RETENTION_POLICY_ID. |
duke@1 | 100 | */ |
duke@1 | 101 | const CORBA::PolicyType SERVANT_RETENTION_POLICY_ID = 21; |
duke@1 | 102 | /** |
duke@1 | 103 | * The value representing REQUEST_PROCESSING_POLICY_ID. |
duke@1 | 104 | */ |
duke@1 | 105 | const CORBA::PolicyType REQUEST_PROCESSING_POLICY_ID = 22; |
duke@1 | 106 | |
duke@1 | 107 | /** |
duke@1 | 108 | * The ThreadPolicyValue can have the following values. |
duke@1 | 109 | * ORB_CTRL_MODEL - The ORB is responsible for assigning |
duke@1 | 110 | * requests for an ORB- controlled POA to threads. |
duke@1 | 111 | * SINGLE_THREAD_MODEL - Requests for a single-threaded |
duke@1 | 112 | * POA are processed sequentially. |
duke@1 | 113 | */ |
duke@1 | 114 | enum ThreadPolicyValue { ORB_CTRL_MODEL, SINGLE_THREAD_MODEL }; |
duke@1 | 115 | |
duke@1 | 116 | /** |
duke@1 | 117 | * The ThreadPolicy specifies the threading model |
duke@1 | 118 | * used with the created POA. The default is |
duke@1 | 119 | * ORB_CTRL_MODEL. |
duke@1 | 120 | */ |
duke@1 | 121 | interface ThreadPolicy : CORBA::Policy { |
duke@1 | 122 | #pragma sun_local ThreadPolicy "" |
duke@1 | 123 | /** |
duke@1 | 124 | * specifies the policy value |
duke@1 | 125 | */ |
duke@1 | 126 | readonly attribute ThreadPolicyValue value; |
duke@1 | 127 | }; |
duke@1 | 128 | |
duke@1 | 129 | /** |
duke@1 | 130 | * The LifespanPolicyValue can have the following values. |
duke@1 | 131 | * TRANSIENT - The objects implemented in the POA |
duke@1 | 132 | * cannot outlive the POA instance in which they are |
duke@1 | 133 | * first created. |
duke@1 | 134 | * PERSISTENT - The objects implemented in the POA can |
duke@1 | 135 | * outlive the process in which they are first created. |
duke@1 | 136 | */ |
duke@1 | 137 | enum LifespanPolicyValue { TRANSIENT, PERSISTENT }; |
duke@1 | 138 | |
duke@1 | 139 | /** |
duke@1 | 140 | * The LifespanPolicy specifies the lifespan of the |
duke@1 | 141 | * objects implemented in the created POA. The default |
duke@1 | 142 | * is TRANSIENT. |
duke@1 | 143 | */ |
duke@1 | 144 | interface LifespanPolicy : CORBA::Policy { |
duke@1 | 145 | #pragma sun_local LifespanPolicy "" |
duke@1 | 146 | /** |
duke@1 | 147 | * specifies the policy value |
duke@1 | 148 | */ |
duke@1 | 149 | readonly attribute LifespanPolicyValue value; |
duke@1 | 150 | }; |
duke@1 | 151 | |
duke@1 | 152 | /** |
duke@1 | 153 | * IdUniquenessPolicyValue can have the following values. |
duke@1 | 154 | * UNIQUE_ID - Servants activated with that POA support |
duke@1 | 155 | * exactly one Object Id. MULTIPLE_ID - a servant |
duke@1 | 156 | * activated with that POA may support one or more |
duke@1 | 157 | * Object Ids. |
duke@1 | 158 | */ |
duke@1 | 159 | enum IdUniquenessPolicyValue { UNIQUE_ID, MULTIPLE_ID }; |
duke@1 | 160 | |
duke@1 | 161 | /** |
duke@1 | 162 | * The IdUniquenessPolicy specifies whether the servants |
duke@1 | 163 | * activated in the created POA must have unique object i |
duke@1 | 164 | * identities. The default is UNIQUE_ID. |
duke@1 | 165 | */ |
duke@1 | 166 | interface IdUniquenessPolicy : CORBA::Policy { |
duke@1 | 167 | #pragma sun_local IdUniquenessPolicy "" |
duke@1 | 168 | /** |
duke@1 | 169 | * specifies the policy value |
duke@1 | 170 | */ |
duke@1 | 171 | readonly attribute IdUniquenessPolicyValue value; |
duke@1 | 172 | }; |
duke@1 | 173 | |
duke@1 | 174 | /** |
duke@1 | 175 | * The IdAssignmentPolicyValue can have the following |
duke@1 | 176 | * values. USER_ID - Objects created with that POA are |
duke@1 | 177 | * assigned Object Ids only by the application. |
duke@1 | 178 | * SYSTEM_ID - Objects created with that POA are |
duke@1 | 179 | * assigned Object Ids only by the POA. If the POA also |
duke@1 | 180 | * has the PERSISTENT policy, assigned Object Ids must |
duke@1 | 181 | * be unique across all instantiations of the same POA. |
duke@1 | 182 | */ |
duke@1 | 183 | enum IdAssignmentPolicyValue { USER_ID, SYSTEM_ID }; |
duke@1 | 184 | |
duke@1 | 185 | /** |
duke@1 | 186 | * IdAssignmentPolicy specifies whether Object Ids in |
duke@1 | 187 | * the created POA are generated by the application or |
duke@1 | 188 | * by the ORB. The default is SYSTEM_ID. |
duke@1 | 189 | */ |
duke@1 | 190 | interface IdAssignmentPolicy : CORBA::Policy { |
duke@1 | 191 | #pragma sun_local IdAssignmentPolicy "" |
duke@1 | 192 | /** |
duke@1 | 193 | * specifies the policy value |
duke@1 | 194 | */ |
duke@1 | 195 | readonly attribute IdAssignmentPolicyValue value; |
duke@1 | 196 | }; |
duke@1 | 197 | |
duke@1 | 198 | /** |
duke@1 | 199 | * ImplicitActivationPolicyValue has the following |
duke@1 | 200 | * semantics. |
duke@1 | 201 | * IMPLICIT_ACTIVATION to indicate implicit activation |
duke@1 | 202 | * of servants. This requires SYSTEM_ID and RETAIN |
duke@1 | 203 | * policies to be set. |
duke@1 | 204 | * NO_IMPLICIT_ACTIVATION to indicate no implicit |
duke@1 | 205 | * servant activation. |
duke@1 | 206 | */ |
duke@1 | 207 | enum ImplicitActivationPolicyValue { |
duke@1 | 208 | IMPLICIT_ACTIVATION, NO_IMPLICIT_ACTIVATION |
duke@1 | 209 | }; |
duke@1 | 210 | |
duke@1 | 211 | /** |
duke@1 | 212 | * This policy specifies whether implicit activation |
duke@1 | 213 | * of servants is supported in the created POA. |
duke@1 | 214 | */ |
duke@1 | 215 | interface ImplicitActivationPolicy : CORBA::Policy { |
duke@1 | 216 | #pragma sun_local ImplicitActivationPolicy "" |
duke@1 | 217 | /** |
duke@1 | 218 | * specifies the policy value |
duke@1 | 219 | */ |
duke@1 | 220 | readonly attribute ImplicitActivationPolicyValue value; |
duke@1 | 221 | }; |
duke@1 | 222 | |
duke@1 | 223 | /** |
duke@1 | 224 | * ServantRetentionPolicyValue can have the following |
duke@1 | 225 | * values. RETAIN - to indicate that the POA will retain |
duke@1 | 226 | * active servants in its Active Object Map. |
duke@1 | 227 | * NON_RETAIN - to indicate Servants are not retained by |
duke@1 | 228 | * the POA. If no ServantRetentionPolicy is specified at |
duke@1 | 229 | * POA creation, the default is RETAIN. |
duke@1 | 230 | */ |
duke@1 | 231 | enum ServantRetentionPolicyValue { RETAIN, NON_RETAIN }; |
duke@1 | 232 | |
duke@1 | 233 | /** |
duke@1 | 234 | * This policy specifies whether the created POA retains |
duke@1 | 235 | * active servants in an Active Object Map. |
duke@1 | 236 | */ |
duke@1 | 237 | interface ServantRetentionPolicy : CORBA::Policy { |
duke@1 | 238 | #pragma sun_local ServantRetentionPolicy "" |
duke@1 | 239 | /** |
duke@1 | 240 | * specifies the policy value |
duke@1 | 241 | */ |
duke@1 | 242 | readonly attribute ServantRetentionPolicyValue value; |
duke@1 | 243 | }; |
duke@1 | 244 | |
duke@1 | 245 | /** |
duke@1 | 246 | * The RequestProcessingPolicyValue can have the following |
duke@1 | 247 | * values. USE_ACTIVE_OBJECT_MAP_ONLY - If the Object Id |
duke@1 | 248 | * is not found in the Active Object Map, |
duke@1 | 249 | * an OBJECT_NOT_EXIST exception is returned to the |
duke@1 | 250 | * client. The RETAIN policy is also required. |
duke@1 | 251 | * USE_DEFAULT_SERVANT - If the Object Id is not found in |
duke@1 | 252 | * the Active Object Map or the NON_RETAIN policy is |
duke@1 | 253 | * present, and a default servant has been registered |
duke@1 | 254 | * with the POA using the set_servant operation, |
duke@1 | 255 | * the request is dispatched to the default servant. |
duke@1 | 256 | * USE_SERVANT_MANAGER - If the Object Id is not found |
duke@1 | 257 | * in the Active Object Map or the NON_RETAIN policy |
duke@1 | 258 | * is present, and a servant manager has been registered |
duke@1 | 259 | * with the POA using the set_servant_manager operation, |
duke@1 | 260 | * the servant manager is given the opportunity to |
duke@1 | 261 | * locate a servant or raise an exception. |
duke@1 | 262 | */ |
duke@1 | 263 | enum RequestProcessingPolicyValue { |
duke@1 | 264 | USE_ACTIVE_OBJECT_MAP_ONLY, USE_DEFAULT_SERVANT, USE_SERVANT_MANAGER |
duke@1 | 265 | }; |
duke@1 | 266 | |
duke@1 | 267 | /** |
duke@1 | 268 | * This policy specifies how requests are processed by |
duke@1 | 269 | * the created POA. The default is |
duke@1 | 270 | * USE_ACTIVE_OBJECT_MAP_ONLY. |
duke@1 | 271 | */ |
duke@1 | 272 | interface RequestProcessingPolicy : CORBA::Policy { |
duke@1 | 273 | #pragma sun_local RequestProcessingPolicy "" |
duke@1 | 274 | /** |
duke@1 | 275 | * specifies the policy value |
duke@1 | 276 | */ |
duke@1 | 277 | readonly attribute RequestProcessingPolicyValue value; |
duke@1 | 278 | }; |
duke@1 | 279 | |
duke@1 | 280 | |
duke@1 | 281 | // ************************************************** |
duke@1 | 282 | // |
duke@1 | 283 | // POAManager interface |
duke@1 | 284 | // |
duke@1 | 285 | // ********************************** |
duke@1 | 286 | /** |
duke@1 | 287 | * Each POA object has an associated POAManager object. |
duke@1 | 288 | * A POA manager may be associated with one or more |
duke@1 | 289 | * POA objects. A POA manager encapsulates the processing |
duke@1 | 290 | * state of the POAs it is associated with. |
duke@1 | 291 | */ |
duke@1 | 292 | interface POAManager { |
duke@1 | 293 | #pragma sun_local POAManager "" |
duke@1 | 294 | exception AdapterInactive{ }; |
duke@1 | 295 | /** |
duke@1 | 296 | * Specifies the states for the POAManager |
duke@1 | 297 | */ |
duke@1 | 298 | enum State {HOLDING, ACTIVE, DISCARDING, INACTIVE}; |
duke@1 | 299 | |
duke@1 | 300 | /** |
duke@1 | 301 | * This operation changes the state of the POA manager |
duke@1 | 302 | * to active, causing associated POAs to start processing |
duke@1 | 303 | * requests. |
duke@1 | 304 | * @exception AdapterInactive is raised if the operation is |
duke@1 | 305 | * invoked on the POAManager in inactive state. |
duke@1 | 306 | */ |
duke@1 | 307 | void activate() |
duke@1 | 308 | raises(AdapterInactive); |
duke@1 | 309 | /** |
duke@1 | 310 | * This operation changes the state of the POA manager |
duke@1 | 311 | * to holding, causing associated POAs to queue incoming |
duke@1 | 312 | * requests. |
duke@1 | 313 | * @param wait_for_completion if FALSE, the operation |
duke@1 | 314 | * returns immediately after changing state. |
duke@1 | 315 | * If TRUE, it waits for all active requests |
duke@1 | 316 | * to complete. |
duke@1 | 317 | * @exception AdapterInactive is raised if the operation is |
duke@1 | 318 | * invoked on the POAManager in inactive state. |
duke@1 | 319 | */ |
duke@1 | 320 | void hold_requests(in boolean wait_for_completion) |
duke@1 | 321 | raises(AdapterInactive); |
duke@1 | 322 | /** |
duke@1 | 323 | * This operation changes the state of the POA manager |
duke@1 | 324 | * to discarding. This causes associated POAs to discard |
duke@1 | 325 | * incoming requests. |
duke@1 | 326 | * @param wait_for_completion if FALSE, the operation |
duke@1 | 327 | * returns immediately after changing state. |
duke@1 | 328 | * If TRUE, it waits for all active requests |
duke@1 | 329 | * to complete. |
duke@1 | 330 | * @exception AdapterInactive is raised if the operation is |
duke@1 | 331 | * invoked on the POAManager in inactive state. |
duke@1 | 332 | */ |
duke@1 | 333 | void discard_requests(in boolean wait_for_completion) |
duke@1 | 334 | raises(AdapterInactive); |
duke@1 | 335 | |
duke@1 | 336 | /** |
duke@1 | 337 | * This operation changes the state of the POA manager |
duke@1 | 338 | * to inactive, causing associated POAs to reject the |
duke@1 | 339 | * requests that have not begun executing as well as |
duke@1 | 340 | * as any new requests. |
duke@1 | 341 | * @param etherealize_objects a flag to indicate whether |
duke@1 | 342 | * to invoke the etherealize operation of the |
duke@1 | 343 | * associated servant manager for all active |
duke@1 | 344 | * objects. |
duke@1 | 345 | * @param wait_for_completion if FALSE, the operation |
duke@1 | 346 | * returns immediately after changing state. |
duke@1 | 347 | * If TRUE, it waits for all active requests |
duke@1 | 348 | * to complete. |
duke@1 | 349 | * @exception AdapterInactive is raised if the operation is |
duke@1 | 350 | * invoked on the POAManager in inactive state. |
duke@1 | 351 | */ |
duke@1 | 352 | void deactivate(in boolean etherealize_objects, |
duke@1 | 353 | in boolean wait_for_completion) |
duke@1 | 354 | raises(AdapterInactive); |
duke@1 | 355 | /** |
duke@1 | 356 | * This operation returns the state of the POA manager. |
duke@1 | 357 | */ |
duke@1 | 358 | State get_state(); |
duke@1 | 359 | }; |
duke@1 | 360 | |
duke@1 | 361 | |
duke@1 | 362 | // ************************************************** |
duke@1 | 363 | // |
duke@1 | 364 | // AdapterActivator interface |
duke@1 | 365 | // |
duke@1 | 366 | // **************************** |
duke@1 | 367 | |
duke@1 | 368 | /** |
duke@1 | 369 | * An adapter activator supplies a POA with the ability |
duke@1 | 370 | * to create child POAs on demand, as a side-effect of |
duke@1 | 371 | * receiving a request that names the child POA |
duke@1 | 372 | * (or one of its children), or when find_POA is called |
duke@1 | 373 | * with an activate parameter value of TRUE. |
duke@1 | 374 | */ |
duke@1 | 375 | |
duke@1 | 376 | interface AdapterActivator { |
duke@1 | 377 | #pragma sun_local AdapterActivator "" |
duke@1 | 378 | #pragma version AdapterActivator 2.3 |
duke@1 | 379 | /** |
duke@1 | 380 | * This operation is invoked when the ORB receives |
duke@1 | 381 | * a request for an object reference that identifies |
duke@1 | 382 | * a target POA that does not exist. The ORB invokes |
duke@1 | 383 | * this operation once for each POA that must be |
duke@1 | 384 | * created in order for the target POA to exist. |
duke@1 | 385 | * @param parent indicates the parent POA for the POA |
duke@1 | 386 | * that needs to be created. |
duke@1 | 387 | * @param name identifies the name of the POA relative to |
duke@1 | 388 | * the parent. |
duke@1 | 389 | * @return returns TRUE if the POA was created or FALSE |
duke@1 | 390 | * otherwise. |
duke@1 | 391 | */ |
duke@1 | 392 | boolean unknown_adapter(in POA parent, in string name); |
duke@1 | 393 | }; |
duke@1 | 394 | |
duke@1 | 395 | |
duke@1 | 396 | // ************************************************** |
duke@1 | 397 | // |
duke@1 | 398 | // ServantManager interface |
duke@1 | 399 | // |
duke@1 | 400 | // ****************************** |
duke@1 | 401 | |
duke@1 | 402 | /** |
duke@1 | 403 | * A servant manager supplies a POA with the ability |
duke@1 | 404 | * to activate objects on demand when the POA receives |
duke@1 | 405 | * a request targeted at an inactive object. A servant |
duke@1 | 406 | * manager is registered with a POA as a callback object, |
duke@1 | 407 | * to be invoked by the POA when necessary. |
duke@1 | 408 | * ServantManagers can either be ServantActivators or |
duke@1 | 409 | * ServantLocators. A ServantManager object must be |
duke@1 | 410 | * local to the process containing the POA objects |
duke@1 | 411 | * it is registered with. |
duke@1 | 412 | */ |
duke@1 | 413 | |
duke@1 | 414 | interface ServantManager |
duke@1 | 415 | { #pragma sun_local ServantManager "" }; |
duke@1 | 416 | |
duke@1 | 417 | |
duke@1 | 418 | /** |
duke@1 | 419 | * When the POA has the RETAIN policy it uses servant |
duke@1 | 420 | * managers that are ServantActivators. |
duke@1 | 421 | */ |
duke@1 | 422 | interface ServantActivator : ServantManager { |
duke@1 | 423 | #pragma version ServantActivator 2.3 |
duke@1 | 424 | #pragma sun_localservant ServantActivator "" |
duke@1 | 425 | /** |
duke@1 | 426 | * This operation is invoked by the POA whenever the |
duke@1 | 427 | * POA receives a request for an object that is not |
duke@1 | 428 | * currently active, assuming the POA has the |
duke@1 | 429 | * USE_SERVANT_MANAGER and RETAIN policies. |
duke@1 | 430 | * @param oid object Id associated with the object on |
duke@1 | 431 | * the request was made. |
duke@1 | 432 | * @param adapter object reference for the POA in which |
duke@1 | 433 | * the object is being activated. |
duke@1 | 434 | * @return Servant corresponding to oid is created or |
duke@1 | 435 | * located by the user supplied servant manager. |
duke@1 | 436 | * @exception ForwardRequest to indicate to the ORB |
duke@1 | 437 | * that it is responsible for delivering |
duke@1 | 438 | * the current request and subsequent |
duke@1 | 439 | * requests to the object denoted in the |
duke@1 | 440 | * forward_reference member of the exception. |
duke@1 | 441 | */ |
duke@1 | 442 | Servant incarnate ( in ObjectId oid, in POA adapter ) |
duke@1 | 443 | raises (ForwardRequest); |
duke@1 | 444 | /** |
duke@1 | 445 | * This operation is invoked whenever a servant for |
duke@1 | 446 | * an object is deactivated, assuming the POA has |
duke@1 | 447 | * the USE_SERVANT_MANAGER and RETAIN policies. |
duke@1 | 448 | * @param oid object Id associated with the object |
duke@1 | 449 | * being deactivated. |
duke@1 | 450 | * @param adapter object reference for the POA in which |
duke@1 | 451 | * the object was active. |
duke@1 | 452 | * @param serv contains reference to the servant |
duke@1 | 453 | * associated with the object being deactivated. |
duke@1 | 454 | * @param cleanup_in_progress if TRUE indicates that |
duke@1 | 455 | * destroy or deactivate is called with |
duke@1 | 456 | * etherealize_objects param of TRUE. FALSE |
duke@1 | 457 | * indicates that etherealize was called due to |
duke@1 | 458 | * other reasons. |
duke@1 | 459 | * @param remaining_activations indicates whether the |
duke@1 | 460 | * Servant Manager can destroy a servant. If |
duke@1 | 461 | * set to TRUE, the Servant Manager should wait |
duke@1 | 462 | * until all invocations in progress have |
duke@1 | 463 | * completed. |
duke@1 | 464 | */ |
duke@1 | 465 | void etherealize ( in ObjectId oid, |
duke@1 | 466 | in POA adapter, |
duke@1 | 467 | in Servant serv, |
duke@1 | 468 | in boolean cleanup_in_progress, |
duke@1 | 469 | in boolean remaining_activations); |
duke@1 | 470 | }; |
duke@1 | 471 | |
duke@1 | 472 | |
duke@1 | 473 | /** |
duke@1 | 474 | * When the POA has the NON_RETAIN policy it uses servant |
duke@1 | 475 | * managers that are ServantLocators. Because the POA |
duke@1 | 476 | * knows that the servant returned by this servant |
duke@1 | 477 | * manager will be used only for a single request, |
duke@1 | 478 | * it can supply extra information to the servant |
duke@1 | 479 | * manager's operations and the servant manager's pair |
duke@1 | 480 | * of operations may be able to cooperate to do |
duke@1 | 481 | * something different than a ServantActivator. |
duke@1 | 482 | * When the POA uses the ServantLocator interface, |
duke@1 | 483 | * immediately after performing the operation invocation |
duke@1 | 484 | * on the servant returned by preinvoke, the POA will |
duke@1 | 485 | * invoke postinvoke on the servant manager, passing the |
duke@1 | 486 | * ObjectId value and the Servant value as parameters |
duke@1 | 487 | * (among others). This feature may be used to force |
duke@1 | 488 | * every request for objects associated with a POA to |
duke@1 | 489 | * be mediated by the servant manager. |
duke@1 | 490 | */ |
duke@1 | 491 | interface ServantLocator : ServantManager { |
duke@1 | 492 | #pragma sun_localservant ServantLocator "" |
duke@1 | 493 | /** |
duke@1 | 494 | * Opaque data used to pass the information from |
duke@1 | 495 | * preinvoke to postinvoke hooks. This specific |
duke@1 | 496 | * by the language mapping, that is why it is |
duke@1 | 497 | * specified as native. |
duke@1 | 498 | */ |
duke@1 | 499 | native Cookie; |
duke@1 | 500 | /** |
duke@1 | 501 | * This operations is used to get a servant that will be |
duke@1 | 502 | * used to process the request that caused preinvoke to |
duke@1 | 503 | * be called. |
duke@1 | 504 | * @param oid the object id associated with object on |
duke@1 | 505 | * which the request was made. |
duke@1 | 506 | * @param adapter the reference for POA in which the |
duke@1 | 507 | * object is being activated. |
duke@1 | 508 | * @param operation the operation name. |
duke@1 | 509 | * @param the_cookie an opaque value that can be set |
duke@1 | 510 | * by the servant manager to be used |
duke@1 | 511 | * during postinvoke. |
duke@1 | 512 | * @return Servant used to process incoming request. |
duke@1 | 513 | * @exception ForwardRequest to indicate to the ORB |
duke@1 | 514 | * that it is responsible for delivering |
duke@1 | 515 | * the current request and subsequent |
duke@1 | 516 | * requests to the object denoted in the |
duke@1 | 517 | * forward_reference member of the exception. |
duke@1 | 518 | */ |
duke@1 | 519 | Servant preinvoke( in ObjectId oid, in POA adapter, |
duke@1 | 520 | in CORBA::Identifier operation, |
duke@1 | 521 | out Cookie the_cookie ) |
duke@1 | 522 | raises (ForwardRequest); |
duke@1 | 523 | /** |
duke@1 | 524 | * This operation is invoked whenener a servant completes |
duke@1 | 525 | * a request. |
duke@1 | 526 | * @param oid the object id ssociated with object on which |
duke@1 | 527 | * the request was made. |
duke@1 | 528 | * @param adapter the reference for POA in which the |
duke@1 | 529 | * object was active. |
duke@1 | 530 | * @param the_cookie an opaque value that contains |
duke@1 | 531 | * the data set by preinvoke. |
duke@1 | 532 | * @param the_servant reference to the servant that is |
duke@1 | 533 | * associated with the object. |
duke@1 | 534 | */ |
duke@1 | 535 | void postinvoke( in ObjectId oid, in POA adapter, |
duke@1 | 536 | in CORBA::Identifier operation, |
duke@1 | 537 | in Cookie the_cookie, |
duke@1 | 538 | in Servant the_servant); |
duke@1 | 539 | }; |
duke@1 | 540 | |
duke@1 | 541 | |
duke@1 | 542 | // ************************************************** |
duke@1 | 543 | // |
duke@1 | 544 | // POA interface |
duke@1 | 545 | // |
duke@1 | 546 | // ***************************************** |
duke@1 | 547 | |
duke@1 | 548 | /** |
duke@1 | 549 | * A POA object manages the implementation of a |
duke@1 | 550 | * collection of objects. The POA supports a name space |
duke@1 | 551 | * for the objects, which are identified by Object Ids. |
duke@1 | 552 | * A POA also provides a name space for POAs. A POA is |
duke@1 | 553 | * created as a child of an existing POA, which forms a |
duke@1 | 554 | * hierarchy starting with the root POA. A POA object |
duke@1 | 555 | * must not be exported to other processes, or |
duke@1 | 556 | * externalized with ORB::object_to_string. |
duke@1 | 557 | */ |
duke@1 | 558 | interface POA { |
duke@1 | 559 | #pragma sun_local POA "" |
duke@1 | 560 | #pragma version POA 2.3 |
duke@1 | 561 | /** |
duke@1 | 562 | * specifies that an child POA with the specified |
duke@1 | 563 | * name already exists. |
duke@1 | 564 | */ |
duke@1 | 565 | exception AdapterAlreadyExists { }; |
duke@1 | 566 | |
duke@1 | 567 | /** |
duke@1 | 568 | * This is raised if the POA with a specified Name cannot |
duke@1 | 569 | * be found. |
duke@1 | 570 | */ |
duke@1 | 571 | exception AdapterNonExistent { }; |
duke@1 | 572 | |
duke@1 | 573 | /** |
duke@1 | 574 | * This is raised if any of the policy objects are |
duke@1 | 575 | * not valid for the ORB |
duke@1 | 576 | */ |
duke@1 | 577 | exception InvalidPolicy { |
duke@1 | 578 | unsigned short index; |
duke@1 | 579 | }; |
duke@1 | 580 | |
duke@1 | 581 | /** |
duke@1 | 582 | * This is raised if no default servant is associated |
duke@1 | 583 | * with the POA. |
duke@1 | 584 | */ |
duke@1 | 585 | exception NoServant { }; |
duke@1 | 586 | |
duke@1 | 587 | /** |
duke@1 | 588 | * specifies that an object is already active or |
duke@1 | 589 | * exists in the Active Object Map. |
duke@1 | 590 | */ |
duke@1 | 591 | exception ObjectAlreadyActive { }; |
duke@1 | 592 | /** |
duke@1 | 593 | * specifies that the object is not active or its |
duke@1 | 594 | * mapping does not exist in the Active Object Map. |
duke@1 | 595 | */ |
duke@1 | 596 | |
duke@1 | 597 | exception ObjectNotActive { }; |
duke@1 | 598 | |
duke@1 | 599 | /** |
duke@1 | 600 | * This is raised when an attempt is made to activate |
duke@1 | 601 | * a servant that is already active or has a mapping in |
duke@1 | 602 | * the Active Object Map. |
duke@1 | 603 | */ |
duke@1 | 604 | exception ServantAlreadyActive { }; |
duke@1 | 605 | |
duke@1 | 606 | /** |
duke@1 | 607 | * This is raised when an attempt is made to access a |
duke@1 | 608 | * servant that is not active or is not registered in |
duke@1 | 609 | * the Active Object Map. |
duke@1 | 610 | */ |
duke@1 | 611 | exception ServantNotActive { }; |
duke@1 | 612 | |
duke@1 | 613 | /** |
duke@1 | 614 | * This is raised if the reference was not created by |
duke@1 | 615 | * the POA |
duke@1 | 616 | * specified in the reference. |
duke@1 | 617 | */ |
duke@1 | 618 | exception WrongAdapter { }; |
duke@1 | 619 | |
duke@1 | 620 | /** |
duke@1 | 621 | * WrongPolicy is specified when the POA does not |
duke@1 | 622 | * specify the policy appropriate for its operations. |
duke@1 | 623 | */ |
duke@1 | 624 | exception WrongPolicy { }; |
duke@1 | 625 | |
duke@1 | 626 | |
duke@1 | 627 | //---------------------------------------- |
duke@1 | 628 | // |
duke@1 | 629 | // POA creation and destruction |
duke@1 | 630 | // |
duke@1 | 631 | //------------------------------- |
duke@1 | 632 | |
duke@1 | 633 | /** |
duke@1 | 634 | * This operation creates a new POA as a child of the |
duke@1 | 635 | * target POA. |
duke@1 | 636 | * @param adapter_name identifies the new POA with |
duke@1 | 637 | * respect to other POAs with the same parent POA. |
duke@1 | 638 | * @param a_POAManager specifies the POA Manager to be |
duke@1 | 639 | * associated with the new POA. |
duke@1 | 640 | * @param policies specifies policy objects to be |
duke@1 | 641 | * associated with the POA to control its behavior. |
duke@1 | 642 | * @exception AdapterAlreadyExists specifies that the |
duke@1 | 643 | * target POA already has a child POA with |
duke@1 | 644 | * the specified name. |
duke@1 | 645 | * @exception InvalidPolicy is raised if any of the |
duke@1 | 646 | * policy objects are not valid for the ORB, |
duke@1 | 647 | * or are in conflict, or require an |
duke@1 | 648 | * administrative action that has not been |
duke@1 | 649 | * performed. |
duke@1 | 650 | */ |
duke@1 | 651 | POA create_POA(in string adapter_name, |
duke@1 | 652 | in POAManager a_POAManager, |
duke@1 | 653 | in CORBA::PolicyList policies) |
duke@1 | 654 | raises (AdapterAlreadyExists, InvalidPolicy); |
duke@1 | 655 | |
duke@1 | 656 | /** |
duke@1 | 657 | * If the target POA is the parent of a child POA with |
duke@1 | 658 | * the specified name (relative to the target POA), that |
duke@1 | 659 | * child POA is returned. |
duke@1 | 660 | * @param adapter_name POA name to be found. |
duke@1 | 661 | * @param activate_it if a POA with the specified |
duke@1 | 662 | * name does not exist and the value of |
duke@1 | 663 | * the activate_it parameter is TRUE, the target |
duke@1 | 664 | * POA's AdapterActivator, if one exists, |
duke@1 | 665 | * is invoked. |
duke@1 | 666 | * @return POA if one exists or is activated by the |
duke@1 | 667 | * AdapterActivator. |
duke@1 | 668 | * @return AdapterNonExistent is raised if POA with |
duke@1 | 669 | * a specified name cannot be found or |
duke@1 | 670 | * activated using AdapaterActivator. |
duke@1 | 671 | */ |
duke@1 | 672 | POA find_POA(in string adapter_name, |
duke@1 | 673 | in boolean activate_it) |
duke@1 | 674 | raises (AdapterNonExistent); |
duke@1 | 675 | |
duke@1 | 676 | /** |
duke@1 | 677 | * This operation destroys the POA and all descendant |
duke@1 | 678 | * POAs. All descendant POAs are destroyed (recursively) |
duke@1 | 679 | * before the destruction of the containing POA. The POA |
duke@1 | 680 | * so destroyed (that is, the POA with its name) may be |
duke@1 | 681 | * re-created later in the same process. |
duke@1 | 682 | * @param etherealize_objects flag to indicate whether |
duke@1 | 683 | * etherealize operation on servant manager needs |
duke@1 | 684 | * to be called. |
duke@1 | 685 | * @param wait_for_completion flag to indicate whether |
duke@1 | 686 | * POA and its children need to wait for active |
duke@1 | 687 | * requests and the etherealization to complete. |
duke@1 | 688 | * |
duke@1 | 689 | */ |
duke@1 | 690 | void destroy( in boolean etherealize_objects, |
duke@1 | 691 | in boolean wait_for_completion); |
duke@1 | 692 | |
duke@1 | 693 | // ************************************************** |
duke@1 | 694 | // |
duke@1 | 695 | // Factories for Policy objects |
duke@1 | 696 | // |
duke@1 | 697 | // ************ |
duke@1 | 698 | /** |
duke@1 | 699 | * These operations each return a reference to a policy |
duke@1 | 700 | * object with the specified value. |
duke@1 | 701 | * @param value policy type |
duke@1 | 702 | * @return ThreadPolcy Object |
duke@1 | 703 | */ |
duke@1 | 704 | ThreadPolicy create_thread_policy( |
duke@1 | 705 | in ThreadPolicyValue value); |
duke@1 | 706 | /** |
duke@1 | 707 | * These operations each return a reference to a policy |
duke@1 | 708 | * object with the specified value. |
duke@1 | 709 | * @param value policy type |
duke@1 | 710 | * @return LifespanPolicy Object. |
duke@1 | 711 | */ |
duke@1 | 712 | LifespanPolicy create_lifespan_policy( |
duke@1 | 713 | in LifespanPolicyValue value); |
duke@1 | 714 | /** |
duke@1 | 715 | * These operations each return a reference to a policy |
duke@1 | 716 | * object with the specified value. |
duke@1 | 717 | * @param value policy type |
duke@1 | 718 | * @return IdUniquenessPolicy Object. |
duke@1 | 719 | */ |
duke@1 | 720 | IdUniquenessPolicy create_id_uniqueness_policy( |
duke@1 | 721 | in IdUniquenessPolicyValue value); |
duke@1 | 722 | /** |
duke@1 | 723 | * These operations each return a reference to a policy |
duke@1 | 724 | * object with the specified value. |
duke@1 | 725 | * @param value policy type |
duke@1 | 726 | * @return IdAssignmentPolicy Object. |
duke@1 | 727 | */ |
duke@1 | 728 | IdAssignmentPolicy create_id_assignment_policy( |
duke@1 | 729 | in IdAssignmentPolicyValue value); |
duke@1 | 730 | /** |
duke@1 | 731 | * These operations each return a reference to a policy |
duke@1 | 732 | * object with the specified value. |
duke@1 | 733 | * @param value policy type |
duke@1 | 734 | * @return ImplicitActivationPolicy Object. |
duke@1 | 735 | */ |
duke@1 | 736 | ImplicitActivationPolicy create_implicit_activation_policy( |
duke@1 | 737 | in ImplicitActivationPolicyValue value); |
duke@1 | 738 | /** |
duke@1 | 739 | * These operations each return a reference to a policy |
duke@1 | 740 | * object with the specified value. |
duke@1 | 741 | * @param value policy type |
duke@1 | 742 | * @return ServantRetentionPolicy Object. |
duke@1 | 743 | */ |
duke@1 | 744 | ServantRetentionPolicy create_servant_retention_policy( |
duke@1 | 745 | in ServantRetentionPolicyValue value); |
duke@1 | 746 | /** |
duke@1 | 747 | * These operations each return a reference to a policy |
duke@1 | 748 | * object with the specified value. |
duke@1 | 749 | * @param value policy type |
duke@1 | 750 | * @return RequestProcessingPolicy Object. |
duke@1 | 751 | */ |
duke@1 | 752 | |
duke@1 | 753 | RequestProcessingPolicy create_request_processing_policy( |
duke@1 | 754 | in RequestProcessingPolicyValue value); |
duke@1 | 755 | |
duke@1 | 756 | //-------------------------------------------------- |
duke@1 | 757 | // |
duke@1 | 758 | // POA attributes |
duke@1 | 759 | // |
duke@1 | 760 | //----------------------------------- |
duke@1 | 761 | /** |
duke@1 | 762 | * This attribute identifies the POA relative to its |
duke@1 | 763 | * parent. This name is assigned when the POA is created. |
duke@1 | 764 | */ |
duke@1 | 765 | readonly attribute string the_name; |
duke@1 | 766 | /** |
duke@1 | 767 | * This attribute identifies the parent of the POA. |
duke@1 | 768 | * The parent of the root POA is null. |
duke@1 | 769 | */ |
duke@1 | 770 | readonly attribute POA the_parent; |
duke@1 | 771 | /** |
duke@1 | 772 | * This attribute identifies the current set of all |
duke@1 | 773 | * child POAs of the POA. The set of child POAs |
duke@1 | 774 | * includes only the POA's immediate children, and |
duke@1 | 775 | * not their descendants. |
duke@1 | 776 | */ |
duke@1 | 777 | readonly attribute POAList the_children; |
duke@1 | 778 | /** |
duke@1 | 779 | * This attribute identifies the POA manager |
duke@1 | 780 | * associated with the POA. |
duke@1 | 781 | */ |
duke@1 | 782 | readonly attribute POAManager the_POAManager; |
duke@1 | 783 | |
duke@1 | 784 | /** |
duke@1 | 785 | * This attribute identifies the adapter activator |
duke@1 | 786 | * associated with the POA. |
duke@1 | 787 | */ |
duke@1 | 788 | attribute AdapterActivator the_activator; |
duke@1 | 789 | |
duke@1 | 790 | //-------------------------------------------------- |
duke@1 | 791 | // |
duke@1 | 792 | // Servant Manager registration: |
duke@1 | 793 | // |
duke@1 | 794 | //-------------------------------------------------- |
duke@1 | 795 | /** |
duke@1 | 796 | * |
duke@1 | 797 | * If the ServantRetentionPolicy of the POA is RETAIN, |
duke@1 | 798 | * then the ServantManager argument (imgr) shall support |
duke@1 | 799 | * the ServantActivator interface. For a NON_RETAIN policy, |
duke@1 | 800 | * the ServantManager shall support the ServantLocator |
duke@1 | 801 | * interface. If the argument is nil, or does not support |
duke@1 | 802 | * the required interface, then the OBJ_ADAPTER |
duke@1 | 803 | * exception is raised. |
duke@1 | 804 | * @return ServantManager associated with a POA or null if |
duke@1 | 805 | * none exists. |
duke@1 | 806 | * @exception WrongPolicy raised if the |
duke@1 | 807 | * USE_SERVANT_MANAGER policy is not specified. |
duke@1 | 808 | */ |
duke@1 | 809 | ServantManager get_servant_manager() |
duke@1 | 810 | raises (WrongPolicy); |
duke@1 | 811 | /** |
duke@1 | 812 | * |
duke@1 | 813 | * This operation sets the default servant manager |
duke@1 | 814 | * associated with the POA. This operation may only be |
duke@1 | 815 | * invoked once after a POA has been created. Attempting |
duke@1 | 816 | * to set the servant manager after one has already |
duke@1 | 817 | * been set will result in the BAD_INV_ORDER exception |
duke@1 | 818 | * being raised. |
duke@1 | 819 | * @param imgr servant manager to be used as a default. |
duke@1 | 820 | * @exception WrongPolicy raised if the |
duke@1 | 821 | * USE_SERVANT_MANAGER policy is not specified. |
duke@1 | 822 | */ |
duke@1 | 823 | void set_servant_manager( in ServantManager imgr) |
duke@1 | 824 | raises (WrongPolicy); |
duke@1 | 825 | |
duke@1 | 826 | //-------------------------------------------------- |
duke@1 | 827 | // |
duke@1 | 828 | // operations for the USE_DEFAULT_SERVANT policy |
duke@1 | 829 | // |
duke@1 | 830 | //---------- |
duke@1 | 831 | /** |
duke@1 | 832 | * This operation returns the default servant associated |
duke@1 | 833 | * with the POA. |
duke@1 | 834 | * @return p_servant default servant associated with a POA. |
duke@1 | 835 | * @exception NoServant raised if no default servant is |
duke@1 | 836 | * associated with the POA. |
duke@1 | 837 | * @exception WrongPolicy raised if the |
duke@1 | 838 | * USE_DEFAULT_SERVANT policy is not specified. |
duke@1 | 839 | */ |
duke@1 | 840 | Servant get_servant() |
duke@1 | 841 | raises (NoServant, WrongPolicy); |
duke@1 | 842 | |
duke@1 | 843 | /** |
duke@1 | 844 | * |
duke@1 | 845 | * This operation registers the specified servant with |
duke@1 | 846 | * the POA as the default servant. This servant will |
duke@1 | 847 | * be used for all requests for which no servant is |
duke@1 | 848 | * found in the Active Object Map. |
duke@1 | 849 | * @param p_servant servant to be used as a default. |
duke@1 | 850 | * @exception WrongPolicy raised if the |
duke@1 | 851 | * USE_DEFAULT_SERVANT policy is not specified. |
duke@1 | 852 | */ |
duke@1 | 853 | void set_servant(in Servant p_servant) |
duke@1 | 854 | raises (WrongPolicy); |
duke@1 | 855 | |
duke@1 | 856 | // ************************************************** |
duke@1 | 857 | // |
duke@1 | 858 | // object activation and deactivation |
duke@1 | 859 | // |
duke@1 | 860 | // ************ |
duke@1 | 861 | |
duke@1 | 862 | /** |
duke@1 | 863 | * |
duke@1 | 864 | * This operation generates an Object Id and enters |
duke@1 | 865 | * the Object Id and the specified servant in the |
duke@1 | 866 | * Active Object Map. |
duke@1 | 867 | * @param p_servant servant to be associated with an |
duke@1 | 868 | * object to be activated. |
duke@1 | 869 | * @return POA generated object id. |
duke@1 | 870 | * @exception ServantAlreadyActive is raised if the |
duke@1 | 871 | * POA has UNIQUE_ID policy and servant is |
duke@1 | 872 | * is already in the Active Object Map. |
duke@1 | 873 | * @exception WrongPolicy raised if the SYSTEM_ID and |
duke@1 | 874 | * RETAIN policies are not specified. |
duke@1 | 875 | */ |
duke@1 | 876 | ObjectId activate_object( in Servant p_servant ) |
duke@1 | 877 | raises (ServantAlreadyActive, WrongPolicy); |
duke@1 | 878 | /** |
duke@1 | 879 | * This operation enters an association between the |
duke@1 | 880 | * specified Object Id and the specified servant in the |
duke@1 | 881 | * Active Object Map. |
duke@1 | 882 | * @param id object id for the object to be activated. |
duke@1 | 883 | * @param p_servant servant to be associated with the |
duke@1 | 884 | * object. |
duke@1 | 885 | * @exception ServantAlreadyActive raised if the POA |
duke@1 | 886 | * has the UNIQUE_ID policy and the servant |
duke@1 | 887 | * is already in the Active Object Map. |
duke@1 | 888 | * @exception ObjectAlreadyActive raised if the object is |
duke@1 | 889 | * already active in the POA. |
duke@1 | 890 | * @exception WrongPolicy raised if the RETAIN policy is |
duke@1 | 891 | * is not specified. |
duke@1 | 892 | */ |
duke@1 | 893 | |
duke@1 | 894 | void activate_object_with_id( in ObjectId id, |
duke@1 | 895 | in Servant p_servant) |
duke@1 | 896 | raises ( ServantAlreadyActive, ObjectAlreadyActive, |
duke@1 | 897 | WrongPolicy); |
duke@1 | 898 | /** |
duke@1 | 899 | * |
duke@1 | 900 | * This operation causes the ObjectId specified in the |
duke@1 | 901 | * oid parameter to be deactivated. An ObjectId which |
duke@1 | 902 | * has been deactivated continues to process requests |
duke@1 | 903 | * until there are no active requests for that ObjectId. |
duke@1 | 904 | * A deactivated ObjectId is removed from the Active |
duke@1 | 905 | * Object Map when all requests executing for that |
duke@1 | 906 | * ObjectId have completed. |
duke@1 | 907 | * @param oid Object Id for the object to be deactivated. |
duke@1 | 908 | * @exception ObjectNotActive if the object with the |
duke@1 | 909 | * specified oid is not in the Active Object |
duke@1 | 910 | * Map. |
duke@1 | 911 | * @exception WrongPolicy raised if the RETAIN policy is |
duke@1 | 912 | * is not specified. |
duke@1 | 913 | */ |
duke@1 | 914 | void deactivate_object(in ObjectId oid) |
duke@1 | 915 | raises (ObjectNotActive, WrongPolicy); |
duke@1 | 916 | |
duke@1 | 917 | // ************************************************** |
duke@1 | 918 | // |
duke@1 | 919 | // reference creation operations |
duke@1 | 920 | // |
duke@1 | 921 | // ***************** |
duke@1 | 922 | /** |
duke@1 | 923 | * This operation creates an object reference that |
duke@1 | 924 | * encapsulates a POA-generated Object Id value and |
duke@1 | 925 | * the specified interface repository id. |
duke@1 | 926 | * |
duke@1 | 927 | * @param intf rep id for creating an object reference. |
duke@1 | 928 | * @return object reference created using intf. |
duke@1 | 929 | * @exception WrongPolicy if SYSTEM_ID policy is not |
duke@1 | 930 | * specified. |
duke@1 | 931 | */ |
duke@1 | 932 | Object create_reference ( in CORBA::RepositoryId intf ) |
duke@1 | 933 | raises (WrongPolicy); |
duke@1 | 934 | |
duke@1 | 935 | /** |
duke@1 | 936 | * This operation creates an object reference that |
duke@1 | 937 | * encapsulates the specified Object Id and interface |
duke@1 | 938 | * repository Id values. It does not cause an activation |
duke@1 | 939 | * to take place. The resulting reference may be passed |
duke@1 | 940 | * to clients, so that subsequent requests on those |
duke@1 | 941 | * references will cause the object to be activated |
duke@1 | 942 | * if necessary, or the default servant used, depending |
duke@1 | 943 | * on the applicable policies. |
duke@1 | 944 | * @param oid object id for creating an objref |
duke@1 | 945 | * @param intf rep id for creating an objref |
duke@1 | 946 | * @return object reference created using oid and intf |
duke@1 | 947 | * @exception BAD_PARAM is raised if the POA has the |
duke@1 | 948 | * SYSTEM_ID policy and it detects that the |
duke@1 | 949 | * Object Id value was not generated by the |
duke@1 | 950 | * system or for this POA. |
duke@1 | 951 | */ |
duke@1 | 952 | Object create_reference_with_id ( in ObjectId oid, |
duke@1 | 953 | in CORBA::RepositoryId intf ); |
duke@1 | 954 | // not specified in 11.3.8.19 raises (WrongPolicy); |
duke@1 | 955 | |
duke@1 | 956 | //-------------------------------------------------- |
duke@1 | 957 | // |
duke@1 | 958 | // Identity mapping operations: |
duke@1 | 959 | // |
duke@1 | 960 | //-------------------------------------------------- |
duke@1 | 961 | /** |
duke@1 | 962 | * This operation has four possible behaviors. |
duke@1 | 963 | * 1. If the POA has the UNIQUE_ID policy and the |
duke@1 | 964 | * specified servant is active, the Object Id associated |
duke@1 | 965 | * with that servant is returned. |
duke@1 | 966 | * 2. If the POA has the IMPLICIT_ACTIVATION policy and |
duke@1 | 967 | * either the POA has the MULTIPLE_ID policy or the |
duke@1 | 968 | * specified servant is not active, the servant is |
duke@1 | 969 | * activated using a POA-generated Object Id and the |
duke@1 | 970 | * Interface Id associated with the servant, and that |
duke@1 | 971 | * Object Id is returned. |
duke@1 | 972 | * 3. If the POA has the USE_DEFAULT_SERVANT policy, |
duke@1 | 973 | * the servant specified is the default servant, and the |
duke@1 | 974 | * operation is being invoked in the context of executing |
duke@1 | 975 | * a request on the default servant, then the ObjectId |
duke@1 | 976 | * associated with the current invocation is returned. |
duke@1 | 977 | * 4. Otherwise, the ServantNotActive exception is raised. |
duke@1 | 978 | * |
duke@1 | 979 | * @param p_servant servant for which the object disi returned. |
duke@1 | 980 | * @return object id associated with the servant. |
duke@1 | 981 | * @exception ServantNotActive if the above rules and |
duke@1 | 982 | * policy combination is not met. |
duke@1 | 983 | * @exception WrongPolicy if the USE_DEFAULT_SERVANT policy |
duke@1 | 984 | * or a combination of the RETAIN policy and |
duke@1 | 985 | * either the UNIQUE_ID or IMPLICIT_ACTIVATION |
duke@1 | 986 | * policies are not present. |
duke@1 | 987 | */ |
duke@1 | 988 | ObjectId servant_to_id(in Servant p_servant) |
duke@1 | 989 | raises (ServantNotActive, WrongPolicy); |
duke@1 | 990 | |
duke@1 | 991 | /** |
duke@1 | 992 | * This operation requires the RETAIN policy and either |
duke@1 | 993 | * the UNIQUE_ID or IMPLICIT_ACTIVATION policies if |
duke@1 | 994 | * invoked outside the context of an operation dispatched |
duke@1 | 995 | * by this POA. It has four possible behaviors. |
duke@1 | 996 | * 1. If the POA has both the RETAIN and the |
duke@1 | 997 | * UNIQUE_ID policy and the specified servant is active, |
duke@1 | 998 | * an object reference encapsulating the information used |
duke@1 | 999 | * to activate the servant is returned. |
duke@1 | 1000 | * 2. If the POA has both the RETAIN and the |
duke@1 | 1001 | * IMPLICIT_ACTIVATION policy and either the POA has the |
duke@1 | 1002 | * MULTIPLE_ID policy or the specified servant is not |
duke@1 | 1003 | * active, the servant is activated using a POA-generated |
duke@1 | 1004 | * Object Id and the Interface Id associated with the |
duke@1 | 1005 | * servant, and a corresponding object reference is |
duke@1 | 1006 | * returned. |
duke@1 | 1007 | * 3. If the operation was invoked in the context of |
duke@1 | 1008 | * executing a request on the specified servant, the |
duke@1 | 1009 | * reference associated with the current invocation |
duke@1 | 1010 | * is returned. |
duke@1 | 1011 | * 4. Otherwise, the ServantNotActive exception is raised. |
duke@1 | 1012 | * |
duke@1 | 1013 | * @param p_servant servant for which the object reference |
duke@1 | 1014 | * needs to be obtained. |
duke@1 | 1015 | * @return object reference associated with the servant. |
duke@1 | 1016 | * @exception WrongPolicy if the operation is not invoked |
duke@1 | 1017 | * in the context of executing a request on |
duke@1 | 1018 | * the specified servant and the required |
duke@1 | 1019 | * policies are not present. |
duke@1 | 1020 | * @exception ServantNotActive if the above specified |
duke@1 | 1021 | * policies and rules are not met. |
duke@1 | 1022 | */ |
duke@1 | 1023 | Object servant_to_reference(in Servant p_servant) |
duke@1 | 1024 | raises (ServantNotActive, WrongPolicy); |
duke@1 | 1025 | |
duke@1 | 1026 | /** |
duke@1 | 1027 | * If the POA has the RETAIN policy and the specified |
duke@1 | 1028 | * object is present in the Active Object Map, this |
duke@1 | 1029 | * operation returns the servant associated with that |
duke@1 | 1030 | * object in the Active Object Map. Otherwise, if the |
duke@1 | 1031 | * POA has the USE_DEFAULT_SERVANT policy and a default |
duke@1 | 1032 | * servant has been registered with the POA, this |
duke@1 | 1033 | * operation returns the default servant. If the object |
duke@1 | 1034 | * reference was not created by this POA, |
duke@1 | 1035 | * the WrongAdapter exception is raised. (OMG Issue |
duke@1 | 1036 | * on inconsistency with the POA.IDL. |
duke@1 | 1037 | * |
duke@1 | 1038 | * @param reference object reference for which the |
duke@1 | 1039 | * servant is returned. |
duke@1 | 1040 | * @return servant associated with the reference. |
duke@1 | 1041 | * @exception WrongPolicy if neither the RETAIN policy or |
duke@1 | 1042 | * the USE_DEFAULT_SERVANT policy is present. |
duke@1 | 1043 | * @exception ObjectNotActive if the servant is not |
duke@1 | 1044 | * present in the Active Object Map (for RETAIN) |
duke@1 | 1045 | * or no default servant is registered (for |
duke@1 | 1046 | * USE_DEFAULT_POLICY). |
duke@1 | 1047 | * @exception WrongAdapter if reference was not created by |
duke@1 | 1048 | * this POA instance. |
duke@1 | 1049 | */ |
duke@1 | 1050 | Servant reference_to_servant(in Object reference) |
duke@1 | 1051 | raises (ObjectNotActive, WrongPolicy, WrongAdapter); |
duke@1 | 1052 | |
duke@1 | 1053 | /** |
duke@1 | 1054 | * This operation returns the Object Id value |
duke@1 | 1055 | * encapsulated by the specified reference. This |
duke@1 | 1056 | * operation is valid only if the reference was created |
duke@1 | 1057 | * by the POA on which the operation is being performed. |
duke@1 | 1058 | * The object denoted by the reference does not have |
duke@1 | 1059 | * to be active for this operation to succeed. |
duke@1 | 1060 | * |
duke@1 | 1061 | * @param reference the object reference from which the |
duke@1 | 1062 | * object id needs to be returned. |
duke@1 | 1063 | * @return object id encapsulated in the reference. |
duke@1 | 1064 | * @exception WrongAdapter if the reference was not |
duke@1 | 1065 | * created by the POA specified in the |
duke@1 | 1066 | * reference. |
duke@1 | 1067 | * @exception WrongPolicy declared to allow future |
duke@1 | 1068 | * extensions. |
duke@1 | 1069 | * |
duke@1 | 1070 | */ |
duke@1 | 1071 | ObjectId reference_to_id(in Object reference) |
duke@1 | 1072 | raises (WrongAdapter, WrongPolicy); |
duke@1 | 1073 | |
duke@1 | 1074 | /** |
duke@1 | 1075 | * If the POA has the RETAIN policy and the specified |
duke@1 | 1076 | * ObjectId is in the Active Object Map, this operation |
duke@1 | 1077 | * returns the servant associated with that object in |
duke@1 | 1078 | * the Active Object Map. Otherwise, if the POA has |
duke@1 | 1079 | * the USE_DEFAULT_SERVANT policy and a default servant |
duke@1 | 1080 | * has been registered with the POA, this operation |
duke@1 | 1081 | * returns the default servant. |
duke@1 | 1082 | * |
duke@1 | 1083 | * @param oid object id for the which the servant is |
duke@1 | 1084 | * returned. |
duke@1 | 1085 | * @return servant associated with oid. |
duke@1 | 1086 | * @exception ObjectNotActive is raised if ObjectId is |
duke@1 | 1087 | * is not in the Active Object Map (for RETAIN |
duke@1 | 1088 | * policy), or no default servant is registered |
duke@1 | 1089 | * (for USE_DEFAULT_SERVANT policy). |
duke@1 | 1090 | * |
duke@1 | 1091 | * @exception WrongPolicy is raised if the RETAIN policy |
duke@1 | 1092 | * or the USE_DEFAULT_SERVANT |
duke@1 | 1093 | * policy is not present. |
duke@1 | 1094 | */ |
duke@1 | 1095 | Servant id_to_servant(in ObjectId oid) |
duke@1 | 1096 | raises (ObjectNotActive, WrongPolicy); |
duke@1 | 1097 | |
duke@1 | 1098 | /** |
duke@1 | 1099 | * If an object with the specified Object Id value is |
duke@1 | 1100 | * currently active, a reference encapsulating the |
duke@1 | 1101 | * information used to activate the object is returned. |
duke@1 | 1102 | * |
duke@1 | 1103 | * @param oid id of the object for which the |
duke@1 | 1104 | * reference is returned. |
duke@1 | 1105 | * @return the object reference |
duke@1 | 1106 | * |
duke@1 | 1107 | * @exception ObjectNotActive if the Object Id value |
duke@1 | 1108 | * is not active in the POA. |
duke@1 | 1109 | * @exception WrongPolicy if the RETAIN policy is not |
duke@1 | 1110 | * present. |
duke@1 | 1111 | */ |
duke@1 | 1112 | Object id_to_reference(in ObjectId oid) |
duke@1 | 1113 | raises (ObjectNotActive, WrongPolicy); |
duke@1 | 1114 | |
duke@1 | 1115 | /** |
duke@1 | 1116 | * This returns the unique id of the POA in the process in which it |
duke@1 | 1117 | * is created. It is for use by portable interceptors. |
duke@1 | 1118 | * <p> |
duke@1 | 1119 | * This id is guaranteed unique for the life span of the POA in the |
duke@1 | 1120 | * process. For persistent POAs, this means that if a POA is created |
duke@1 | 1121 | * in the same path with the same name as another POA, these POAs |
duke@1 | 1122 | * are identical and, therefore, have the same id. For transient |
duke@1 | 1123 | * POAs, each POA is unique. |
duke@1 | 1124 | */ |
duke@1 | 1125 | readonly attribute ::org::omg::CORBA::OctetSeq id; |
duke@1 | 1126 | |
duke@1 | 1127 | }; |
duke@1 | 1128 | |
duke@1 | 1129 | // ***************************************************** |
duke@1 | 1130 | // |
duke@1 | 1131 | // Current interface: |
duke@1 | 1132 | // |
duke@1 | 1133 | // ***************************************************** |
duke@1 | 1134 | |
duke@1 | 1135 | /** |
duke@1 | 1136 | * The PortableServer::Current interface, derived from |
duke@1 | 1137 | * CORBA::Current, provides method implementations with |
duke@1 | 1138 | * access to the identity of the object on which the |
duke@1 | 1139 | * method was invoked. The Current interface is provided |
duke@1 | 1140 | * to support servants that implement multiple objects, |
duke@1 | 1141 | * but can be used within the context of POA-dispatched |
duke@1 | 1142 | * method invocations on any servant. To provide location |
duke@1 | 1143 | * transparency, ORBs are required to support use of |
duke@1 | 1144 | * Current in the context of both locally and remotely |
duke@1 | 1145 | * invoked operations. An instance of Current can be |
duke@1 | 1146 | * obtained by the application by issuing the |
duke@1 | 1147 | * CORBA::ORB::resolve_initial_references("POACurrent") |
duke@1 | 1148 | * operation. Thereafter, it can be used within the |
duke@1 | 1149 | * context of a method dispatched by the POA to obtain |
duke@1 | 1150 | * the POA and ObjectId that identify the object on |
duke@1 | 1151 | * which that operation was invoked. |
duke@1 | 1152 | */ |
duke@1 | 1153 | interface Current : CORBA::Current { |
duke@1 | 1154 | #pragma sun_local Current "" |
duke@1 | 1155 | #pragma version Current 2.3 |
duke@1 | 1156 | /** |
duke@1 | 1157 | * The exception that is used to indicate that the |
duke@1 | 1158 | * operation is invoked outside the context of the |
duke@1 | 1159 | * POA-dispatched operation. |
duke@1 | 1160 | */ |
duke@1 | 1161 | |
duke@1 | 1162 | exception NoContext { }; |
duke@1 | 1163 | |
duke@1 | 1164 | /** |
duke@1 | 1165 | * Returns reference to the POA implementing the |
duke@1 | 1166 | * object in whose context it is called. |
duke@1 | 1167 | * |
duke@1 | 1168 | * @return The poa implementing the object |
duke@1 | 1169 | * |
duke@1 | 1170 | * @exception NoContext is raised when the operation is |
duke@1 | 1171 | * outside the context of a POA-dispatched |
duke@1 | 1172 | * operation |
duke@1 | 1173 | */ |
duke@1 | 1174 | POA get_POA() |
duke@1 | 1175 | raises (NoContext); |
duke@1 | 1176 | |
duke@1 | 1177 | /** |
duke@1 | 1178 | * Returns the ObjectId identifying the object in |
duke@1 | 1179 | * whose context it is called. |
duke@1 | 1180 | * |
duke@1 | 1181 | * @return the ObjectId of the object |
duke@1 | 1182 | * |
duke@1 | 1183 | * @exception NoContext is raised when the operation |
duke@1 | 1184 | * is called outside the context of a POA-dispatched |
duke@1 | 1185 | * operation. |
duke@1 | 1186 | */ |
duke@1 | 1187 | |
duke@1 | 1188 | ObjectId get_object_id() |
duke@1 | 1189 | raises (NoContext); |
duke@1 | 1190 | }; |
duke@1 | 1191 | }; |