#include <Collocated_Invocation.h>
Inheritance diagram for TAO::Collocated_Invocation:
Public Member Functions | |
Collocated_Invocation (CORBA::Object_ptr t, CORBA::Object_ptr et, TAO_Stub *stub, TAO_Operation_Details &detail, bool response_expected=true) | |
Constructor used by TAO::Invocation_Adapter. | |
Invocation_Status | invoke (Collocation_Proxy_Broker *cpb, Collocation_Strategy strat) |
Private Member Functions | |
Collocated_Invocation (void) |
Definition at line 50 of file Collocated_Invocation.h.
|
Constructor used by TAO::Invocation_Adapter.
Definition at line 22 of file Collocated_Invocation.cpp. References CORBA::Object_ptr.
00027 : Invocation_Base (t, 00028 et, 00029 stub, 00030 detail, 00031 response_expected, 00032 false /* request_is_remote */ ) 00033 { 00034 } |
|
|
|
Practically this method is a place holder to do the following
Definition at line 37 of file Collocated_Invocation.cpp. References TAO_ORB_Core::_incr_refcnt(), CORBA::Object::_stubobj(), 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_Operation_Details::args(), TAO_Operation_Details::args_num(), TAO::Collocation_Proxy_Broker::dispatch(), TAO_Request_Dispatcher::dispatch(), TAO::Invocation_Base::effective_target(), TAO::Invocation_Base::handle_all_exception(), TAO::Invocation_Base::handle_any_exception(), TAO_Pseudo_Var_T< T >::in(), TAO::Invocation_Status, TAO_Operation_Details::opname(), TAO_Operation_Details::opname_len(), CORBA::ORB_var, TAO_Pseudo_Var_T< T >::out(), TAO::Invocation_Base::receive_other_interception(), TAO::Invocation_Base::receive_reply_interception(), TAO::Invocation_Base::reply_received(), PortableInterceptor::ReplyStatus, TAO_ORB_Core::request_dispatcher(), TAO::Invocation_Base::response_expected(), TAO::Invocation_Base::send_request_interception(), TAO_Stub::servant_orb_ptr(), TAO::TAO_CS_THRU_POA_STRATEGY, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS. Referenced by TAO::Invocation_Adapter::invoke_collocated_i().
00040 { 00041 Invocation_Status s = TAO_INVOKE_FAILURE; 00042 00043 /// Start the interception point 00044 #if TAO_HAS_INTERCEPTORS == 1 00045 s = 00046 this->send_request_interception (ACE_ENV_SINGLE_ARG_PARAMETER); 00047 ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); 00048 00049 if (s != TAO_INVOKE_SUCCESS) 00050 return s; 00051 #endif /*TAO_HAS_INTERCEPTORS */ 00052 00053 ACE_TRY 00054 { 00055 if (strat == TAO_CS_THRU_POA_STRATEGY) 00056 { 00057 // Perform invocations on the servant through the servant's ORB. 00058 CORBA::ORB_var servant_orb = 00059 this->effective_target ()->_stubobj ()->servant_orb_ptr (); 00060 TAO_ORB_Core * const orb_core = servant_orb->orb_core (); 00061 00062 TAO_ServerRequest request (orb_core, 00063 this->details_, 00064 this->effective_target ()); 00065 00066 TAO_Request_Dispatcher * const dispatcher = 00067 orb_core->request_dispatcher (); 00068 00069 // Retain ownership of the servant's ORB_Core in case 00070 // another thread attempts to destroy it (e.g. via 00071 // CORBA::ORB::destroy()) before this thread complete the 00072 // invocation. 00073 orb_core->_incr_refcnt (); 00074 TAO_ORB_Core_Auto_Ptr my_orb_core (orb_core); 00075 00076 dispatcher->dispatch (orb_core, 00077 request, 00078 this->forwarded_to_.out () 00079 ACE_ENV_ARG_PARAMETER); 00080 ACE_TRY_CHECK; 00081 } 00082 else 00083 { 00084 cpb->dispatch (this->effective_target (), 00085 this->forwarded_to_.out (), 00086 this->details_.args (), 00087 this->details_.args_num (), 00088 this->details_.opname (), 00089 this->details_.opname_len (), 00090 strat 00091 ACE_ENV_ARG_PARAMETER); 00092 ACE_TRY_CHECK; 00093 } 00094 00095 // Invocation completed succesfully 00096 s = TAO_INVOKE_SUCCESS; 00097 00098 #if TAO_HAS_INTERCEPTORS == 1 00099 if (this->forwarded_to_.in () || 00100 this->response_expected_ == false) 00101 { 00102 if (this->forwarded_to_.in ()) 00103 this->reply_received (TAO_INVOKE_RESTART); 00104 00105 s = 00106 this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER); 00107 ACE_TRY_CHECK; 00108 } 00109 // NOTE: Any other condition that needs handling? 00110 else if (this->response_expected ()) 00111 { 00112 this->reply_received (TAO_INVOKE_SUCCESS); 00113 00114 s = 00115 this->receive_reply_interception (ACE_ENV_SINGLE_ARG_PARAMETER); 00116 ACE_TRY_CHECK; 00117 } 00118 if (s != TAO_INVOKE_SUCCESS) 00119 return s; 00120 #endif /*TAO_HAS_INTERCEPTORS */ 00121 } 00122 ACE_CATCHANY 00123 { 00124 // Ignore exceptions for oneways 00125 if (this->response_expected_ == false) 00126 return TAO_INVOKE_SUCCESS; 00127 00128 #if TAO_HAS_INTERCEPTORS == 1 00129 PortableInterceptor::ReplyStatus const status = 00130 this->handle_any_exception (&ACE_ANY_EXCEPTION 00131 ACE_ENV_ARG_PARAMETER); 00132 ACE_TRY_CHECK; 00133 00134 if (status == PortableInterceptor::LOCATION_FORWARD || 00135 status == PortableInterceptor::TRANSPORT_RETRY) 00136 s = TAO_INVOKE_RESTART; 00137 else 00138 #endif /*TAO_HAS_INTERCEPTORS*/ 00139 ACE_RE_THROW; 00140 } 00141 # if defined (ACE_HAS_EXCEPTIONS) \ 00142 && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) 00143 ACE_CATCHALL 00144 { 00145 if (this->response_expected () == false) 00146 return TAO_INVOKE_SUCCESS; 00147 #if TAO_HAS_INTERCEPTORS == 1 00148 PortableInterceptor::ReplyStatus const st = 00149 this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER); 00150 ACE_TRY_CHECK; 00151 00152 if (st == PortableInterceptor::LOCATION_FORWARD || 00153 st == PortableInterceptor::TRANSPORT_RETRY) 00154 s = TAO_INVOKE_RESTART; 00155 else 00156 #endif /*TAO_HAS_INTERCEPTORS == 1*/ 00157 ACE_RE_THROW; 00158 } 00159 # endif /* ACE_HAS_EXCEPTIONS && 00160 ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ 00161 ACE_ENDTRY; 00162 ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); 00163 00164 if (this->forwarded_to_.in () != 0) 00165 s = TAO_INVOKE_RESTART; 00166 00167 return s; 00168 } |