TAO::Invocation_Base Class Reference

The base class for the invocation object. More...

#include <Invocation_Base.h>

Inheritance diagram for TAO::Invocation_Base:

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

Collaboration graph
[legend]
List of all members.

[NOHEADER]

size_t & stack_size (void)
CORBA::Exceptioncaught_exception (void)
TAO::Invocation_Status invoke_status (void) const
 Invoke status.

PortableInterceptor::ReplyStatus reply_status (void) const
bool is_remote_request () const
void exception CORBA::Exceptionexception
 Change the exception status.

Invocation_Status send_request_interception () throw (CORBA::SystemException)
Invocation_Status receive_reply_interception () throw (CORBA::SystemException)
Invocation_Status receive_other_interception () throw (CORBA::SystemException)
PortableInterceptor::ReplyStatus handle_any_exception (CORBA::Exception *e)
PortableInterceptor::ReplyStatus handle_all_exception ()
ClientRequestInterceptor_Adapteradapter_
 The client requestor adapter.

size_t stack_size_
TAO::Invocation_Status invoke_status_
CORBA::Exceptioncaught_exception_
 Pointer to the caught exception.

bool is_remote_request_

Public Member Functions

virtual ~Invocation_Base (void)
TAO_ORB_Coreorb_core (void) const
TAO_Stubstub (void) const
CORBA::Object_ptr forwarded_reference (void)
void forwarded_reference (CORBA::Object_ptr o)
TAO_Service_Contextrequest_service_context (void)
 Accessors for the service context list.

TAO_Service_Contextreply_service_context (void)
CORBA::Object_ptr steal_forwarded_reference (void)
 Return the forwarded object location by loosing ownership.

bool is_forwarded (void) const
 Did the invocation got forwarded to a new location?

void reply_received (Invocation_Status s)
 Mutator to set the reply status of the invocation.

CORBA::Object_ptr effective_target (void) const
 Return the effective target of the invocation.

CORBA::Object_ptr target (void) const
 Return the target object.

CORBA::Boolean response_expected (void) const
 Does this invocation return a response?

TAO_Operation_Detailsoperation_details (void)
 The operaton details of the invocation.


Protected Member Functions

 Invocation_Base (CORBA::Object_ptr otarget, CORBA::Object_ptr target, TAO_Stub *stub, TAO_Operation_Details &op, bool response_expected, bool request_is_remote)

Protected Attributes

TAO_Operation_Detailsdetails_
 The operation details on which we are operating on.

CORBA::Object_var forwarded_to_
 Forwarded object reference.

bool response_expected_
 Is response expected?


Private Member Functions

 Invocation_Base (const Invocation_Base &)
Invocation_Baseoperator= (const Invocation_Base &)

Private Attributes

CORBA::Object_ptr otarget_
 The original target on which the invocation was started.

CORBA::Object_ptr target_
 The effective target on which the invocation is on.

TAO_ORB_Coreorb_core_
 Cache the ORB_Core.

TAO_Stubstub_
 The original target on which the invocation was started.


Detailed Description

The base class for the invocation object.

This class is the base of the invocation object hiererachy. This hierarchy is classified based on the type of invocation and the mode of invocation. One of the objects from the hierarchy is created on the stack for every invocation.

In addition this class encapsulates the essential details that are required for PortableInterceptors to function correctly. Further this class also provides some helper and accessor methods that are used by clients.

Definition at line 58 of file Invocation_Base.h.


Constructor & Destructor Documentation

TAO::Invocation_Base::~Invocation_Base void   )  [virtual]
 

Definition at line 55 of file Invocation_Base.cpp.

References adapter_.

00056   {
00057 #if TAO_HAS_INTERCEPTORS == 1
00058     adapter_ = 0;
00059 #endif /*TAO_HAS_INTERCEPTORS == 1*/
00060   }

TAO::Invocation_Base::Invocation_Base CORBA::Object_ptr  otarget,
CORBA::Object_ptr  target,
TAO_Stub stub,
TAO_Operation_Details op,
bool  response_expected,
bool  request_is_remote
[protected]
 

Parameters:
otarget The original target on which this invocation was started.
target the target on which this invocation is flowing ie. the effective target
op operation details of the invocation on target
response_expected flag to indicate whether the operation encapsulated by op returns a response or not.

Definition at line 29 of file Invocation_Base.cpp.

References CORBA::Object_ptr, and TAO::TAO_INVOKE_START.

00035     : details_ (details)
00036     , forwarded_to_ (0)
00037     , response_expected_ (response_expected)
00038     , otarget_ (ot)
00039     , target_ (t)
00040     , orb_core_ (stub->orb_core ())
00041     , stub_ (stub)
00042 #if TAO_HAS_INTERCEPTORS == 1
00043     , adapter_ (orb_core_->clientrequestinterceptor_adapter ())
00044     , stack_size_ (0)
00045     , invoke_status_ (TAO_INVOKE_START)
00046     , caught_exception_ (0)
00047     , is_remote_request_ (request_is_remote)
00048 #endif /*TAO_HAS_INTERCEPTORS == 1*/
00049   {
00050 #if TAO_HAS_INTERCEPTORS == 0
00051     ACE_UNUSED_ARG (request_is_remote);
00052 #endif /*TAO_HAS_INTERCEPTORS == 0*/
00053   }

TAO::Invocation_Base::Invocation_Base const Invocation_Base  )  [private]
 


Member Function Documentation

CORBA::Exception* TAO::Invocation_Base::caught_exception void   ) 
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::effective_target void   )  const
 

Return the effective target of the invocation.

Please see the PortableInterceptor specification in the CORBA spec to understand what effective target means.

Definition at line 58 of file Invocation_Base.inl.

Referenced by TAO::Collocated_Invocation::invoke().

00059   {
00060     return this->target_;
00061   }

ACE_INLINE void TAO::Invocation_Base::forwarded_reference CORBA::Object_ptr  o  ) 
 

Definition at line 22 of file Invocation_Base.inl.

References CORBA::Object::_duplicate(), forwarded_to_, and CORBA::Object_ptr.

00023   {
00024     this->forwarded_to_ = CORBA::Object::_duplicate (o);
00025   }

ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::forwarded_reference void   ) 
 

These access methods have to be public so that the PortableInterceptor can use them

Definition at line 28 of file Invocation_Base.inl.

References CORBA::Object::_duplicate().

00029   {
00030     return CORBA::Object::_duplicate (this->forwarded_to_.in ());
00031   }

PortableInterceptor::ReplyStatus TAO::Invocation_Base::handle_all_exception  )  [protected]
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

Definition at line 233 of file Invocation_Base.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, adapter_, exception, TAO::ClientRequestInterceptor_Adapter::receive_exception(), TAO::ClientRequestInterceptor_Adapter::reply_status(), and PortableInterceptor::ReplyStatus.

Referenced by TAO::Collocated_Invocation::invoke().

00234   {
00235     CORBA::UNKNOWN ex;
00236     this->exception (&ex);
00237 
00238     PortableInterceptor::ReplyStatus status =
00239       PortableInterceptor::SYSTEM_EXCEPTION;
00240 
00241     if (adapter_ != 0)
00242       {
00243         this->adapter_->receive_exception (*this
00244                                            ACE_ENV_ARG_PARAMETER);
00245         ACE_CHECK_RETURN (PortableInterceptor::UNKNOWN);
00246 
00247         status =
00248           this->adapter_->reply_status (*this);
00249       }
00250 
00251     return status;
00252   }

PortableInterceptor::ReplyStatus TAO::Invocation_Base::handle_any_exception CORBA::Exception e  )  [protected]
 

Helper methods to handle interception calls when exceptions are thrown by the PortableInterceptor.

Definition at line 211 of file Invocation_Base.cpp.

References ACE_CHECK_RETURN, ACE_ENV_ARG_PARAMETER, adapter_, exception, TAO::ClientRequestInterceptor_Adapter::receive_exception(), TAO::ClientRequestInterceptor_Adapter::reply_status(), and PortableInterceptor::ReplyStatus.

Referenced by TAO::Collocated_Invocation::invoke().

00213   {
00214     this->exception (ex);
00215 
00216     PortableInterceptor::ReplyStatus status =
00217       PortableInterceptor::SYSTEM_EXCEPTION;
00218 
00219     if (adapter_ != 0)
00220       {
00221         this->adapter_->receive_exception (*this
00222                                            ACE_ENV_ARG_PARAMETER);
00223         ACE_CHECK_RETURN (PortableInterceptor::UNKNOWN);
00224 
00225         status =
00226           this->adapter_->reply_status (*this);
00227       }
00228 
00229     return status;
00230   }

TAO::Invocation_Status TAO::Invocation_Base::invoke_status void   )  const
 

Invoke status.

ACE_INLINE bool TAO::Invocation_Base::is_forwarded void   )  const
 

Did the invocation got forwarded to a new location?

Definition at line 40 of file Invocation_Base.inl.

References forwarded_to_, and TAO_Pseudo_Var_T< T >::in().

Referenced by TAO::Invocation_Adapter::invoke_collocated_i(), TAO::Invocation_Adapter::invoke_oneway(), and TAO::Invocation_Adapter::invoke_twoway().

00041   {
00042     return (this->forwarded_to_.in () != 0);
00043   }

bool TAO::Invocation_Base::is_remote_request  )  const
 

Accessor used to determine if the current invocation is part of a remote request, and if not, it will be considered to be part of a collocated request.

ACE_INLINE TAO_Operation_Details & TAO::Invocation_Base::operation_details void   ) 
 

The operaton details of the invocation.

Definition at line 64 of file Invocation_Base.inl.

References details_.

00065   {
00066     return this->details_;
00067   }

Invocation_Base& TAO::Invocation_Base::operator= const Invocation_Base  )  [private]
 

ACE_INLINE TAO_ORB_Core * TAO::Invocation_Base::orb_core void   )  const
 

Definition at line 10 of file Invocation_Base.inl.

Referenced by TAO::Synch_Twoway_Invocation::check_reply_status().

00011   {
00012     return this->orb_core_;
00013   }

Invocation_Status TAO::Invocation_Base::receive_other_interception  )  throw (CORBA::SystemException) [protected]
 

Helper method to invoke receive_other interception call to all the registered interceptors.

Definition at line 171 of file Invocation_Base.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHALL, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY, ACE_TRY_CHECK, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke().

00173   {
00174     if (adapter_ != 0)
00175       {
00176         ACE_TRY
00177           {
00178             this->adapter_->receive_other (*this
00179                                            ACE_ENV_ARG_PARAMETER);
00180             ACE_TRY_CHECK;
00181           }
00182         ACE_CATCHANY
00183           {
00184             (void) this->handle_any_exception (&ACE_ANY_EXCEPTION
00185                                                ACE_ENV_ARG_PARAMETER);
00186             ACE_TRY_CHECK;
00187 
00188             ACE_RE_THROW;
00189           }
00190     # if defined (ACE_HAS_EXCEPTIONS) \
00191          && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
00192         ACE_CATCHALL
00193           {
00194             (void) this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
00195             ACE_TRY_CHECK;
00196 
00197             ACE_RE_THROW;
00198           }
00199     # endif  /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */
00200         ACE_ENDTRY;
00201         ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
00202 
00203         if (this->forwarded_to_.in ())
00204           return TAO_INVOKE_RESTART;
00205       }
00206 
00207     return TAO_INVOKE_SUCCESS;
00208   }

Invocation_Status TAO::Invocation_Base::receive_reply_interception  )  throw (CORBA::SystemException) [protected]
 

Helper method to invoke receive_reply interception call to all the registered interceptors.

Definition at line 126 of file Invocation_Base.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHALL, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY, ACE_TRY_CHECK, PortableInterceptor::ReplyStatus, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke().

00128   {
00129     if (adapter_ != 0)
00130       {
00131         ACE_TRY
00132           {
00133             this->adapter_->receive_reply (*this
00134                                            ACE_ENV_ARG_PARAMETER);
00135             ACE_TRY_CHECK;
00136           }
00137         ACE_CATCHANY
00138           {
00139             (void) this->handle_any_exception (&ACE_ANY_EXCEPTION
00140                                                ACE_ENV_ARG_PARAMETER);
00141             ACE_TRY_CHECK;
00142 
00143             ACE_RE_THROW;
00144           }
00145     # if defined (ACE_HAS_EXCEPTIONS) \
00146          && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
00147         ACE_CATCHALL
00148           {
00149             (void) this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
00150             ACE_TRY_CHECK;
00151 
00152             ACE_RE_THROW;
00153           }
00154     # endif  /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */
00155         ACE_ENDTRY;
00156         ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
00157 
00158         const PortableInterceptor::ReplyStatus status =
00159           this->adapter_->reply_status (*this);
00160 
00161         if (status == PortableInterceptor::LOCATION_FORWARD ||
00162             status == PortableInterceptor::TRANSPORT_RETRY)
00163           return TAO_INVOKE_RESTART;
00164       }
00165 
00166     return TAO_INVOKE_SUCCESS;
00167   }

void TAO::Invocation_Base::reply_received Invocation_Status  s  ) 
 

Mutator to set the reply status of the invocation.

Referenced by TAO::Collocated_Invocation::invoke(), and TAO::Reply_Guard::~Reply_Guard().

TAO_Service_Context & TAO::Invocation_Base::reply_service_context void   ) 
 

Definition at line 75 of file Invocation_Base.cpp.

References details_, and TAO_Operation_Details::reply_service_context().

00076   {
00077     return this->details_.reply_service_context ();
00078   }

PortableInterceptor::ReplyStatus TAO::Invocation_Base::reply_status void   )  const
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

Definition at line 266 of file Invocation_Base.cpp.

References adapter_, and TAO::ClientRequestInterceptor_Adapter::reply_status().

Referenced by TAO::Invocation_Adapter::invoke_collocated_i(), TAO::Invocation_Adapter::invoke_oneway(), and TAO::Invocation_Adapter::invoke_twoway().

00267   {
00268     if (adapter_ != 0)
00269       {
00270         return this->adapter_->reply_status (*this);
00271       }
00272     else
00273       {
00274         return -1;
00275       }
00276   }

TAO_Service_Context & TAO::Invocation_Base::request_service_context void   ) 
 

Accessors for the service context list.

The service context lists are actually cached elsewhere. Providing this accessor helps the PI to access this list in both remote and collocated mode.

Definition at line 69 of file Invocation_Base.cpp.

References details_, and TAO_Operation_Details::request_service_context().

Referenced by TAO::Synch_Twoway_Invocation::check_reply_status().

00070   {
00071     return this->details_.request_service_context ();
00072   }

ACE_INLINE CORBA::Boolean TAO::Invocation_Base::response_expected void   )  const
 

Does this invocation return a response?

Definition at line 46 of file Invocation_Base.inl.

References response_expected_.

Referenced by TAO::Collocated_Invocation::invoke().

00047   {
00048     return this->response_expected_;
00049   }

Invocation_Status TAO::Invocation_Base::send_request_interception  )  throw (CORBA::SystemException) [protected]
 

Helper method to invoke send_request interception call to all the registered interceptors.

Definition at line 83 of file Invocation_Base.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHALL, ACE_CATCHANY, ACE_CHECK_RETURN, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_RE_THROW, ACE_TRY, ACE_TRY_CHECK, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke().

00085   {
00086     if (adapter_ != 0)
00087       {
00088         ACE_TRY
00089           {
00090             this->adapter_->send_request (*this
00091                                           ACE_ENV_ARG_PARAMETER);
00092             ACE_TRY_CHECK;
00093           }
00094         ACE_CATCHANY
00095           {
00096             (void) this->handle_any_exception (&ACE_ANY_EXCEPTION
00097                                                ACE_ENV_ARG_PARAMETER);
00098             ACE_TRY_CHECK;
00099 
00100             // This is a begin interception point
00101             ACE_RE_THROW;
00102           }
00103     # if defined (ACE_HAS_EXCEPTIONS) \
00104          && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS)
00105         ACE_CATCHALL
00106           {
00107             (void) this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
00108             ACE_TRY_CHECK;
00109 
00110             // This is a begin interception point
00111             ACE_RE_THROW;
00112           }
00113     # endif  /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */
00114         ACE_ENDTRY;
00115         ACE_CHECK_RETURN (TAO_INVOKE_FAILURE);
00116 
00117         if (this->forwarded_to_.in ())
00118           return TAO_INVOKE_RESTART;
00119       }
00120 
00121     // What are the other cases??
00122     return TAO_INVOKE_SUCCESS;
00123   }

size_t& TAO::Invocation_Base::stack_size void   ) 
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::steal_forwarded_reference void   ) 
 

Return the forwarded object location by loosing ownership.

Definition at line 34 of file Invocation_Base.inl.

References TAO_Pseudo_Var_T< T >::_retn(), and forwarded_to_.

Referenced by TAO::Invocation_Adapter::invoke_collocated_i(), TAO::Invocation_Adapter::invoke_oneway(), and TAO::Invocation_Adapter::invoke_twoway().

00035   {
00036     return this->forwarded_to_._retn ();
00037   }

ACE_INLINE TAO_Stub * TAO::Invocation_Base::stub void   )  const
 

Definition at line 16 of file Invocation_Base.inl.

00017   {
00018     return this->stub_;
00019   }

ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::target void   )  const
 

Return the target object.

Definition at line 52 of file Invocation_Base.inl.

References otarget_.

00053   {
00054     return this->otarget_;
00055   }


Member Data Documentation

ClientRequestInterceptor_Adapter* TAO::Invocation_Base::adapter_ [protected]
 

The client requestor adapter.

Definition at line 225 of file Invocation_Base.h.

Referenced by handle_all_exception(), handle_any_exception(), reply_status(), and ~Invocation_Base().

CORBA::Exception* TAO::Invocation_Base::caught_exception_ [private]
 

Pointer to the caught exception.

Definition at line 233 of file Invocation_Base.h.

TAO_Operation_Details& TAO::Invocation_Base::details_ [protected]
 

The operation details on which we are operating on.

Definition at line 135 of file Invocation_Base.h.

Referenced by operation_details(), reply_service_context(), and request_service_context().

void TAO::Invocation_Base::exception
 

Change the exception status.

Definition at line 255 of file Invocation_Base.cpp.

Referenced by handle_all_exception(), and handle_any_exception().

00256   {
00257     if (CORBA::SystemException::_downcast (exception) != 0)
00258       this->invoke_status_ = TAO::TAO_INVOKE_SYSTEM_EXCEPTION;
00259     else if (CORBA::UserException::_downcast (exception) != 0)
00260       this->invoke_status_ = TAO::TAO_INVOKE_USER_EXCEPTION;
00261 
00262     this->caught_exception_ = exception;
00263   }

CORBA::Object_var TAO::Invocation_Base::forwarded_to_ [protected]
 

Forwarded object reference.

Definition at line 138 of file Invocation_Base.h.

Referenced by forwarded_reference(), is_forwarded(), and steal_forwarded_reference().

TAO::Invocation_Status TAO::Invocation_Base::invoke_status_ [protected]
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

Definition at line 229 of file Invocation_Base.h.

bool TAO::Invocation_Base::is_remote_request_ [private]
 

Flag used to distinguish a remote invocation versus a collocated (thru-poa) invocation.

Definition at line 237 of file Invocation_Base.h.

TAO_ORB_Core* TAO::Invocation_Base::orb_core_ [private]
 

Cache the ORB_Core.

Definition at line 163 of file Invocation_Base.h.

CORBA::Object_ptr TAO::Invocation_Base::otarget_ [private]
 

The original target on which the invocation was started.

The following object reference pointers are *not* duplicated. They are cached for portable interceptors, and they just live for the lifetime of the request. Hence there is no point in duplicating the pointers.

Definition at line 157 of file Invocation_Base.h.

Referenced by target().

bool TAO::Invocation_Base::response_expected_ [protected]
 

Is response expected?

Definition at line 141 of file Invocation_Base.h.

Referenced by response_expected().

size_t TAO::Invocation_Base::stack_size_ [protected]
 

Note:
It is a reference since the Portable Interceptor flow stack code must be able to modify this value and use that value at a later time without being forced to use TSS.

Definition at line 227 of file Invocation_Base.h.

TAO_Stub* TAO::Invocation_Base::stub_ [private]
 

The original target on which the invocation was started.

The following object reference pointers are *not* duplicated. They are cached for portable interceptors, and they just live for the lifetime of the request. Hence there is no point in duplicating the pointers.

Definition at line 165 of file Invocation_Base.h.

CORBA::Object_ptr TAO::Invocation_Base::target_ [private]
 

The effective target on which the invocation is on.

Definition at line 160 of file Invocation_Base.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:26:22 2006 for TAO by doxygen 1.3.6