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 (void)
Invocation_Status receive_reply_interception (void)
Invocation_Status receive_other_interception (void)
PortableInterceptor::ReplyStatus handle_any_exception (CORBA::Exception *e)
PortableInterceptor::ReplyStatus handle_all_exception (void)
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 59 of file Invocation_Base.cpp.

00060   {
00061 #if TAO_HAS_INTERCEPTORS == 1
00062     adapter_ = 0;
00063 #endif /* TAO_HAS_INTERCEPTORS == 1 */
00064   }

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.

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().

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

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

PortableInterceptor::ReplyStatus TAO::Invocation_Base::handle_all_exception void   )  [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 200 of file Invocation_Base.cpp.

References exception, and PortableInterceptor::ReplyStatus.

Referenced by TAO::Collocated_Invocation::invoke(), receive_other_interception(), receive_reply_interception(), TAO::Synch_Oneway_Invocation::remote_oneway(), TAO::Synch_Twoway_Invocation::remote_twoway(), and send_request_interception().

00201   {
00202     this->exception (&unknown_exception);
00203 
00204     PortableInterceptor::ReplyStatus status =
00205       PortableInterceptor::SYSTEM_EXCEPTION;
00206 
00207     if (adapter_ != 0)
00208       {
00209         this->adapter_->receive_exception (*this);
00210 
00211         status = this->adapter_->reply_status (*this);
00212       }
00213 
00214     return status;
00215   }

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 175 of file Invocation_Base.cpp.

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

Referenced by TAO::Collocated_Invocation::invoke(), receive_other_interception(), receive_reply_interception(), TAO::Synch_Oneway_Invocation::remote_oneway(), TAO::Synch_Twoway_Invocation::remote_twoway(), and send_request_interception().

00176   {
00177     this->exception (ex);
00178 
00179     PortableInterceptor::ReplyStatus status =
00180       PortableInterceptor::SYSTEM_EXCEPTION;
00181 
00182     if (adapter_ != 0)
00183       {
00184         this->adapter_->receive_exception (*this);
00185 
00186         if (this->forwarded_to_.in ())
00187           {
00188             status = PortableInterceptor::LOCATION_FORWARD;
00189           }
00190         else
00191           {
00192             status = this->adapter_->reply_status (*this);
00193           }
00194       }
00195 
00196     return status;
00197   }

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::LocateRequest_Invocation_Adapter::invoke(), 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(), TAO::Synch_Twoway_Invocation::handle_system_exception(), and TAO::Synch_Twoway_Invocation::wait_for_reply().

00011   {
00012     return this->orb_core_;
00013   }

Invocation_Status TAO::Invocation_Base::receive_other_interception void   )  [protected]
 

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

Definition at line 148 of file Invocation_Base.cpp.

References forwarded_to_, handle_all_exception(), handle_any_exception(), TAO_Pseudo_Var_T< T >::in(), TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke(), TAO::Synch_Oneway_Invocation::remote_oneway(), and TAO::Synch_Twoway_Invocation::remote_twoway().

00149   {
00150     if (adapter_ != 0)
00151       {
00152         try
00153           {
00154             this->adapter_->receive_other (*this);
00155           }
00156         catch ( ::CORBA::Exception& ex)
00157           {
00158             (void) this->handle_any_exception (&ex);
00159             throw;
00160           }
00161         catch (...)
00162           {
00163             (void) this->handle_all_exception ();
00164             throw;
00165           }
00166 
00167         if (this->forwarded_to_.in ())
00168           return TAO_INVOKE_RESTART;
00169       }
00170 
00171     return TAO_INVOKE_SUCCESS;
00172   }

Invocation_Status TAO::Invocation_Base::receive_reply_interception void   )  [protected]
 

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

Definition at line 116 of file Invocation_Base.cpp.

References handle_all_exception(), handle_any_exception(), PortableInterceptor::ReplyStatus, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke(), and TAO::Synch_Twoway_Invocation::remote_twoway().

00117   {
00118     if (adapter_ != 0)
00119       {
00120         try
00121           {
00122             this->adapter_->receive_reply (*this);
00123           }
00124         catch ( ::CORBA::Exception& ex)
00125           {
00126             (void) this->handle_any_exception (&ex);
00127             throw;
00128           }
00129         catch (...)
00130           {
00131             (void) this->handle_all_exception ();
00132             throw;
00133           }
00134 
00135         PortableInterceptor::ReplyStatus const status =
00136           this->adapter_->reply_status (*this);
00137 
00138         if (status == PortableInterceptor::LOCATION_FORWARD ||
00139             status == PortableInterceptor::TRANSPORT_RETRY)
00140           return TAO_INVOKE_RESTART;
00141       }
00142 
00143     return TAO_INVOKE_SUCCESS;
00144   }

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 79 of file Invocation_Base.cpp.

References details_, and TAO_Operation_Details::reply_service_context().

00080   {
00081     return this->details_.reply_service_context ();
00082   }

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 230 of file Invocation_Base.cpp.

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

00231   {
00232     if (adapter_ != 0)
00233       {
00234         return this->adapter_->reply_status (*this);
00235       }
00236     else
00237       {
00238         return -1;
00239       }
00240   }

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 73 of file Invocation_Base.cpp.

References details_, and TAO_Operation_Details::request_service_context().

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

00074   {
00075     return this->details_.request_service_context ();
00076   }

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 void   )  [protected]
 

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

Definition at line 87 of file Invocation_Base.cpp.

References forwarded_to_, handle_all_exception(), handle_any_exception(), TAO_Pseudo_Var_T< T >::in(), TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Collocated_Invocation::invoke(), TAO::Synch_Oneway_Invocation::remote_oneway(), and TAO::Synch_Twoway_Invocation::remote_twoway().

00088   {
00089     if (adapter_ != 0)
00090       {
00091         try
00092           {
00093             // This is a begin interception point
00094             this->adapter_->send_request (*this);
00095           }
00096         catch ( ::CORBA::Exception& ex)
00097           {
00098             (void) this->handle_any_exception (&ex);
00099             throw;
00100           }
00101         catch (...)
00102           {
00103             (void) this->handle_all_exception ();
00104             throw;
00105           }
00106 
00107         if (this->forwarded_to_.in ())
00108           return TAO_INVOKE_RESTART;
00109       }
00110 
00111     // What are the other cases??
00112     return TAO_INVOKE_SUCCESS;
00113   }

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::LocateRequest_Invocation_Adapter::invoke(), 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 220 of file Invocation_Base.h.

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

Pointer to the caught exception.

Definition at line 228 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 218 of file Invocation_Base.cpp.

Referenced by handle_all_exception(), and handle_any_exception().

00219   {
00220     if (CORBA::SystemException::_downcast (exception) != 0)
00221       this->invoke_status_ = TAO::TAO_INVOKE_SYSTEM_EXCEPTION;
00222     else if (CORBA::UserException::_downcast (exception) != 0)
00223       this->invoke_status_ = TAO::TAO_INVOKE_USER_EXCEPTION;
00224 
00225     this->forwarded_to_ = CORBA::Object::_nil ();
00226     this->caught_exception_ = exception;
00227   }

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(), handle_any_exception(), is_forwarded(), receive_other_interception(), send_request_interception(), 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 224 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 232 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 222 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 Sun Jan 27 13:18:11 2008 for TAO by doxygen 1.3.6