TAO_ClientRequestInfo Class Reference

Implementation of the PortableInterceptor::ClientRequestInfo interface. More...

#include <ClientRequestInfo.h>

Inheritance diagram for TAO_ClientRequestInfo:

Inheritance graph
[legend]
Collaboration diagram for TAO_ClientRequestInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_ClientRequestInfo (TAO::Invocation_Base *invocation)
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::ContextListcontexts () throw (CORBA::SystemException)
virtual Dynamic::RequestContextoperation_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)
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::Object_ptr target () throw (CORBA::SystemException)
virtual CORBA::Object_ptr effective_target () throw (CORBA::SystemException)
virtual IOP::TaggedProfileeffective_profile () throw (CORBA::SystemException)
virtual CORBA::Any * received_exception () throw (CORBA::SystemException)
virtual char * received_exception_id () throw (CORBA::SystemException)
 Return the repository ID for the received exception.

virtual IOP::TaggedComponentget_effective_component (IOP::ComponentId id) throw (CORBA::SystemException)
virtual IOP::TaggedComponentSeqget_effective_components (IOP::ComponentId id) throw (CORBA::SystemException)
virtual CORBA::Policy_ptr get_request_policy (CORBA::PolicyType type) throw (CORBA::SystemException)
virtual void add_request_service_context (const IOP::ServiceContext &service_context, CORBA::Boolean replace) throw (CORBA::SystemException)
void tao_ft_expiration_time (TimeBase::TimeT time)
 Set the absolute FT expiration time for this request.

TimeBase::TimeT tao_ft_expiration_time (void) const
 Get the absolute FT expiration time for this request.

void tao_ft_retention_id (CORBA::Long request_id)
 Set the FT request retention ID for this request.

CORBA::Long tao_ft_retention_id (void) const
 Get the FT request retention ID for this request.


Private Member Functions

bool parameter_list (Dynamic::ParameterList &param_list)
bool exception_list (Dynamic::ExceptionList &exception_list)
bool result (CORBA::Any *any)
void check_validity ()
void setup_picurrent (void)
IOP::ServiceContextget_service_context_i (TAO_Service_Context &service_context_list, IOP::ServiceId id) throw (CORBA::SystemException)
 Helper method to get the request and response service contexts.


Private Attributes

TAO::Invocation_Baseinvocation_
 Pointer to the invocation object.

TAO::PICurrent_Impl rs_pi_current_

Detailed Description

Implementation of the PortableInterceptor::ClientRequestInfo interface.

Definition at line 72 of file ClientRequestInfo.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_ClientRequestInfo::TAO_ClientRequestInfo TAO::Invocation_Base invocation  ) 
 

Definition at line 30 of file ClientRequestInfo.cpp.

References setup_picurrent().

00031   : invocation_ (inv),
00032     rs_pi_current_ ()
00033 {
00034   this->setup_picurrent ();
00035 }


Member Function Documentation

void TAO_ClientRequestInfo::add_request_service_context const IOP::ServiceContext service_context,
CORBA::Boolean  replace
throw (CORBA::SystemException) [virtual]
 

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

Definition at line 346 of file ClientRequestInfo.cpp.

References ACE_CHECK, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, and TAO_Service_Context::set_context().

00351 {
00352   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00353   ACE_CHECK;
00354 
00355   // Get the service context from the list
00356   TAO_Service_Context &service_context_list =
00357     this->invocation_->request_service_context ();
00358 
00359   if (service_context_list.set_context (service_context, replace) == 0)
00360     {
00361       ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 15,
00362                                        CORBA::COMPLETED_NO));
00363     }
00364 }

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

Return the list of arguments passed to the current operation.

Definition at line 464 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and TAO_RequestInfo_Util::make_parameter_list().

00466 {
00467   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00468   ACE_CHECK_RETURN (0);
00469 
00470   // Generate the argument list on demand.
00471   Dynamic::ParameterList *parameter_list =
00472     TAO_RequestInfo_Util::make_parameter_list (ACE_ENV_SINGLE_ARG_PARAMETER);
00473   ACE_CHECK_RETURN (0);
00474 
00475   Dynamic::ParameterList_var safe_parameter_list = parameter_list;
00476 
00477   if (this->parameter_list (*parameter_list) == false)
00478     ACE_THROW_RETURN (CORBA::MARSHAL (),
00479                       0);
00480 
00481   return safe_parameter_list._retn ();
00482 
00483   //return this->invocation_->arguments (ACE_ENV_SINGLE_ARG_PARAMETER);
00484 }

void TAO_ClientRequestInfo::check_validity  )  [private]
 

Check if this ClientRequestInfo object is called within the context of a request.

Definition at line 712 of file ClientRequestInfo.cpp.

References ACE_THROW.

00713 {
00714   if (this->invocation_ == 0)
00715     ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00716                                      CORBA::COMPLETED_NO));
00717 }

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

Definition at line 548 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00550 {
00551   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00552   ACE_CHECK_RETURN (0);
00553 
00554   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00555                                           CORBA::COMPLETED_NO),
00556                     0);
00557 }

IOP::TaggedProfile * TAO_ClientRequestInfo::effective_profile  )  throw (CORBA::SystemException) [virtual]
 

Definition at line 106 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, ACE_THROW_RETURN, TAO_Profile::create_tagged_profile(), IOP::TaggedProfile::profile_data, TAO_Stub::profile_in_use(), and IOP::TaggedProfile::tag.

00108 {
00109   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00110   ACE_CHECK_RETURN (0);
00111 
00112   IOP::TaggedProfile *tagged_profile = 0;
00113   ACE_NEW_THROW_EX (tagged_profile,
00114                     IOP::TaggedProfile,
00115                     CORBA::NO_MEMORY (
00116                       CORBA::SystemException::_tao_minor_code (
00117                         TAO::VMCID,
00118                         ENOMEM),
00119                       CORBA::COMPLETED_NO));
00120   ACE_CHECK_RETURN (0);
00121 
00122   IOP::TaggedProfile_var safe_tagged_profile = tagged_profile;
00123 
00124   TAO_Stub *stub =
00125     this->invocation_->effective_target ()->_stubobj ();
00126 
00127   IOP::TaggedProfile *ep =
00128     stub->profile_in_use ()->create_tagged_profile ();
00129 
00130   if (ep == 0)
00131     {
00132       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
00133                                           CORBA::COMPLETED_NO),
00134                                           0);
00135     }
00136 
00137   // @@BAD_PARAM exception
00138   tagged_profile->tag = ep->tag;
00139   tagged_profile->profile_data = ep->profile_data;  // Deep copy
00140 
00141   return safe_tagged_profile._retn ();
00142 }

CORBA::Object_ptr TAO_ClientRequestInfo::effective_target  )  throw (CORBA::SystemException) [virtual]
 

Return the object reference for the current target. The target may change in the even of a location forward.

Definition at line 96 of file ClientRequestInfo.cpp.

References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, and ACE_ENV_SINGLE_ARG_PARAMETER.

00098 {
00099   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00100   ACE_CHECK_RETURN (CORBA::Object::_nil ());
00101 
00102   return CORBA::Object::_duplicate (this->invocation_->effective_target ());
00103 }

bool TAO_ClientRequestInfo::exception_list Dynamic::ExceptionList &  exception_list  )  [private]
 

Definition at line 525 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::ex_count(), TAO_Operation_Details::ex_data(), CORBA::is_nil(), TAO::Invocation_Base::operation_details(), and TAO::Exception_Data::tc_ptr.

00526 {
00527 
00528   if (this->invocation_->operation_details ().ex_count ())
00529     {
00530       exception_list.length (this->invocation_->operation_details ().ex_count ());
00531 
00532       for (CORBA::ULong i = 0;
00533            i != this->invocation_->operation_details ().ex_count ();
00534            ++i)
00535         {
00536           CORBA::TypeCode_ptr tcp =
00537             this->invocation_->operation_details ().ex_data ()[i].tc_ptr;
00538           if (!CORBA::is_nil (tcp))
00539             {
00540               exception_list[i] = tcp;
00541             }
00542         }
00543     }
00544   return true;
00545 }

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

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

Definition at line 505 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and TAO_RequestInfo_Util::make_exception_list().

00507 {
00508   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00509   ACE_CHECK_RETURN (0);
00510 
00511   Dynamic::ExceptionList *exception_list =
00512     TAO_RequestInfo_Util::make_exception_list (ACE_ENV_SINGLE_ARG_PARAMETER);
00513   ACE_CHECK_RETURN (0);
00514 
00515   Dynamic::ExceptionList_var safe_exception_list = exception_list;
00516 
00517   if (this->exception_list (*exception_list) == false)
00518     ACE_THROW_RETURN (CORBA::MARSHAL (),
00519                       0);
00520 
00521   return safe_exception_list._retn ();
00522 }

CORBA::Object_ptr TAO_ClientRequestInfo::forward_reference  )  throw (CORBA::SystemException) [virtual]
 

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

Definition at line 643 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00645 {
00646   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00647   ACE_CHECK_RETURN (CORBA::Object::_nil ());
00648 
00649   if (this->invocation_->reply_status() != PortableInterceptor::LOCATION_FORWARD)
00650     {
00651       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00652                                               CORBA::COMPLETED_NO),
00653                         CORBA::Object::_nil ());
00654     }
00655 
00656   // TAO::Invocation_Base::forward_reference() already duplicates the
00657   // reference before returning it so there is no need to duplicate it
00658   // here.
00659   return this->invocation_->forwarded_reference ();
00660 }

IOP::TaggedComponent * TAO_ClientRequestInfo::get_effective_component IOP::ComponentId  id  )  throw (CORBA::SystemException) [virtual]
 

Return the first IOP::TaggedComponent that matches the given IOP::ComponentId in the object reference for the current target.

Definition at line 209 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, ACE_THROW_RETURN, TAO_Tagged_Components::components(), TAO::unbounded_value_sequence< TaggedComponent >::length(), TAO_Stub::profile_in_use(), and TAO_Profile::tagged_components().

00213 {
00214   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00215   ACE_CHECK_RETURN (0);
00216 
00217   TAO_Stub *stub =
00218     this->invocation_->effective_target ()->_stubobj ();
00219 
00220   TAO_Tagged_Components &ecs =
00221     stub->profile_in_use ()->tagged_components ();
00222 
00223   IOP::MultipleComponentProfile &components = ecs.components ();
00224 
00225   const CORBA::ULong len = components.length ();
00226   for (CORBA::ULong i = 0; i < len; ++i)
00227     {
00228       if (components[i].tag == id)
00229         {
00230           IOP::TaggedComponent *tagged_component = 0;
00231 
00232           // Only allocate a sequence if we have a tagged component
00233           // that matches the given IOP::ComponentId.
00234           ACE_NEW_THROW_EX (tagged_component,
00235                             IOP::TaggedComponent,
00236                             CORBA::NO_MEMORY (
00237                               CORBA::SystemException::_tao_minor_code (
00238                                 TAO::VMCID,
00239                                 ENOMEM),
00240                               CORBA::COMPLETED_NO));
00241           ACE_CHECK_RETURN (0);
00242 
00243           IOP::TaggedComponent_var safe_tagged_component =
00244             tagged_component;
00245 
00246           (*tagged_component) = components[i];  // Deep copy
00247 
00248           return safe_tagged_component._retn ();
00249         }
00250     }
00251 
00252   // No tagged component was found that matched the given
00253   // IOP::ComponentId.
00254   ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
00255                                       CORBA::COMPLETED_NO),
00256                     0);
00257 }

IOP::TaggedComponentSeq * TAO_ClientRequestInfo::get_effective_components IOP::ComponentId  id  )  throw (CORBA::SystemException) [virtual]
 

Return all IOP::TaggedComponent(s) that match the given IOP::ComponentId in the object reference for the current target.

Definition at line 260 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, ACE_THROW_RETURN, TAO_Tagged_Components::components(), TAO::unbounded_value_sequence< TaggedComponent >::length(), TAO_Stub::profile_in_use(), and TAO_Profile::tagged_components().

00264 {
00265   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00266   ACE_CHECK_RETURN (0);
00267 
00268   TAO_Stub *stub =
00269     this->invocation_->target ()->_stubobj ();
00270 
00271   TAO_Tagged_Components &ecs =
00272     stub->profile_in_use ()->tagged_components ();
00273 
00274   IOP::MultipleComponentProfile &components = ecs.components ();
00275 
00276   IOP::TaggedComponentSeq *tagged_components = 0;
00277   IOP::TaggedComponentSeq_var safe_tagged_components;
00278 
00279   const CORBA::ULong len = components.length ();
00280   for (CORBA::ULong i = 0; i < len; ++i)
00281     {
00282       if (components[i].tag == id)
00283         {
00284           if (tagged_components == 0)
00285             {
00286               // Only allocate a sequence if we have tagged components
00287               // to place into the sequence.
00288               ACE_NEW_THROW_EX (tagged_components,
00289                                 IOP::TaggedComponentSeq,
00290                                 CORBA::NO_MEMORY (
00291                                   CORBA::SystemException::_tao_minor_code (
00292                                     TAO::VMCID,
00293                                     ENOMEM),
00294                                   CORBA::COMPLETED_NO));
00295               ACE_CHECK_RETURN (0);
00296 
00297               safe_tagged_components = tagged_components;
00298             }
00299 
00300           const CORBA::ULong old_len = safe_tagged_components->length ();
00301           safe_tagged_components->length (old_len + 1);
00302 
00303           safe_tagged_components[old_len] = components[i];  // Deep copy
00304         }
00305     }
00306 
00307   if (tagged_components == 0)
00308     {
00309       // No tagged component sequence was allocated, meaning no tagged
00310       // components were found that matched the given
00311       // IOP::ComponentId.
00312       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
00313                                           CORBA::COMPLETED_NO),
00314                         0);
00315     }
00316 
00317   return safe_tagged_components._retn ();
00318 }

IOP::ServiceContext * TAO_ClientRequestInfo::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 694 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, and ACE_ENV_SINGLE_ARG_PARAMETER.

00698 {
00699   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00700   ACE_CHECK_RETURN (0);
00701 
00702   // Get the service context from the list
00703   TAO_Service_Context &service_context_list =
00704     this->invocation_->reply_service_context ();
00705 
00706   return this->get_service_context_i (service_context_list,
00707                                       id
00708                                       ACE_ENV_ARG_PARAMETER);
00709 }

CORBA::Policy_ptr TAO_ClientRequestInfo::get_request_policy CORBA::PolicyType  type  )  throw (CORBA::SystemException) [virtual]
 

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

Definition at line 321 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and ENOTSUP.

00324 {
00325   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00326   ACE_CHECK_RETURN (CORBA::Policy::_nil ());
00327 
00328   // @@ Do we need to look anywhere else for the request policies?
00329 
00330 #if TAO_HAS_CORBA_MESSAGING == 1
00331   return this->invocation_->target ()->_get_policy (type
00332                                                     ACE_ENV_ARG_PARAMETER);
00333 #else
00334   ACE_UNUSED_ARG (type);
00335 
00336   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00337                       CORBA::SystemException::_tao_minor_code (
00338                         TAO::VMCID,
00339                         ENOTSUP),
00340                       CORBA::COMPLETED_NO),
00341                     0);
00342 #endif  /* TAO_HAS_CORBA_MESSAGING == 1 */
00343 }

IOP::ServiceContext * TAO_ClientRequestInfo::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 676 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, and ACE_ENV_SINGLE_ARG_PARAMETER.

00680 {
00681   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00682   ACE_CHECK_RETURN (0);
00683 
00684   // Get the service context from the list
00685   TAO_Service_Context &service_context_list =
00686     this->invocation_->request_service_context ();
00687 
00688   return this->get_service_context_i (service_context_list,
00689                                       id
00690                                       ACE_ENV_ARG_PARAMETER);
00691 }

IOP::ServiceContext * TAO_ClientRequestInfo::get_service_context_i TAO_Service_Context service_context_list,
IOP::ServiceId  id
throw (CORBA::SystemException) [private]
 

Helper method to get the request and response service contexts.

Definition at line 63 of file ClientRequestInfo.cpp.

References ACE_THROW_RETURN.

00068 {
00069   IOP::ServiceContext_var service_context;
00070 
00071   if (service_context_list.get_context (id, service_context.out ()) != 0)
00072     {
00073       // Found.
00074       return service_context._retn ();
00075     }
00076   else
00077     {
00078       // Not found.
00079       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 26,
00080                                           CORBA::COMPLETED_NO),
00081                         0);
00082     }
00083 }

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

Definition at line 663 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, and ACE_ENV_SINGLE_ARG_PARAMETER.

00667 {
00668   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00669   ACE_CHECK_RETURN (0);
00670 
00671   return this->rs_pi_current_.get_slot (id
00672                                         ACE_ENV_ARG_PARAMETER);
00673 }

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

Return the operation name for the current request.

Definition at line 453 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and CORBA::string_dup().

00455 {
00456   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00457   ACE_CHECK_RETURN (0);
00458 
00459   return CORBA::string_dup (
00460     this->invocation_->operation_details ().opname  ());
00461 }

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

Definition at line 560 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00562 {
00563   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00564   ACE_CHECK_RETURN (0);
00565 
00566   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00567                                           CORBA::COMPLETED_NO),
00568                     0);
00569 }

bool TAO_ClientRequestInfo::parameter_list Dynamic::ParameterList &  param_list  )  [private]
 

Definition at line 487 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::args(), TAO_Operation_Details::args_num(), TAO::Argument::interceptor_value(), TAO::Argument::mode(), and TAO::Invocation_Base::operation_details().

00488 {
00489   // Account for the return type that could be in the argument list.
00490   param_list.length (this->invocation_->operation_details ().args_num () - 1);
00491 
00492   for (CORBA::ULong i = 1; i != this->invocation_->operation_details ().args_num (); ++i)
00493     {
00494       TAO::Argument *argument =
00495         this->invocation_->operation_details ().args ()[i];
00496       Dynamic::Parameter &p = param_list[i - 1];
00497       p.mode = argument->mode ();
00498       argument->interceptor_value (&p.argument);
00499     }
00500 
00501   return true;
00502 }

CORBA::Any * TAO_ClientRequestInfo::received_exception  )  throw (CORBA::SystemException) [virtual]
 

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

Definition at line 148 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_NEW_THROW_EX, and ACE_THROW_RETURN.

00150 {
00151   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00152   ACE_CHECK_RETURN (0);
00153 
00154   if (this->invocation_->reply_status () != PortableInterceptor::SYSTEM_EXCEPTION
00155       && this->invocation_->reply_status () != PortableInterceptor::USER_EXCEPTION)
00156     {
00157       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00158                                               CORBA::COMPLETED_NO), 0);
00159     }
00160 
00161   // The spec says that if it is a user exception which can't be
00162   // inserted then the UNKNOWN exception needs to be thrown with minor
00163   // code 1.
00164 
00165   CORBA::Any * temp = 0;
00166 
00167   ACE_NEW_THROW_EX (temp,
00168                     CORBA::Any,
00169                     CORBA::NO_MEMORY (
00170                       CORBA::SystemException::_tao_minor_code (
00171                         TAO::VMCID,
00172                         ENOMEM),
00173                       CORBA::COMPLETED_NO));
00174   ACE_CHECK_RETURN (0);
00175 
00176   CORBA::Any_var caught_exception_var = temp;
00177 
00178   CORBA::Exception *caught_exception =
00179     invocation_->caught_exception ();
00180 
00181   if (caught_exception != 0)
00182     *temp <<= *(caught_exception);
00183 
00184   return caught_exception_var._retn ();
00185 }

char * TAO_ClientRequestInfo::received_exception_id  )  throw (CORBA::SystemException) [virtual]
 

Return the repository ID for the received exception.

Definition at line 188 of file ClientRequestInfo.cpp.

References CORBA::Exception::_rep_id(), ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and CORBA::string_dup().

00191 {
00192   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00193   ACE_CHECK_RETURN (0);
00194 
00195   CORBA::Exception *caught_exception =
00196     invocation_->caught_exception ();
00197 
00198   if (caught_exception == 0)
00199     {
00200       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00201                                               CORBA::COMPLETED_NO),
00202                         0);
00203     }
00204 
00205   return CORBA::string_dup (caught_exception->_rep_id ());
00206 }

PortableInterceptor::ReplyStatus TAO_ClientRequestInfo::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 625 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, and ACE_THROW_RETURN.

00627 {
00628   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00629   ACE_CHECK_RETURN (PortableInterceptor::SYSTEM_EXCEPTION);
00630 
00631   if (this->invocation_->reply_status() == -1)
00632     {
00633       // A reply hasn't been received yet.
00634       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00635                                               CORBA::COMPLETED_NO),
00636                         -1);
00637     }
00638 
00639   return this->invocation_->reply_status();
00640 }

CORBA::ULong TAO_ClientRequestInfo::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 367 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_ERROR, ACE_THROW_RETURN, LM_ERROR, and TAO_debug_level.

00369 {
00370   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00371   ACE_CHECK_RETURN (0);
00372 
00373   // @todo We may have to worry about AMI once we support interceptors
00374   //       in AMI requests since the Invocation object no longer
00375   //       exists once an AMI request has been made.  In that case,
00376   //       the reply dispatcher address should be used.
00377 
00378   // The request ID must be unique across all outstanding requests.
00379   // To avoid synchronization overhead, the address of this Invocation
00380   // object is used as the request ID.  This guarantees that the
00381   // request ID is unique without being forced to acquire a lock.
00382   //
00383   // For 64-bit platforms, we right shift 8 bits and then use the
00384   // lower 32 bits of that shifted value.  Rather than losing the
00385   // upper 32 bits of significant digits by taking the lower 32 bits,
00386   // we only lose the upper 24 by doing the shift.  Basically, the
00387   // resulting request ID will comprised of bits 8 through 39.  This is
00388   // made possible by the fact that this Invocation object is large
00389   // enough to increase the likelihood that those bits (0 through 39)
00390   // are unique.  In particular, this->buffer_ is 512 bytes
00391   // (ACE_CDR::DEFAULT_BUFSIZE) long by default; implying that
00392   // dropping the lower 8 bits of the this Invocation object's 64 bit
00393   // address (i.e. 256 bytes) is not a problem.
00394 
00395   CORBA::ULong id = 0;
00396 
00397   // Note that we reinterpret_cast to an "unsigned long" instead of
00398   // CORBA::ULong since we need to first cast to an integer large
00399   // enough to hold an address to avoid compile-time warnings on some
00400   // 64-bit platforms.
00401 
00402   // 32 bit address
00403   if (sizeof (this) == 4)
00404     id =
00405       static_cast<CORBA::ULong> (
00406         reinterpret_cast<ptrdiff_t> (this->invocation_));
00407 
00408   // 64 bit address -- bits 8 through 39  (see notes above!)
00409   // In this case, we make sure this object is large enough to safely
00410   // do the right shift.  This is necessary since the size of the
00411   // buffer that makes this object is configurable.
00412   else if (sizeof (this) == 8
00413            && sizeof (*(this->invocation_)) > 256 /* 2 << 8 */)
00414     id =
00415       (static_cast<CORBA::ULong> (
00416          reinterpret_cast<ptrdiff_t> (this->invocation_)) >> 8) & 0xFFFFFFFFu;
00417 
00418   // 64 bit address -- lower 32 bits
00419   else if (sizeof (this) == 8)
00420     id =
00421       static_cast<CORBA::ULong> (
00422         reinterpret_cast<ptrdiff_t> (this->invocation_)) & 0xFFFFFFFFu;
00423 
00424   // @@ The following request ID generator prevents the
00425   //    PortableInterceptor::ClientRequestInterceptor::send_request()
00426   //    interception point from occuring before the call to connect,
00427   //    thus preventing us from adding an optimization that itself
00428   //    prevents a connection from being unnecessarily performed.
00429   //    Thus, the ClientRequestInfo object is forced to have its own
00430   //    request ID generator in order to make it possible to implement
00431   //    the above optimization.
00432   //
00433   //    Ideally, this request ID generator should go away, especially
00434   //    since it adds a lock to the critical path.
00435   //   else    // Fallback
00436   //     id = this->invocation_->request_id ();
00437 
00438   else
00439     {
00440       if (TAO_debug_level > 0)
00441         ACE_ERROR ((LM_ERROR,
00442                     "(%P|%t) ClientRequestInfo::request_id() failed\n"
00443                     "(%P|%t) since its request ID generator is not\n"
00444                     "(%P|%t) supported on this platform.\n"));
00445 
00446       ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
00447     }
00448 
00449   return id;
00450 }

CORBA::Boolean TAO_ClientRequestInfo::response_expected  )  throw (CORBA::SystemException) [virtual]
 

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

Definition at line 605 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, and ACE_ENV_SINGLE_ARG_PARAMETER.

00607 {
00608   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00609   ACE_CHECK_RETURN (0);
00610 
00611   return this->invocation_->response_expected ();
00612 }

bool TAO_ClientRequestInfo::result CORBA::Any *  any  )  [private]
 

Definition at line 594 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::args(), TAO::Argument::interceptor_value(), and TAO::Invocation_Base::operation_details().

00595 {
00596   // Result is always first element in TAO::Argument array.
00597   TAO::Argument * const r = this->invocation_->operation_details ().args ()[0];
00598 
00599   r->interceptor_value (any);
00600 
00601   return true;
00602 }

CORBA::Any * TAO_ClientRequestInfo::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 is method is not valid for oneway operations.

Definition at line 572 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW_RETURN, and TAO_RequestInfo_Util::make_any().

00574 {
00575   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00576   ACE_CHECK_RETURN (0);
00577 
00578   // Generate the result on demand.
00579   static const CORBA::Boolean tk_void_any = 0;
00580   CORBA::Any *result_any =
00581     TAO_RequestInfo_Util::make_any (tk_void_any ACE_ENV_ARG_PARAMETER);
00582   ACE_CHECK_RETURN (0);
00583 
00584   CORBA::Any_var safe_result_any = result_any;
00585 
00586   if (this->result (result_any) == false)
00587     ACE_THROW_RETURN (CORBA::MARSHAL (),
00588                       0);
00589 
00590   return safe_result_any._retn ();
00591 }

void TAO_ClientRequestInfo::setup_picurrent void   )  [private]
 

Setup thread scope and request scope PortableInterceptor::Current objects.

Definition at line 38 of file ClientRequestInfo.cpp.

References TAO::Invocation_Base::orb_core(), TAO_ORB_Core::pi_current(), TAO::PICurrent::slot_count(), TAO::PICurrent_Impl::take_lazy_copy(), and TAO::PICurrent::tsc().

Referenced by TAO_ClientRequestInfo().

00039 {
00040   // Retrieve the thread scope current (no TSS access incurred yet).
00041   CORBA::Object_ptr pi_current_obj =
00042     this->invocation_->orb_core ()->pi_current ();
00043 
00044   TAO::PICurrent *pi_current =
00045     dynamic_cast <TAO::PICurrent*> (pi_current_obj);
00046 
00047   // If the slot count is zero, then there is nothing to copy.
00048   // Prevent any copying (and hence TSS accesses) from occurring.
00049   if (pi_current != 0 && pi_current->slot_count () != 0)
00050     {
00051       // Retrieve the thread scope current.
00052       TAO::PICurrent_Impl *tsc = pi_current->tsc ();
00053 
00054       if (tsc != 0)
00055         {
00056           // Logically copy the TSC's slot table to the RSC.
00057           this->rs_pi_current_.take_lazy_copy (tsc);
00058        }
00059     }
00060 }

Messaging::SyncScope TAO_ClientRequestInfo::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 615 of file ClientRequestInfo.cpp.

References ACE_CHECK_RETURN, and ACE_ENV_SINGLE_ARG_PARAMETER.

00617 {
00618   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00619   ACE_CHECK_RETURN (0);
00620 
00621   return this->invocation_->operation_details ().response_flags ();
00622 }

TimeBase::TimeT TAO_ClientRequestInfo::tao_ft_expiration_time void   )  const
 

Get the absolute FT expiration time for this request.

Definition at line 726 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::ft_expiration_time(), and TAO::Invocation_Base::operation_details().

00727 {
00728   return this->invocation_->operation_details ().ft_expiration_time ();
00729 }

void TAO_ClientRequestInfo::tao_ft_expiration_time TimeBase::TimeT  time  ) 
 

Set the absolute FT expiration time for this request.

Definition at line 720 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::ft_expiration_time(), and TAO::Invocation_Base::operation_details().

00721 {
00722   this->invocation_->operation_details ().ft_expiration_time (time);
00723 }

CORBA::Long TAO_ClientRequestInfo::tao_ft_retention_id void   )  const
 

Get the FT request retention ID for this request.

Definition at line 738 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::ft_retention_id(), and TAO::Invocation_Base::operation_details().

00739 {
00740   return this->invocation_->operation_details ().ft_retention_id ();
00741 }

void TAO_ClientRequestInfo::tao_ft_retention_id CORBA::Long  request_id  ) 
 

Set the FT request retention ID for this request.

Definition at line 732 of file ClientRequestInfo.cpp.

References TAO_Operation_Details::ft_retention_id(), and TAO::Invocation_Base::operation_details().

00733 {
00734   this->invocation_->operation_details ().ft_retention_id (request_id) ;
00735 }

CORBA::Object_ptr TAO_ClientRequestInfo::target  )  throw (CORBA::SystemException) [virtual]
 

Return the (initial, non-forwarded, or permanently forwarded) object reference of the target.

Definition at line 86 of file ClientRequestInfo.cpp.

References CORBA::Object::_duplicate(), ACE_CHECK_RETURN, and ACE_ENV_SINGLE_ARG_PARAMETER.

00088 {
00089   this->check_validity (ACE_ENV_SINGLE_ARG_PARAMETER);
00090   ACE_CHECK_RETURN (CORBA::Object::_nil ());
00091 
00092   return CORBA::Object::_duplicate (this->invocation_->target ());
00093 }


Member Data Documentation

TAO::Invocation_Base* TAO_ClientRequestInfo::invocation_ [private]
 

Pointer to the invocation object.

Definition at line 271 of file ClientRequestInfo.h.

TAO::PICurrent_Impl TAO_ClientRequestInfo::rs_pi_current_ [private]
 

The "Request Scope Current" (RSC) object, as required by Portable Interceptors.

Definition at line 275 of file ClientRequestInfo.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:52:25 2006 for TAO_PI by doxygen 1.3.6