#include <Invocation_Base.h>
Inheritance diagram for TAO::Invocation_Base:
size_t & | stack_size (void) |
CORBA::Exception * | caught_exception (void) |
TAO::Invocation_Status | invoke_status (void) const |
Invocation status. | |
void | invoke_status (Invocation_Status s) |
Mutator to set the invocation status. | |
PortableInterceptor::ReplyStatus | pi_reply_status (void) const |
bool | is_remote_request () const |
void exception CORBA::Exception * | exception |
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_Adapter * | adapter_ |
The client requestor adapter. | |
size_t | stack_size_ |
TAO::Invocation_Status | invoke_status_ |
CORBA::Exception * | caught_exception_ |
Pointer to the caught exception. | |
bool | is_remote_request_ |
Public Member Functions | |
virtual | ~Invocation_Base (void) |
TAO_ORB_Core * | orb_core (void) const |
Accessor and mutator methods. | |
TAO_Stub * | stub (void) const |
Accessor and mutator methods. | |
CORBA::Object_ptr | forwarded_reference (void) |
void | forwarded_reference (CORBA::Object_ptr o) |
Accessor and mutator methods. | |
TAO_Service_Context & | request_service_context (void) |
Accessors for the service context list. | |
TAO_Service_Context & | reply_service_context (void) |
Accessor and mutator methods. | |
CORBA::Object_ptr | steal_forwarded_reference (void) |
Return the forwarded object location by loosing ownership. | |
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? | |
GIOP::ReplyStatusType | reply_status (void) const |
Accessor and mutator of reply_status of the invocation. | |
void | reply_status (GIOP::ReplyStatusType s) |
Accessor and mutator methods. | |
TAO_Operation_Details & | operation_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_Details & | details_ |
The operation details on which we are operating on. | |
CORBA::Object_var | forwarded_to_ |
Forwarded object reference. | |
bool | response_expected_ |
Is response expected? | |
GIOP::ReplyStatusType | reply_status_ |
A GIOP reply status of the invocation. | |
Private Member Functions | |
Invocation_Base (const Invocation_Base &) | |
Invocation_Base & | operator= (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_Core * | orb_core_ |
Cache the ORB_Core. | |
TAO_Stub * | stub_ |
The original target on which the invocation was started. |
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 59 of file Invocation_Base.h.
TAO::Invocation_Base::~Invocation_Base | ( | void | ) | [virtual] |
Definition at line 60 of file Invocation_Base.cpp.
References adapter_, and TAO_INTERCEPTOR.
00061 { 00062 TAO_INTERCEPTOR (adapter_ = 0); 00063 }
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] |
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] |
CORBA::Exception* TAO::Invocation_Base::caught_exception | ( | void | ) |
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 66 of file Invocation_Base.inl.
References target_.
00067 { 00068 return this->target_; 00069 }
ACE_INLINE void TAO::Invocation_Base::forwarded_reference | ( | CORBA::Object_ptr | o | ) |
Accessor and mutator methods.
Definition at line 22 of file Invocation_Base.inl.
References CORBA::Object::_duplicate(), forwarded_to_, and reply_status_.
00023 { 00024 this->forwarded_to_ = CORBA::Object::_duplicate (o); 00025 this->reply_status_ = GIOP::LOCATION_FORWARD; 00026 }
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 29 of file Invocation_Base.inl.
References CORBA::Object::_duplicate().
00030 { 00031 return CORBA::Object::_duplicate (this->forwarded_to_.in ()); 00032 }
PortableInterceptor::ReplyStatus TAO::Invocation_Base::handle_all_exception | ( | void | ) | [protected] |
Definition at line 188 of file Invocation_Base.cpp.
References adapter_, exception, TAO::ClientRequestInterceptor_Adapter::pi_reply_status(), TAO::ClientRequestInterceptor_Adapter::receive_exception(), CORBA::SYSTEM_EXCEPTION, and TAO_BEGIN_VERSIONED_NAMESPACE_DECL::unknown_exception.
00189 { 00190 this->exception (&unknown_exception); 00191 00192 PortableInterceptor::ReplyStatus status = 00193 PortableInterceptor::SYSTEM_EXCEPTION; 00194 00195 if (adapter_ != 0) 00196 { 00197 this->adapter_->receive_exception (*this); 00198 00199 status = this->adapter_->pi_reply_status (*this); 00200 } 00201 00202 return status; 00203 }
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 163 of file Invocation_Base.cpp.
References adapter_, exception, TAO::ClientRequestInterceptor_Adapter::pi_reply_status(), TAO::ClientRequestInterceptor_Adapter::receive_exception(), and CORBA::SYSTEM_EXCEPTION.
00164 { 00165 this->exception (ex); 00166 00167 PortableInterceptor::ReplyStatus status = 00168 PortableInterceptor::SYSTEM_EXCEPTION; 00169 00170 if (adapter_ != 0) 00171 { 00172 this->adapter_->receive_exception (*this); 00173 00174 if (this->reply_status_ == GIOP::LOCATION_FORWARD) 00175 { 00176 status = PortableInterceptor::LOCATION_FORWARD; 00177 } 00178 else 00179 { 00180 status = this->adapter_->pi_reply_status (*this); 00181 } 00182 } 00183 00184 return status; 00185 }
void TAO::Invocation_Base::invoke_status | ( | Invocation_Status | s | ) |
Mutator to set the invocation status.
TAO::Invocation_Status TAO::Invocation_Base::invoke_status | ( | void | ) | const |
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 72 of file Invocation_Base.inl.
References details_.
00073 { 00074 return this->details_; 00075 }
Invocation_Base& TAO::Invocation_Base::operator= | ( | const Invocation_Base & | ) | [private] |
ACE_INLINE TAO_ORB_Core * TAO::Invocation_Base::orb_core | ( | void | ) | const |
Accessor and mutator methods.
Definition at line 10 of file Invocation_Base.inl.
References orb_core_.
00011 { 00012 return this->orb_core_; 00013 }
PortableInterceptor::ReplyStatus TAO::Invocation_Base::pi_reply_status | ( | void | ) | const |
Definition at line 219 of file Invocation_Base.cpp.
References adapter_, and TAO::ClientRequestInterceptor_Adapter::pi_reply_status().
00220 { 00221 if (adapter_ != 0) 00222 { 00223 return this->adapter_->pi_reply_status (*this); 00224 } 00225 else 00226 { 00227 return -1; 00228 } 00229 }
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 136 of file Invocation_Base.cpp.
References adapter_, TAO::ClientRequestInterceptor_Adapter::receive_other(), TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.
00137 { 00138 if (adapter_ != 0) 00139 { 00140 try 00141 { 00142 this->adapter_->receive_other (*this); 00143 } 00144 catch ( ::CORBA::Exception& ex) 00145 { 00146 (void) this->handle_any_exception (&ex); 00147 throw; 00148 } 00149 catch (...) 00150 { 00151 (void) this->handle_all_exception (); 00152 throw; 00153 } 00154 00155 if (this->reply_status_ == GIOP::LOCATION_FORWARD) 00156 return TAO_INVOKE_RESTART; 00157 } 00158 00159 return TAO_INVOKE_SUCCESS; 00160 }
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 109 of file Invocation_Base.cpp.
References adapter_, TAO::ClientRequestInterceptor_Adapter::receive_reply(), TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.
00110 { 00111 if (adapter_ != 0) 00112 { 00113 try 00114 { 00115 this->adapter_->receive_reply (*this); 00116 } 00117 catch ( ::CORBA::Exception& ex) 00118 { 00119 (void) this->handle_any_exception (&ex); 00120 throw; 00121 } 00122 catch (...) 00123 { 00124 (void) this->handle_all_exception (); 00125 throw; 00126 } 00127 00128 if (this->reply_status_ == GIOP::LOCATION_FORWARD) 00129 return TAO_INVOKE_RESTART; 00130 } 00131 00132 return TAO_INVOKE_SUCCESS; 00133 }
TAO_Service_Context & TAO::Invocation_Base::reply_service_context | ( | void | ) |
Accessor and mutator methods.
Definition at line 72 of file Invocation_Base.cpp.
References details_, and TAO_Operation_Details::reply_service_context().
00073 { 00074 return this->details_.reply_service_context (); 00075 }
ACE_INLINE void TAO::Invocation_Base::reply_status | ( | GIOP::ReplyStatusType | s | ) |
Accessor and mutator methods.
Definition at line 54 of file Invocation_Base.inl.
References reply_status_.
00055 { 00056 this->reply_status_ = s; 00057 }
ACE_INLINE GIOP::ReplyStatusType TAO::Invocation_Base::reply_status | ( | void | ) | const |
Accessor and mutator of reply_status of the invocation.
Definition at line 48 of file Invocation_Base.inl.
References reply_status_.
00049 { 00050 return this->reply_status_; 00051 }
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 66 of file Invocation_Base.cpp.
References details_, and TAO_Operation_Details::request_service_context().
00067 { 00068 return this->details_.request_service_context (); 00069 }
ACE_INLINE CORBA::Boolean TAO::Invocation_Base::response_expected | ( | void | ) | const |
Does this invocation return a response?
Definition at line 42 of file Invocation_Base.inl.
References response_expected_.
00043 { 00044 return this->response_expected_; 00045 }
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 80 of file Invocation_Base.cpp.
References adapter_, TAO::ClientRequestInterceptor_Adapter::send_request(), TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.
00081 { 00082 if (adapter_ != 0) 00083 { 00084 try 00085 { 00086 // This is a begin interception point 00087 this->adapter_->send_request (*this); 00088 } 00089 catch ( ::CORBA::Exception& ex) 00090 { 00091 (void) this->handle_any_exception (&ex); 00092 throw; 00093 } 00094 catch (...) 00095 { 00096 (void) this->handle_all_exception (); 00097 throw; 00098 } 00099 00100 if (this->reply_status_ == GIOP::LOCATION_FORWARD) 00101 return TAO_INVOKE_RESTART; 00102 } 00103 00104 // What are the other cases?? 00105 return TAO_INVOKE_SUCCESS; 00106 }
size_t& TAO::Invocation_Base::stack_size | ( | void | ) |
ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::steal_forwarded_reference | ( | void | ) |
Return the forwarded object location by loosing ownership.
Definition at line 35 of file Invocation_Base.inl.
References TAO_Pseudo_Var_T< T >::_retn(), forwarded_to_, CORBA::NO_EXCEPTION, and reply_status_.
00036 { 00037 this->reply_status_ = GIOP::NO_EXCEPTION; 00038 return this->forwarded_to_._retn (); 00039 }
ACE_INLINE TAO_Stub * TAO::Invocation_Base::stub | ( | void | ) | const |
Accessor and mutator methods.
Definition at line 16 of file Invocation_Base.inl.
References stub_.
00017 { 00018 return this->stub_; 00019 }
ACE_INLINE CORBA::Object_ptr TAO::Invocation_Base::target | ( | void | ) | const |
Return the target object.
Definition at line 60 of file Invocation_Base.inl.
References otarget_.
00061 { 00062 return this->otarget_; 00063 }
ClientRequestInterceptor_Adapter* TAO::Invocation_Base::adapter_ [protected] |
The client requestor adapter.
Definition at line 224 of file Invocation_Base.h.
Referenced by handle_all_exception(), handle_any_exception(), pi_reply_status(), receive_other_interception(), receive_reply_interception(), send_request_interception(), and ~Invocation_Base().
CORBA::Exception* TAO::Invocation_Base::caught_exception_ [private] |
TAO_Operation_Details& TAO::Invocation_Base::details_ [protected] |
The operation details on which we are operating on.
Definition at line 134 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 188 of file Invocation_Base.h.
Referenced by handle_all_exception(), and handle_any_exception().
CORBA::Object_var TAO::Invocation_Base::forwarded_to_ [protected] |
Forwarded object reference.
Definition at line 137 of file Invocation_Base.h.
Referenced by forwarded_reference(), and steal_forwarded_reference().
TAO::Invocation_Status TAO::Invocation_Base::invoke_status_ [protected] |
Definition at line 228 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 236 of file Invocation_Base.h.
TAO_ORB_Core* TAO::Invocation_Base::orb_core_ [private] |
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 159 of file Invocation_Base.h.
Referenced by target().
GIOP::ReplyStatusType TAO::Invocation_Base::reply_status_ [protected] |
A GIOP reply status of the invocation.
Definition at line 143 of file Invocation_Base.h.
Referenced by forwarded_reference(), reply_status(), and steal_forwarded_reference().
bool TAO::Invocation_Base::response_expected_ [protected] |
Is response expected?
Definition at line 140 of file Invocation_Base.h.
Referenced by response_expected().
size_t TAO::Invocation_Base::stack_size_ [protected] |
Definition at line 226 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 167 of file Invocation_Base.h.
Referenced by stub().
CORBA::Object_ptr TAO::Invocation_Base::target_ [private] |
The effective target on which the invocation is on.
Definition at line 162 of file Invocation_Base.h.
Referenced by effective_target().