TAO::ServerRequestInfo Class Reference

Implementation of the PortableInterceptor::ServerRequestInfo IDL interface. More...

#include <ServerRequestInfo.h>

Inheritance diagram for TAO::ServerRequestInfo:

Inheritance graph
[legend]
Collaboration diagram for TAO::ServerRequestInfo:

Collaboration graph
[legend]
List of all members.

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 () throw (CORBA::SystemException)
virtual char * operation () throw (CORBA::SystemException)
 Return the operation name for the current request.

virtual Dynamic::ParameterList * arguments () throw (CORBA::SystemException)
 Return the list of arguments passed to the current operation.

virtual Dynamic::ExceptionList * exceptions () throw (CORBA::SystemException)
virtual Dynamic::ContextList * contexts () throw (CORBA::SystemException)
virtual Dynamic::RequestContext * operation_context () throw (CORBA::SystemException)
virtual CORBA::Any * result () throw (CORBA::SystemException)
virtual CORBA::Boolean response_expected () throw (CORBA::SystemException)
 Returns true for a two-way operation, and false otherwise.

virtual Messaging::SyncScope sync_scope () throw (CORBA::SystemException)
virtual PortableInterceptor::ReplyStatus reply_status () throw (CORBA::SystemException)
 Return the reply status for the current request.

virtual CORBA::Object_ptr forward_reference () throw (CORBA::SystemException)
virtual CORBA::Any * get_slot (PortableInterceptor::SlotId id) throw (CORBA::SystemException, PortableInterceptor::InvalidSlot)
 Retrieve data from the "request scope" PICurrent object.

virtual IOP::ServiceContextget_request_service_context (IOP::ServiceId id) throw (CORBA::SystemException)
virtual IOP::ServiceContextget_reply_service_context (IOP::ServiceId id) throw (CORBA::SystemException)
virtual CORBA::Any * sending_exception () throw (CORBA::SystemException)
virtual PortableInterceptor::ObjectIdobject_id () throw (CORBA::SystemException)
 Return the ObjectId for the target object.

virtual CORBA::OctetSeqadapter_id () throw (CORBA::SystemException)
virtual char * server_id () throw (CORBA::SystemException)
virtual char * orb_id () throw (CORBA::SystemException)
virtual PortableInterceptor::AdapterNameadapter_name () throw (CORBA::SystemException)
virtual char * target_most_derived_interface () throw (CORBA::SystemException)
 Return the most derived interface of the target object.

virtual CORBA::Policy_ptr get_server_policy (CORBA::PolicyType type) throw (CORBA::SystemException)
virtual void set_slot (PortableInterceptor::SlotId id, const CORBA::Any &data) throw (CORBA::SystemException, PortableInterceptor::InvalidSlot)
 Insert data into the "request scope" PICurrent object.

virtual CORBA::Boolean target_is_a (const char *id) throw (CORBA::SystemException)
virtual void add_reply_service_context (const IOP::ServiceContext &service_context, CORBA::Boolean replace) throw (CORBA::SystemException)
TAO_ServerRequestserver_request (void)
Helper methods specific to TAO.
void forward_reference (PortableInterceptor::ForwardRequest &exc)
void forward_reference (CORBA::Object_ptr obj)

Protected Member Functions

IOP::ServiceContextget_service_context_i (TAO_Service_Context &service_context_list, IOP::ServiceId id) throw (CORBA::SystemException)

Protected Attributes

TAO_ServerRequestserver_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.


Detailed Description

Implementation of the PortableInterceptor::ServerRequestInfo IDL interface.

Implementation of the PortableInterceptor::ServerRequestInfo IDL interface.

Note:
This class is currently not meant to be reference counted since it is instantiated on the stack.

Definition at line 70 of file ServerRequestInfo.h.


Constructor & Destructor Documentation

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.

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 }


Member Function Documentation

CORBA::OctetSeq * TAO::ServerRequestInfo::adapter_id  )  throw (CORBA::SystemException) [virtual]
 

Return the AdapterId for the POA handling the current request.

Definition at line 456 of file ServerRequestInfo.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00458 {
00459   if (this->servant_upcall_ != 0)
00460     return this->servant_upcall_->poa ().id (ACE_ENV_SINGLE_ARG_PARAMETER);
00461 
00462   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00463                                           CORBA::COMPLETED_NO),
00464                     0);
00465 }

PortableInterceptor::AdapterName * TAO::ServerRequestInfo::adapter_name  )  throw (CORBA::SystemException) [virtual]
 

Return the name of the object adapter that services requests for the invoked object.

Definition at line 394 of file ServerRequestInfo.cpp.

References ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00396 {
00397   // The adapter_name attribute defines a name for the object adapter
00398   // that services requests for the invoked object. In the case of the
00399   // POA, the adapter_name is the sequence of names from the root POA
00400   // to the POA that services the request. The root POA is not named
00401   // in this sequence.
00402   if (this->servant_upcall_ != 0)
00403     return
00404       this->servant_upcall_->poa ().adapter_name (
00405         ACE_ENV_SINGLE_ARG_PARAMETER);
00406 
00407   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00408                                           CORBA::COMPLETED_NO),
00409                     0);
00410 }

void TAO::ServerRequestInfo::add_reply_service_context const IOP::ServiceContext service_context,
CORBA::Boolean  replace
throw (CORBA::SystemException) [virtual]
 

Add the IOP::ServiceContext to the reply (outgoing) IOP::ServiceContextList.

Definition at line 572 of file ServerRequestInfo.cpp.

References ACE_THROW, and TAO_Service_Context::set_context().

00577 {
00578   // Get the service context from the list
00579   TAO_Service_Context &service_context_list =
00580     this->server_request_.reply_service_context ();
00581 
00582   if (service_context_list.set_context (service_context, replace) == 0)
00583     {
00584       ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 15,
00585                                        CORBA::COMPLETED_NO));
00586     }
00587 }

Dynamic::ParameterList * TAO::ServerRequestInfo::arguments  )  throw (CORBA::SystemException) [virtual]
 

Return the list of arguments passed to the current operation.

Definition at line 81 of file ServerRequestInfo.cpp.

References ACE_ASSERT, ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00083 {
00084   if (this->args_ == 0)
00085     {
00086       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00087                                               CORBA::COMPLETED_NO),
00088                         0);
00089     }
00090 
00091   // Generate the argument list on demand.
00092   Dynamic::ParameterList * const parameter_list =
00093     TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER);
00094   ACE_CHECK_RETURN (0);
00095 
00096   Dynamic::ParameterList_var safe_parameter_list = parameter_list;
00097 
00098   // Return value is always generated as first TAO::Argument in
00099   // skeleton.  It shouldn't be included in the parameter list.
00100   // Skip it.
00101 
00102   TAO::Argument * const * const begin = this->args_ + 1;
00103   TAO::Argument * const * const end   = this->args_ + this->nargs_;
00104 
00105   ACE_ASSERT (end - begin >= 0);
00106 
00107   parameter_list->length (static_cast<CORBA::ULong> (end - begin));
00108 
00109   CORBA::ULong p = 0;
00110   for (TAO::Argument * const * i = begin; i != end; ++i, ++p)
00111     {
00112       // Insert the operation parameters into the
00113       // Dynamic::ParameterList.
00114       Dynamic::Parameter& parameter = (*parameter_list)[p];
00115       parameter.mode = (*i)->mode ();
00116       (*i)->interceptor_value (&parameter.argument);
00117     }
00118 
00119   return safe_parameter_list._retn ();
00120 }

Dynamic::ContextList * TAO::ServerRequestInfo::contexts  )  throw (CORBA::SystemException) [virtual]
 

Definition at line 157 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00159 {
00160   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00161                                           CORBA::COMPLETED_NO),
00162                     0);
00163 }

Dynamic::ExceptionList * TAO::ServerRequestInfo::exceptions  )  throw (CORBA::SystemException) [virtual]
 

Return the list of exceptions the current operation is capable of throwing.

Definition at line 123 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00125 {
00126   if (this->args_ == 0)
00127     {
00128       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00129                                               CORBA::COMPLETED_NO),
00130                         0);
00131     }
00132 
00133   // Generate the exception list on demand.
00134   Dynamic::ExceptionList * const exception_list =
00135     TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER);
00136   ACE_CHECK_RETURN (0);
00137 
00138   Dynamic::ExceptionList_var safe_exception_list = exception_list;
00139 
00140   exception_list->length (this->nexceptions_);
00141 
00142   CORBA::TypeCode_ptr const * const begin = this->exceptions_;
00143   CORBA::TypeCode_ptr const * const end   =
00144     this->exceptions_ + this->nexceptions_;
00145 
00146   CORBA::ULong e = 0;
00147   for (CORBA::TypeCode_ptr const * i = begin; i != end; ++i, ++e)
00148     {
00149       CORBA::TypeCode_ptr tcp_object = *i;
00150       (*exception_list)[e] = tcp_object;
00151     }
00152 
00153   return safe_exception_list._retn ();
00154 }

ACE_INLINE void TAO::ServerRequestInfo::forward_reference CORBA::Object_ptr  obj  ) 
 

Note:
This method is only invoked when a PortableServer::ForwardRequest exception is thrown by a servant manager.

Definition at line 42 of file ServerRequestInfo.inl.

References TAO_ServerRequest::forward_location(), TAO_ServerRequest::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_.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(), TAO_ServerRequest::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_.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  )  throw (CORBA::SystemException) [virtual]
 

If the reply status is PortableInterceptor::LOCATION_FORWARD return the object reference to which the request was forwarded.

Definition at line 237 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00239 {
00240   if (this->server_request_.reply_status () != PortableInterceptor::LOCATION_FORWARD)
00241     ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00242                                             CORBA::COMPLETED_NO),
00243                       CORBA::Object::_nil ());
00244 
00245   // TAO_ServerRequest::forward_location() already duplicates the
00246   // object reference.  There is no need to duplicate it here.
00247   return this->server_request_.forward_location ();
00248 }

IOP::ServiceContext * TAO::ServerRequestInfo::get_reply_service_context IOP::ServiceId  id  )  throw (CORBA::SystemException) [virtual]
 

Return the IOP::ServiceContext with the given IOP::ServiceId from the reply service context list.

Definition at line 292 of file ServerRequestInfo.cpp.

References ACE_ENV_ARG_PARAMETER.

00296 {
00297   TAO_Service_Context & service_context_list =
00298     this->server_request_.reply_service_context ();
00299 
00300   return this->get_service_context_i (service_context_list,
00301                                       id
00302                                       ACE_ENV_ARG_PARAMETER);
00303 }

IOP::ServiceContext * TAO::ServerRequestInfo::get_request_service_context IOP::ServiceId  id  )  throw (CORBA::SystemException) [virtual]
 

Return the IOP::ServiceContext with the given IOP::ServiceId from the request service context list.

Definition at line 278 of file ServerRequestInfo.cpp.

References ACE_ENV_ARG_PARAMETER.

00282 {
00283   TAO_Service_Context &service_context_list =
00284     this->server_request_.request_service_context ();
00285 
00286   return this->get_service_context_i (service_context_list,
00287                                       id
00288                                       ACE_ENV_ARG_PARAMETER);
00289 }

CORBA::Policy_ptr TAO::ServerRequestInfo::get_server_policy CORBA::PolicyType  type  )  throw (CORBA::SystemException) [virtual]
 

Return the policy of the given type in effect for the current request.

Definition at line 488 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_THROW_RETURN, and CORBA::is_nil().

00491 {
00492   if (this->servant_upcall_ != 0)
00493     {
00494       CORBA::Policy_var policy =
00495         this->servant_upcall_->poa ().get_policy (type ACE_ENV_ARG_PARAMETER);
00496       ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00497 
00498       if (!CORBA::is_nil (policy.in ()))
00499         {
00500           return policy._retn ();
00501         }
00502       else
00503         {
00504           // No policy matching the given PolicyType was found.
00505           ACE_THROW_RETURN (CORBA::INV_POLICY (CORBA::OMGVMCID | 3,
00506                                                CORBA::COMPLETED_NO),
00507                             CORBA::Policy::_nil ());
00508         }
00509     }
00510 
00511   // @@ Technically, we shouldn't be throwing this exception since
00512   //    this method should be valid in all server side request
00513   //    interception points.
00514   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00515                                           CORBA::COMPLETED_NO),
00516                     CORBA::Policy::_nil ());
00517 }

IOP::ServiceContext * TAO::ServerRequestInfo::get_service_context_i TAO_Service_Context service_context_list,
IOP::ServiceId  id
throw (CORBA::SystemException) [protected]
 

Helper method to get the request and response service contexts.

Definition at line 306 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00311 {
00312   IOP::ServiceContext_var service_context;
00313 
00314   if (service_context_list.get_context (id, service_context.out ()) != 0)
00315     {
00316       // Found.
00317       return service_context._retn ();
00318     }
00319   else
00320     {
00321       // Not found.
00322       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 26,
00323                                           CORBA::COMPLETED_NO),
00324                         0);
00325     }
00326 }

CORBA::Any * TAO::ServerRequestInfo::get_slot PortableInterceptor::SlotId  id  )  throw (CORBA::SystemException, PortableInterceptor::InvalidSlot) [virtual]
 

Retrieve data from the "request scope" PICurrent object.

Definition at line 251 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, and ACE_THROW_RETURN.

00255 {
00256   // Retrieve the total number of assigned slots from the PICurrent.
00257   // No TSS access is incurred.
00258   CORBA::Object_ptr pi_current_obj =
00259     this->server_request_.orb_core ()->pi_current ();
00260 
00261   TAO::PICurrent *pi_current =
00262     dynamic_cast <TAO::PICurrent*> (pi_current_obj);
00263 
00264   if (pi_current == 0)
00265     ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
00266 
00267   pi_current->check_validity (id ACE_ENV_ARG_PARAMETER);
00268   ACE_CHECK_RETURN (0);
00269 
00270   // Retrieve the request scope PICurrent object.
00271   TAO::PICurrent_Impl *rsc = this->server_request_.rs_pi_current ();
00272 
00273   return rsc->get_slot (id ACE_ENV_ARG_PARAMETER);
00274 
00275 }

PortableInterceptor::ObjectId * TAO::ServerRequestInfo::object_id  )  throw (CORBA::SystemException) [virtual]
 

Return the ObjectId for the target object.

Definition at line 413 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_NEW_THROW_EX, ACE_THROW_RETURN, and ACE_OS::memcpy().

00415 {
00416   if (this->servant_upcall_ != 0)
00417     {
00418       const PortableServer::ObjectId &id =
00419         this->servant_upcall_->user_id ();
00420 
00421       PortableInterceptor::ObjectId *tmp = 0;
00422 
00423       ACE_NEW_THROW_EX (tmp,
00424                         PortableInterceptor::ObjectId,
00425                         CORBA::NO_MEMORY (
00426                           CORBA::SystemException::_tao_minor_code (
00427                             TAO::VMCID,
00428                             ENOMEM),
00429                           CORBA::COMPLETED_NO));
00430       ACE_CHECK_RETURN (0);
00431 
00432       PortableInterceptor::ObjectId_var obj_id = tmp;
00433 
00434       // @@ It would be nice to avoid this copy.  However, we can't be
00435       //    sure if the octet sequence will out live the POA from
00436       //    which the object ID is ultimately obtained.  In the event
00437       //    the octet sequence does out live the POA, a copy is indeed
00438       //    necessary.  Do a copy to be on the safe side.  In any
00439       //    case, this is still faster than the
00440       //    PortableServer::Current::object_id() method since no TSS
00441       //    access is involved.
00442       const CORBA::ULong len = id.length ();
00443       obj_id->length (len);
00444       CORBA::Octet *buffer = obj_id->get_buffer ();
00445       ACE_OS::memcpy (buffer, id.get_buffer (), len);
00446 
00447       return obj_id._retn ();
00448     }
00449 
00450   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00451                                           CORBA::COMPLETED_NO),
00452                     0);
00453 }

char * TAO::ServerRequestInfo::operation  )  throw (CORBA::SystemException) [virtual]
 

Return the operation name for the current request.

Definition at line 74 of file ServerRequestInfo.cpp.

References CORBA::string_dup().

00076 {
00077   return CORBA::string_dup (this->server_request_.operation ());
00078 }

Dynamic::RequestContext * TAO::ServerRequestInfo::operation_context  )  throw (CORBA::SystemException) [virtual]
 

Definition at line 166 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00168 {
00169   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00170                                           CORBA::COMPLETED_NO),
00171                     0);
00172 }

char * TAO::ServerRequestInfo::orb_id  )  throw (CORBA::SystemException) [virtual]
 

Return the ORBId value that is passed to the ORB_init call.

Definition at line 381 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN, and CORBA::string_dup().

00383 {
00384   if (this->servant_upcall_ != 0)
00385     return
00386       CORBA::string_dup (this->server_request_.orb_core ()->orbid ());
00387 
00388   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00389                                           CORBA::COMPLETED_NO),
00390                     0);
00391 }

PortableInterceptor::ReplyStatus TAO::ServerRequestInfo::reply_status  )  throw (CORBA::SystemException) [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 224 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00226 {
00227   if (this->server_request_.reply_status () == -1)
00228     // A reply hasn't been received yet.
00229     ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00230                                             CORBA::COMPLETED_NO),
00231                       -1);
00232 
00233   return this->server_request_.reply_status ();
00234 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::ULong TAO::ServerRequestInfo::request_id  )  throw (CORBA::SystemException) [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.

00037 {
00038   // The request ID returned by this method need not correspond to the
00039   // GIOP request ID sent with the client request.  The request ID
00040   // must be unique across all outstanding requests.  To avoid locking
00041   // overhead, the address of the TAO_ServerRequest object is used as
00042   // the request ID.  This guarantees that the request ID is unique.
00043   //
00044   // For 64-bit platforms, only the lower 32 bits are used.  Hopefully
00045   // that will be enough to ensure uniqueness.
00046 
00047   CORBA::ULong id = 0;
00048 
00049   // Note that we reinterpret_cast to an "unsigned long" instead of
00050   // CORBA::ULong since we need to first cast to an integer large
00051   // enough to hold an address to avoid compile-time warnings on some
00052   // 64-bit platforms.
00053 
00054   if (sizeof (this) == 4)       // 32 bit address
00055     id = static_cast <CORBA::ULong> (
00056                      reinterpret_cast <ptrdiff_t>
00057                                       (&(this->server_request_)));
00058 
00059   else if (sizeof (this) == 8)  // 64 bit address -- use lower 32 bits
00060     id = static_cast <CORBA::ULong> (
00061                      reinterpret_cast <ptrdiff_t>
00062                                (&(this->server_request_)) & 0xFFFFFFFFu);
00063 
00064   else
00065     // @@ Rather than fallback on the GIOP request ID, we should use
00066     //    an atomically incremented variable specific to the ORB, or
00067     //    perhaps specific to the process.
00068     id = this->server_request_.request_id ();  // Fallback
00069 
00070   return id;
00071 }

CORBA::Boolean TAO::ServerRequestInfo::response_expected  )  throw (CORBA::SystemException) [virtual]
 

Returns true for a two-way operation, and false otherwise.

Definition at line 205 of file ServerRequestInfo.cpp.

00207 {
00208   return this->server_request_.response_expected ();
00209 }

CORBA::Any * TAO::ServerRequestInfo::result  )  throw (CORBA::SystemException) [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 175 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_THROW_RETURN, and TAO::Argument::interceptor_value().

00177 {
00178   if (this->args_ == 0)
00179     {
00180       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00181                                               CORBA::COMPLETED_NO),
00182                         0);
00183     }
00184 
00185   // Generate the result on demand.
00186 
00187   static CORBA::Boolean const tk_void_any = 1;
00188 
00189   CORBA::Any * result_any =
00190     TAO_RequestInfo_Util::make_any (tk_void_any
00191                                     ACE_ENV_ARG_PARAMETER);
00192   ACE_CHECK_RETURN (0);
00193 
00194   CORBA::Any_var safe_result_any = result_any;
00195 
00196   // Result is always first element in TAO::Argument array.
00197   TAO::Argument * const r = this->args_[0];
00198 
00199   r->interceptor_value (result_any);
00200 
00201   return safe_result_any._retn ();
00202 }

CORBA::Any * TAO::ServerRequestInfo::sending_exception  )  throw (CORBA::SystemException) [virtual]
 

Note:
There is no trivial way to extract the exception from an Any.

Definition at line 332 of file ServerRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_NEW_THROW_EX, and ACE_THROW_RETURN.

00334 {
00335   if (this->server_request_.reply_status () != PortableInterceptor::SYSTEM_EXCEPTION
00336       && this->server_request_.reply_status () != PortableInterceptor::USER_EXCEPTION)
00337     {
00338       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00339                                               CORBA::COMPLETED_NO),
00340                         0);
00341     }
00342 
00343   // The spec says that if it is a user exception which cannot be
00344   // inserted then the UNKNOWN exception should be thrown with minor
00345   // code 1.
00346 
00347   CORBA::Any * temp = 0;
00348 
00349   ACE_NEW_THROW_EX (temp,
00350                     CORBA::Any,
00351                     CORBA::NO_MEMORY (
00352                       CORBA::SystemException::_tao_minor_code (
00353                         TAO::VMCID,
00354                         ENOMEM),
00355                       CORBA::COMPLETED_NO));
00356   ACE_CHECK_RETURN (0);
00357 
00358   CORBA::Any_var caught_exception_var = temp;
00359 
00360   if (this->server_request_.caught_exception () != 0)
00361     (*temp) <<= *(this->server_request_.caught_exception ());
00362 
00363   return caught_exception_var._retn ();
00364 }

char * TAO::ServerRequestInfo::server_id  )  throw (CORBA::SystemException) [virtual]
 

Return the server_id of the server. The value is passed to the ORB via -ORBServerId parameter.

Definition at line 367 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN, and CORBA::string_dup().

00369 {
00370   if (this->servant_upcall_ != 0)
00371     return
00372       CORBA::string_dup (this->server_request_.orb_core ()->server_id ());
00373 
00374 
00375   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00376                                           CORBA::COMPLETED_NO),
00377                     0);
00378 }

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_.

00055 {
00056   return this->server_request_;
00057 }

void TAO::ServerRequestInfo::set_slot PortableInterceptor::SlotId  id,
const CORBA::Any &  data
throw (CORBA::SystemException, PortableInterceptor::InvalidSlot) [virtual]
 

Insert data into the "request scope" PICurrent object.

Definition at line 520 of file ServerRequestInfo.cpp.

References ACE_CHECK, ACE_ENV_ARG_PARAMETER, and ACE_THROW.

00525 {
00526   // Retrieve the total number of assigned slots from the PICurrent
00527   // object.  No TSS access is incurred.
00528   CORBA::Object_ptr pi_current_obj =
00529     this->server_request_.orb_core ()->pi_current ();
00530 
00531   TAO::PICurrent *pi_current =
00532     dynamic_cast <TAO::PICurrent*> (pi_current_obj);
00533 
00534   if (pi_current == 0)
00535     ACE_THROW (CORBA::INTERNAL ());
00536 
00537   pi_current->check_validity (id ACE_ENV_ARG_PARAMETER);
00538   ACE_CHECK;
00539 
00540   // Retrieve the "request scope current" (RSC).
00541   TAO::PICurrent_Impl * rsc = this->server_request_.rs_pi_current ();
00542 
00543   rsc->set_slot (id, data ACE_ENV_ARG_PARAMETER);
00544   ACE_CHECK;
00545 }

Messaging::SyncScope TAO::ServerRequestInfo::sync_scope  )  throw (CORBA::SystemException) [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 212 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN.

00214 {
00215   if (this->server_request_.sync_with_server ())
00216     return Messaging::SYNC_WITH_SERVER;
00217 
00218   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00219                                           CORBA::COMPLETED_NO),
00220                     -1);
00221 }

CORBA::Boolean TAO::ServerRequestInfo::target_is_a const char *  id  )  throw (CORBA::SystemException) [virtual]
 

Returns true if the target's type corresponds to the given RepositoryId.

Definition at line 548 of file ServerRequestInfo.cpp.

References ACE_ENV_ARG_PARAMETER, and ACE_THROW_RETURN.

00551 {
00552   // Implemented in the generated skeleton.
00553 
00554   PortableServer::Servant const servant =
00555     (this->servant_upcall_ == 0
00556      ? 0
00557      : this->servant_upcall_->servant ());
00558 
00559 
00560   if (servant == 0)
00561     {
00562       ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1,
00563                                              CORBA::COMPLETED_NO),
00564                         0);
00565     }
00566 
00567   return servant->_is_a (id
00568                          ACE_ENV_ARG_PARAMETER);
00569 }

char * TAO::ServerRequestInfo::target_most_derived_interface  )  throw (CORBA::SystemException) [virtual]
 

Return the most derived interface of the target object.

Definition at line 468 of file ServerRequestInfo.cpp.

References ACE_THROW_RETURN, and CORBA::string_dup().

00471 {
00472   PortableServer::Servant const servant =
00473     (this->servant_upcall_ == 0
00474      ? 0
00475      : this->servant_upcall_->servant ());
00476 
00477   if (servant == 0)
00478     {
00479       ACE_THROW_RETURN (CORBA::NO_RESOURCES (CORBA::OMGVMCID | 1,
00480                                              CORBA::COMPLETED_NO),
00481                         0);
00482     }
00483 
00484   return CORBA::string_dup (servant->_interface_repository_id ());
00485 }


Member Data Documentation

TAO::Argument* const* const TAO::ServerRequestInfo::args_ [protected]
 

Operation argument list.

Definition at line 284 of file ServerRequestInfo.h.

CORBA::TypeCode_ptr const* const TAO::ServerRequestInfo::exceptions_ [protected]
 

Array of TypeCodes for user exceptions the operation is capable of raising.

Definition at line 295 of file ServerRequestInfo.h.

size_t const TAO::ServerRequestInfo::nargs_ [protected]
 

Number of element in the operation argument list.

Definition at line 287 of file ServerRequestInfo.h.

CORBA::ULong const TAO::ServerRequestInfo::nexceptions_ [protected]
 

The number of elements in the exceptions_ array.

Definition at line 298 of file ServerRequestInfo.h.

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 291 of file ServerRequestInfo.h.

TAO_ServerRequest& TAO::ServerRequestInfo::server_request_ [protected]
 

Underlying request object that contains much of the information encapsulated by this ServerRequestInfo implementation.

Definition at line 281 of file ServerRequestInfo.h.

Referenced by forward_reference(), and server_request().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:54:37 2006 for TAO_PI_Server by doxygen 1.3.6