PortableInterceptor::ServerRequestInfo IDL interface.
More...
#include <ServerRequestInfo.h>
Inheritance diagram for TAO::ServerRequestInfo:


Public Member Functions | |
| ServerRequestInfo (TAO_ServerRequest &server_request, TAO::Argument *const *args, size_t nargs, void *servant_upcall, CORBA::TypeCode_ptr const *exceptions, CORBA::ULong nexceptions) | |
| Constructor. | |
| virtual CORBA::ULong | request_id (void) |
| virtual char * | operation (void) |
| Return the operation name for the current request. | |
| virtual Dynamic::ParameterList * | arguments (void) |
| Return the list of arguments passed to the current operation. | |
| virtual Dynamic::ExceptionList * | exceptions (void) |
| virtual Dynamic::ContextList * | contexts (void) |
| virtual Dynamic::RequestContext * | operation_context (void) |
| virtual CORBA::Any * | result (void) |
| virtual CORBA::Boolean | response_expected (void) |
Returns true for a two-way operation, and false otherwise. | |
| virtual Messaging::SyncScope | sync_scope (void) |
| virtual PortableInterceptor::ReplyStatus | reply_status (void) |
| Return the reply status for the current request. | |
| virtual CORBA::Object_ptr | forward_reference (void) |
| virtual CORBA::Any * | get_slot (PortableInterceptor::SlotId id) |
Retrieve data from the "request scope" PICurrent object. | |
| virtual IOP::ServiceContext * | get_request_service_context (IOP::ServiceId id) |
| virtual IOP::ServiceContext * | get_reply_service_context (IOP::ServiceId id) |
| virtual CORBA::Any * | sending_exception (void) |
| virtual PortableInterceptor::ObjectId * | object_id (void) |
Return the ObjectId for the target object. | |
| virtual CORBA::OctetSeq * | adapter_id (void) |
| virtual char * | server_id (void) |
| virtual char * | orb_id (void) |
| virtual PortableInterceptor::AdapterName * | adapter_name (void) |
| virtual char * | target_most_derived_interface (void) |
| Return the most derived interface of the target object. | |
| virtual CORBA::Policy_ptr | get_server_policy (CORBA::PolicyType type) |
| virtual void | set_slot (PortableInterceptor::SlotId id, const CORBA::Any &data) |
Insert data into the "request scope" PICurrent object. | |
| virtual CORBA::Boolean | target_is_a (const char *id) |
| virtual void | add_reply_service_context (const IOP::ServiceContext &service_context, CORBA::Boolean replace) |
| TAO_ServerRequest & | server_request (void) |
Helper methods specific to TAO. | |
| void | forward_reference (PortableInterceptor::ForwardRequest &exc) |
| void | forward_reference (CORBA::Object_ptr obj) |
Protected Member Functions | |
| IOP::ServiceContext * | get_service_context_i (TAO_Service_Context &service_context_list, IOP::ServiceId id) |
Protected Attributes | |
| TAO_ServerRequest & | server_request_ |
| TAO::Argument *const *const | args_ |
| Operation argument list. | |
| size_t const | nargs_ |
| Number of element in the operation argument list. | |
| TAO::Portable_Server::Servant_Upcall *const | servant_upcall_ |
| CORBA::TypeCode_ptr const *const | exceptions_ |
| CORBA::ULong const | nexceptions_ |
The number of elements in the exceptions_ array. | |
PortableInterceptor::ServerRequestInfo IDL interface.
Implementation of the PortableInterceptor::ServerRequestInfo IDL interface.
Definition at line 70 of file ServerRequestInfo.h.
| TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO::ServerRequestInfo::ServerRequestInfo | ( | TAO_ServerRequest & | server_request, | |
| TAO::Argument *const * | args, | |||
| size_t | nargs, | |||
| void * | servant_upcall, | |||
| CORBA::TypeCode_ptr const * | exceptions, | |||
| CORBA::ULong | nexceptions | |||
| ) |
Constructor.
Definition at line 11 of file ServerRequestInfo.inl.
References ServerRequestInfo().
Referenced by ServerRequestInfo().
00018 : server_request_ (server_request) 00019 , args_ (args) 00020 , nargs_ (nargs) 00021 , servant_upcall_ ( 00022 static_cast<TAO::Portable_Server::Servant_Upcall *> (servant_upcall)) 00023 , exceptions_ (exceptions) 00024 , nexceptions_ (nexceptions) 00025 { 00026 }
| CORBA::OctetSeq * TAO::ServerRequestInfo::adapter_id | ( | void | ) | [virtual] |
Return the AdapterId for the POA handling the current request.
Definition at line 393 of file ServerRequestInfo.cpp.
References adapter_id(), CORBA::COMPLETED_NO, CORBA::OMGVMCID, and servant_upcall_.
Referenced by adapter_id().
00394 { 00395 if (this->servant_upcall_ != 0) 00396 return this->servant_upcall_->poa ().id (); 00397 00398 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00399 }
| PortableInterceptor::AdapterName * TAO::ServerRequestInfo::adapter_name | ( | void | ) | [virtual] |
Return the name of the object adapter that services requests for the invoked object.
Definition at line 339 of file ServerRequestInfo.cpp.
References adapter_name(), CORBA::COMPLETED_NO, CORBA::OMGVMCID, and servant_upcall_.
Referenced by adapter_name().
00340 { 00341 // The adapter_name attribute defines a name for the object adapter 00342 // that services requests for the invoked object. In the case of the 00343 // POA, the adapter_name is the sequence of names from the root POA 00344 // to the POA that services the request. The root POA is not named 00345 // in this sequence. 00346 if (this->servant_upcall_ != 0) 00347 return 00348 this->servant_upcall_->poa ().adapter_name (); 00349 00350 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00351 }
| void TAO::ServerRequestInfo::add_reply_service_context | ( | const IOP::ServiceContext & | service_context, | |
| CORBA::Boolean | replace | |||
| ) | [virtual] |
Add the IOP::ServiceContext to the reply (outgoing) IOP::ServiceContextList.
Definition at line 484 of file ServerRequestInfo.cpp.
References add_reply_service_context(), CORBA::COMPLETED_NO, CORBA::OMGVMCID, TAO_ServerRequest::reply_service_context(), server_request_, and TAO_Service_Context::set_context().
Referenced by add_reply_service_context().
00487 { 00488 // Get the service context from the list 00489 TAO_Service_Context &service_context_list = 00490 this->server_request_.reply_service_context (); 00491 00492 if (service_context_list.set_context (service_context, replace) == 0) 00493 { 00494 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 15, CORBA::COMPLETED_NO); 00495 } 00496 }
| Dynamic::ParameterList * TAO::ServerRequestInfo::arguments | ( | void | ) | [virtual] |
Return the list of arguments passed to the current operation.
Definition at line 79 of file ServerRequestInfo.cpp.
References ACE_ASSERT, args_, arguments(), CORBA::COMPLETED_NO, nargs_, and CORBA::OMGVMCID.
Referenced by arguments().
00080 { 00081 if (this->args_ == 0) 00082 { 00083 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00084 } 00085 00086 // Generate the argument list on demand. 00087 Dynamic::ParameterList * const parameter_list = 00088 TAO_RequestInfo_Util::make_parameter_list (); 00089 00090 Dynamic::ParameterList_var safe_parameter_list = parameter_list; 00091 00092 // Return value is always generated as first TAO::Argument in 00093 // skeleton. It shouldn't be included in the parameter list. 00094 // Skip it. 00095 TAO::Argument * const * const begin = this->args_ + 1; 00096 TAO::Argument * const * const end = this->args_ + this->nargs_; 00097 00098 ACE_ASSERT (end - begin >= 0); 00099 00100 parameter_list->length (static_cast<CORBA::ULong> (end - begin)); 00101 00102 CORBA::ULong p = 0; 00103 for (TAO::Argument * const * i = begin; i != end; ++i, ++p) 00104 { 00105 // Insert the operation parameters into the 00106 // Dynamic::ParameterList. 00107 Dynamic::Parameter& parameter = (*parameter_list)[p]; 00108 parameter.mode = (*i)->mode (); 00109 // When we are in receive_request and have an out argument, then 00110 // don't copy it, just let the any be empty with typecode tk_null 00111 if ((this->server_request_.pi_reply_status () != -1) || 00112 (this->server_request_.pi_reply_status () == -1 && 00113 (*i)->mode () != CORBA::PARAM_OUT)) 00114 { 00115 (*i)->interceptor_value (¶meter.argument); 00116 } 00117 } 00118 00119 return safe_parameter_list._retn (); 00120 }
| Dynamic::ContextList * TAO::ServerRequestInfo::contexts | ( | void | ) | [virtual] |
Definition at line 153 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, contexts(), and CORBA::OMGVMCID.
Referenced by contexts().
00154 { 00155 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00156 }
| Dynamic::ExceptionList * TAO::ServerRequestInfo::exceptions | ( | void | ) | [virtual] |
Return the list of exceptions the current operation is capable of throwing.
Definition at line 123 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, exceptions(), exceptions_, nexceptions_, and CORBA::OMGVMCID.
Referenced by exceptions().
00124 { 00125 if (this->args_ == 0) 00126 { 00127 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00128 } 00129 00130 // Generate the exception list on demand. 00131 Dynamic::ExceptionList * const exception_list = 00132 TAO_RequestInfo_Util::make_exception_list (); 00133 00134 Dynamic::ExceptionList_var safe_exception_list = exception_list; 00135 00136 exception_list->length (this->nexceptions_); 00137 00138 CORBA::TypeCode_ptr const * const begin = this->exceptions_; 00139 CORBA::TypeCode_ptr const * const end = 00140 this->exceptions_ + this->nexceptions_; 00141 00142 CORBA::ULong e = 0; 00143 for (CORBA::TypeCode_ptr const * i = begin; i != end; ++i, ++e) 00144 { 00145 CORBA::TypeCode_ptr tcp_object = *i; 00146 (*exception_list)[e] = tcp_object; 00147 } 00148 00149 return safe_exception_list._retn (); 00150 }
| ACE_INLINE void TAO::ServerRequestInfo::forward_reference | ( | CORBA::Object_ptr | obj | ) |
PortableServer::ForwardRequest exception is thrown by a servant manager. Definition at line 42 of file ServerRequestInfo.inl.
References TAO_ServerRequest::forward_location(), forward_reference(), TAO_ServerRequest::pi_reply_status(), and server_request_.
00043 { 00044 // We only get here if a servant manager threw a 00045 // PortableServer::ForwardRequest exception. 00046 00047 this->server_request_.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); 00048 00049 // Store the forward reference in the TAO_ServerRequest object. 00050 this->server_request_.forward_location (obj); 00051 }
| ACE_INLINE void TAO::ServerRequestInfo::forward_reference | ( | PortableInterceptor::ForwardRequest & | exc | ) |
Extract the forward object reference from the PortableInterceptor::ForwardRequest exception, and set the reply status flag accordingly.
Definition at line 29 of file ServerRequestInfo.inl.
References TAO_ServerRequest::forward_location(), forward_reference(), TAO_ServerRequest::pi_reply_status(), and server_request_.
00031 { 00032 // Note that we're converting the ForwardRequest exception in to a 00033 // LOCATION_FORWARD reply, so we do not set the exception status. 00034 00035 this->server_request_.pi_reply_status (PortableInterceptor::LOCATION_FORWARD); 00036 00037 // Store the forward reference in the TAO_ServerRequest object. 00038 this->server_request_.forward_location (exc.forward.in ()); 00039 }
| CORBA::Object_ptr TAO::ServerRequestInfo::forward_reference | ( | void | ) | [virtual] |
If the reply status is PortableInterceptor::LOCATION_FORWARD return the object reference to which the request was forwarded.
Definition at line 214 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, TAO_ServerRequest::forward_location(), forward_reference(), CORBA::OMGVMCID, and server_request_.
Referenced by forward_reference().
00215 { 00216 if (this->server_request_.pi_reply_status () != PortableInterceptor::LOCATION_FORWARD) 00217 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00218 00219 // TAO_ServerRequest::forward_location() already duplicates the 00220 // object reference. There is no need to duplicate it here. 00221 return this->server_request_.forward_location (); 00222 }
| IOP::ServiceContext * TAO::ServerRequestInfo::get_reply_service_context | ( | IOP::ServiceId | id | ) | [virtual] |
Return the IOP::ServiceContext with the given IOP::ServiceId from the reply service context list.
Definition at line 257 of file ServerRequestInfo.cpp.
References get_reply_service_context(), get_service_context_i(), TAO_ServerRequest::reply_service_context(), and server_request_.
Referenced by get_reply_service_context().
00258 { 00259 TAO_Service_Context & service_context_list = 00260 this->server_request_.reply_service_context (); 00261 00262 return this->get_service_context_i (service_context_list, id); 00263 }
| IOP::ServiceContext * TAO::ServerRequestInfo::get_request_service_context | ( | IOP::ServiceId | id | ) | [virtual] |
Return the IOP::ServiceContext with the given IOP::ServiceId from the request service context list.
Definition at line 248 of file ServerRequestInfo.cpp.
References get_request_service_context(), get_service_context_i(), TAO_ServerRequest::request_service_context(), and server_request_.
Referenced by get_request_service_context().
00249 { 00250 TAO_Service_Context &service_context_list = 00251 this->server_request_.request_service_context (); 00252 00253 return this->get_service_context_i (service_context_list, id); 00254 }
| CORBA::Policy_ptr TAO::ServerRequestInfo::get_server_policy | ( | CORBA::PolicyType | type | ) | [virtual] |
Return the policy of the given type in effect for the current request.
Definition at line 418 of file ServerRequestInfo.cpp.
References TAO_Objref_Var_T< T >::_retn(), CORBA::COMPLETED_NO, get_server_policy(), TAO_Objref_Var_T< T >::in(), CORBA::is_nil(), CORBA::OMGVMCID, and servant_upcall_.
Referenced by get_server_policy().
00419 { 00420 if (this->servant_upcall_ != 0) 00421 { 00422 CORBA::Policy_var policy = 00423 this->servant_upcall_->poa ().get_policy (type); 00424 00425 if (!CORBA::is_nil (policy.in ())) 00426 { 00427 return policy._retn (); 00428 } 00429 else 00430 { 00431 // No policy matching the given PolicyType was found. 00432 throw ::CORBA::INV_POLICY (CORBA::OMGVMCID | 3, CORBA::COMPLETED_NO); 00433 } 00434 } 00435 00436 // @@ Technically, we shouldn't be throwing this exception since 00437 // this method should be valid in all server side request 00438 // interception points. 00439 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00440 }
| IOP::ServiceContext * TAO::ServerRequestInfo::get_service_context_i | ( | TAO_Service_Context & | service_context_list, | |
| IOP::ServiceId | id | |||
| ) | [protected] |
Helper method to get the request and response service contexts.
Definition at line 266 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, TAO_Service_Context::get_context(), get_service_context_i(), and CORBA::OMGVMCID.
Referenced by get_reply_service_context(), get_request_service_context(), and get_service_context_i().
00269 { 00270 IOP::ServiceContext_var service_context; 00271 00272 if (service_context_list.get_context (id, service_context.out ()) != 0) 00273 { 00274 // Found. 00275 return service_context._retn (); 00276 } 00277 else 00278 { 00279 // Not found. 00280 throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 26, CORBA::COMPLETED_NO); 00281 } 00282 }
| CORBA::Any * TAO::ServerRequestInfo::get_slot | ( | PortableInterceptor::SlotId | id | ) | [virtual] |
Retrieve data from the "request scope" PICurrent object.
Definition at line 225 of file ServerRequestInfo.cpp.
References get_slot(), TAO_ServerRequest::orb_core(), TAO_ORB_Core::pi_current(), TAO_ServerRequest::rs_pi_current(), and server_request_.
Referenced by get_slot().
00226 { 00227 // Retrieve the total number of assigned slots from the PICurrent. 00228 // No TSS access is incurred. 00229 CORBA::Object_ptr pi_current_obj = 00230 this->server_request_.orb_core ()->pi_current (); 00231 00232 TAO::PICurrent *pi_current = 00233 dynamic_cast <TAO::PICurrent*> (pi_current_obj); 00234 00235 if (pi_current == 0) 00236 throw ::CORBA::INTERNAL (); 00237 00238 pi_current->check_validity (id); 00239 00240 // Retrieve the request scope PICurrent object. 00241 TAO::PICurrent_Impl *rsc = this->server_request_.rs_pi_current (); 00242 00243 return rsc->get_slot (id); 00244 00245 }
| PortableInterceptor::ObjectId * TAO::ServerRequestInfo::object_id | ( | void | ) | [virtual] |
Return the ObjectId for the target object.
Definition at line 354 of file ServerRequestInfo.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, ACE_OS::memcpy(), object_id(), CORBA::OMGVMCID, servant_upcall_, and TAO::VMCID.
Referenced by object_id().
00355 { 00356 if (this->servant_upcall_ != 0) 00357 { 00358 const PortableServer::ObjectId &id = 00359 this->servant_upcall_->user_id (); 00360 00361 PortableInterceptor::ObjectId *tmp = 0; 00362 00363 ACE_NEW_THROW_EX (tmp, 00364 PortableInterceptor::ObjectId, 00365 CORBA::NO_MEMORY ( 00366 CORBA::SystemException::_tao_minor_code ( 00367 TAO::VMCID, 00368 ENOMEM), 00369 CORBA::COMPLETED_NO)); 00370 00371 PortableInterceptor::ObjectId_var obj_id = tmp; 00372 00373 // @@ It would be nice to avoid this copy. However, we can't be 00374 // sure if the octet sequence will out live the POA from 00375 // which the object ID is ultimately obtained. In the event 00376 // the octet sequence does out live the POA, a copy is indeed 00377 // necessary. Do a copy to be on the safe side. In any 00378 // case, this is still faster than the 00379 // PortableServer::Current::object_id() method since no TSS 00380 // access is involved. 00381 CORBA::ULong const len = id.length (); 00382 obj_id->length (len); 00383 CORBA::Octet *buffer = obj_id->get_buffer (); 00384 ACE_OS::memcpy (buffer, id.get_buffer (), len); 00385 00386 return obj_id._retn (); 00387 } 00388 00389 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00390 }
| char * TAO::ServerRequestInfo::operation | ( | void | ) | [virtual] |
Return the operation name for the current request.
Definition at line 73 of file ServerRequestInfo.cpp.
References operation(), and CORBA::string_dup().
Referenced by operation().
00074 { 00075 return CORBA::string_dup (this->server_request_.operation ()); 00076 }
| Dynamic::RequestContext * TAO::ServerRequestInfo::operation_context | ( | void | ) | [virtual] |
Definition at line 159 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, and operation_context().
Referenced by operation_context().
00160 { 00161 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00162 }
| char * TAO::ServerRequestInfo::orb_id | ( | void | ) | [virtual] |
Return the ORBId value that is passed to the ORB_init call.
Definition at line 329 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, orb_id(), and CORBA::string_dup().
Referenced by orb_id().
00330 { 00331 if (this->servant_upcall_ != 0) 00332 return 00333 CORBA::string_dup (this->server_request_.orb_core ()->orbid ()); 00334 00335 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00336 }
| PortableInterceptor::ReplyStatus TAO::ServerRequestInfo::reply_status | ( | void | ) | [virtual] |
Return the reply status for the current request.
Statuses can be PortableInterceptor::SUCCESSFUL, SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD, TRANSPORT_RETRY, UNKNOWN..
Definition at line 204 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, TAO_ServerRequest::pi_reply_status(), reply_status(), and server_request_.
Referenced by reply_status().
00205 { 00206 if (this->server_request_.pi_reply_status () == -1) 00207 // A reply hasn't been received yet. 00208 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00209 00210 return this->server_request_.pi_reply_status (); 00211 }
| TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::ULong TAO::ServerRequestInfo::request_id | ( | void | ) | [virtual] |
Return an ID unique to the current request. This request ID may or may not be the same as the GIOP request ID.
Definition at line 35 of file ServerRequestInfo.cpp.
References TAO_ServerRequest::request_id(), request_id(), and server_request_.
Referenced by request_id().
00036 { 00037 // The request ID returned by this method need not correspond to the 00038 // GIOP request ID sent with the client request. The request ID 00039 // must be unique across all outstanding requests. To avoid locking 00040 // overhead, the address of the TAO_ServerRequest object is used as 00041 // the request ID. This guarantees that the request ID is unique. 00042 // 00043 // For 64-bit platforms, only the lower 32 bits are used. Hopefully 00044 // that will be enough to ensure uniqueness. 00045 00046 CORBA::ULong id = 0; 00047 00048 // Note that we reinterpret_cast to an "unsigned long" instead of 00049 // CORBA::ULong since we need to first cast to an integer large 00050 // enough to hold an address to avoid compile-time warnings on some 00051 // 64-bit platforms. 00052 00053 if (sizeof (this) == 4) // 32 bit address 00054 id = static_cast <CORBA::ULong> ( 00055 reinterpret_cast <ptrdiff_t> 00056 (&(this->server_request_))); 00057 00058 else if (sizeof (this) == 8) // 64 bit address -- use lower 32 bits 00059 id = static_cast <CORBA::ULong> ( 00060 reinterpret_cast <ptrdiff_t> 00061 (&(this->server_request_)) & 0xFFFFFFFFu); 00062 00063 else 00064 // @@ Rather than fallback on the GIOP request ID, we should use 00065 // an atomically incremented variable specific to the ORB, or 00066 // perhaps specific to the process. 00067 id = this->server_request_.request_id (); // Fallback 00068 00069 return id; 00070 }
| CORBA::Boolean TAO::ServerRequestInfo::response_expected | ( | void | ) | [virtual] |
Returns true for a two-way operation, and false otherwise.
Definition at line 189 of file ServerRequestInfo.cpp.
References TAO_ServerRequest::response_expected(), response_expected(), and server_request_.
Referenced by response_expected().
00190 { 00191 return this->server_request_.response_expected (); 00192 }
| CORBA::Any * TAO::ServerRequestInfo::result | ( | void | ) | [virtual] |
Return the result of the current request. If there is no return value then an Any with tk_void TypeCode is returned. This method is not valid for oneway operations.
Definition at line 165 of file ServerRequestInfo.cpp.
References args_, CORBA::COMPLETED_NO, CORBA::OMGVMCID, and result().
Referenced by result().
00166 { 00167 if (this->args_ == 0) 00168 { 00169 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00170 } 00171 00172 // Generate the result on demand. 00173 static CORBA::Boolean const tk_void_any = true; 00174 00175 CORBA::Any * result_any = 00176 TAO_RequestInfo_Util::make_any (tk_void_any); 00177 00178 CORBA::Any_var safe_result_any = result_any; 00179 00180 // Result is always first element in TAO::Argument array. 00181 TAO::Argument * const r = this->args_[0]; 00182 00183 r->interceptor_value (result_any); 00184 00185 return safe_result_any._retn (); 00186 }
| CORBA::Any * TAO::ServerRequestInfo::sending_exception | ( | void | ) | [virtual] |
Any. Definition at line 288 of file ServerRequestInfo.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, TAO_ServerRequest::caught_exception(), CORBA::COMPLETED_NO, CORBA::OMGVMCID, TAO_ServerRequest::pi_reply_status(), sending_exception(), server_request_, SYSTEM_EXCEPTION, USER_EXCEPTION, and TAO::VMCID.
Referenced by sending_exception().
00289 { 00290 if (this->server_request_.pi_reply_status () != PortableInterceptor::SYSTEM_EXCEPTION 00291 && this->server_request_.pi_reply_status () != PortableInterceptor::USER_EXCEPTION) 00292 { 00293 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00294 } 00295 00296 // The spec says that if it is a user exception which cannot be 00297 // inserted then the UNKNOWN exception should be thrown with minor 00298 // code 1. 00299 00300 CORBA::Any * temp = 0; 00301 00302 ACE_NEW_THROW_EX (temp, 00303 CORBA::Any, 00304 CORBA::NO_MEMORY ( 00305 CORBA::SystemException::_tao_minor_code ( 00306 TAO::VMCID, 00307 ENOMEM), 00308 CORBA::COMPLETED_NO)); 00309 00310 CORBA::Any_var caught_exception_var = temp; 00311 00312 if (this->server_request_.caught_exception () != 0) 00313 (*temp) <<= *(this->server_request_.caught_exception ()); 00314 00315 return caught_exception_var._retn (); 00316 }
| char * TAO::ServerRequestInfo::server_id | ( | void | ) | [virtual] |
Return the server_id of the server. The value is passed to the ORB via -ORBServerId parameter.
Definition at line 319 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, server_id(), and CORBA::string_dup().
Referenced by server_id().
00320 { 00321 if (this->servant_upcall_ != 0) 00322 return 00323 CORBA::string_dup (this->server_request_.orb_core ()->server_id ()); 00324 00325 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00326 }
| ACE_INLINE TAO_ServerRequest & TAO::ServerRequestInfo::server_request | ( | void | ) |
Return a reference to the underlying TAO_ServerRequest object.
Definition at line 54 of file ServerRequestInfo.inl.
References server_request(), and server_request_.
Referenced by server_request().
00055 { 00056 return this->server_request_; 00057 }
| void TAO::ServerRequestInfo::set_slot | ( | PortableInterceptor::SlotId | id, | |
| const CORBA::Any & | data | |||
| ) | [virtual] |
Insert data into the "request scope" PICurrent object.
Definition at line 443 of file ServerRequestInfo.cpp.
References TAO_ServerRequest::orb_core(), TAO_ORB_Core::pi_current(), TAO_ServerRequest::rs_pi_current(), server_request_, and set_slot().
Referenced by set_slot().
00445 { 00446 // Retrieve the total number of assigned slots from the PICurrent 00447 // object. No TSS access is incurred. 00448 CORBA::Object_ptr pi_current_obj = 00449 this->server_request_.orb_core ()->pi_current (); 00450 00451 TAO::PICurrent *pi_current = 00452 dynamic_cast <TAO::PICurrent*> (pi_current_obj); 00453 00454 if (pi_current == 0) 00455 throw ::CORBA::INTERNAL (); 00456 00457 pi_current->check_validity (id); 00458 00459 // Retrieve the "request scope current" (RSC). 00460 TAO::PICurrent_Impl * rsc = this->server_request_.rs_pi_current (); 00461 00462 rsc->set_slot (id, data); 00463 }
| Messaging::SyncScope TAO::ServerRequestInfo::sync_scope | ( | void | ) | [virtual] |
Return the sync_scope policy value for the current one-way operation. If the operation is not a one-way, a CORBA::BAD_INV_ORDER exception is thrown.
Definition at line 195 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, and sync_scope().
Referenced by sync_scope().
00196 { 00197 if (this->server_request_.sync_with_server ()) 00198 return Messaging::SYNC_WITH_SERVER; 00199 00200 throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO); 00201 }
| CORBA::Boolean TAO::ServerRequestInfo::target_is_a | ( | const char * | id | ) | [virtual] |
Returns true if the target's type corresponds to the given RepositoryId.
Definition at line 466 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, servant_upcall_, and target_is_a().
Referenced by target_is_a().
00467 { 00468 // Implemented in the generated skeleton. 00469 00470 PortableServer::Servant const servant = 00471 (this->servant_upcall_ == 0 00472 ? 0 00473 : this->servant_upcall_->servant ()); 00474 00475 if (servant == 0) 00476 { 00477 throw ::CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); 00478 } 00479 00480 return servant->_is_a (id); 00481 }
| char * TAO::ServerRequestInfo::target_most_derived_interface | ( | void | ) | [virtual] |
Return the most derived interface of the target object.
Definition at line 402 of file ServerRequestInfo.cpp.
References CORBA::COMPLETED_NO, CORBA::OMGVMCID, servant_upcall_, CORBA::string_dup(), and target_most_derived_interface().
Referenced by target_most_derived_interface().
00403 { 00404 PortableServer::Servant const servant = 00405 (this->servant_upcall_ == 0 00406 ? 0 00407 : this->servant_upcall_->servant ()); 00408 00409 if (servant == 0) 00410 { 00411 throw ::CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1, CORBA::COMPLETED_NO); 00412 } 00413 00414 return CORBA::string_dup (servant->_interface_repository_id ()); 00415 }
TAO::Argument* const* const TAO::ServerRequestInfo::args_ [protected] |
Operation argument list.
Definition at line 233 of file ServerRequestInfo.h.
Referenced by arguments(), and result().
CORBA::TypeCode_ptr const* const TAO::ServerRequestInfo::exceptions_ [protected] |
Array of TypeCodes for user exceptions the operation is capable of raising.
Definition at line 244 of file ServerRequestInfo.h.
Referenced by exceptions().
size_t const TAO::ServerRequestInfo::nargs_ [protected] |
Number of element in the operation argument list.
Definition at line 236 of file ServerRequestInfo.h.
Referenced by arguments().
CORBA::ULong const TAO::ServerRequestInfo::nexceptions_ [protected] |
The number of elements in the exceptions_ array.
Definition at line 247 of file ServerRequestInfo.h.
Referenced by exceptions().
TAO::Portable_Server::Servant_Upcall* const TAO::ServerRequestInfo::servant_upcall_ [protected] |
Pointer to the Servant_Upcall object that contains the object ID, among other things.
Definition at line 240 of file ServerRequestInfo.h.
Referenced by adapter_id(), adapter_name(), get_server_policy(), object_id(), target_is_a(), and target_most_derived_interface().
TAO_ServerRequest& TAO::ServerRequestInfo::server_request_ [protected] |
Underlying request object that contains much of the information encapsulated by this ServerRequestInfo implementation.
Definition at line 230 of file ServerRequestInfo.h.
Referenced by add_reply_service_context(), forward_reference(), get_reply_service_context(), get_request_service_context(), get_slot(), reply_status(), request_id(), response_expected(), sending_exception(), server_request(), and set_slot().
1.4.7