TAO::Collocated_Invocation Class Reference

Class for Collocated invocations. More...

#include <Collocated_Invocation.h>

Inheritance diagram for TAO::Collocated_Invocation:

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

Collaboration graph
[legend]
List of all members.

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)

Detailed Description

Class for Collocated invocations.

Note:
Reliable oneways are not handled properly including use of interceptors. This class should technically serve as the base for all invocation types. But now, this is the only class that handles collocated invocations and that too in a brain dead way.

Definition at line 50 of file Collocated_Invocation.h.


Constructor & Destructor Documentation

TAO::Collocated_Invocation::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.

Parameters:
t The target on which invocation first started.
et The effective target in which this invocation is now flowing
stub Stub for effective target et
detail operation details of the invocation including the service context list
response_expected flag to indicate whether the operation encapsulated by detail returns a response or not.

Definition at line 24 of file Collocated_Invocation.cpp.

References CORBA::Object_ptr.

00029     : Invocation_Base (t,
00030                        et,
00031                        stub,
00032                        detail,
00033                        response_expected,
00034                        false /* request_is_remote */ )
00035   {
00036   }

TAO::Collocated_Invocation::Collocated_Invocation void   )  [private]
 


Member Function Documentation

Invocation_Status TAO::Collocated_Invocation::invoke Collocation_Proxy_Broker cpb,
Collocation_Strategy  strat
 

Practically this method is a place holder to do the following

  • Call the start and end interception points on the client side.

  • Handle location forwards that could be thrown by the servant.

Definition at line 39 of file Collocated_Invocation.cpp.

References TAO_ORB_Core::_incr_refcnt(), CORBA::Object::_stubobj(), 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_Operation_Details::has_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_INTERCEPTOR, TAO::TAO_INVOKE_FAILURE, TAO::TAO_INVOKE_RESTART, and TAO::TAO_INVOKE_SUCCESS.

Referenced by TAO::Invocation_Adapter::invoke_collocated_i().

00041   {
00042     Invocation_Status s = TAO_INVOKE_FAILURE;
00043 
00044     /// Start the interception point
00045 #if TAO_HAS_INTERCEPTORS == 1
00046     s = this->send_request_interception ();
00047 
00048     if (s != TAO_INVOKE_SUCCESS)
00049       return s;
00050 #endif /*TAO_HAS_INTERCEPTORS */
00051 
00052     try
00053       {
00054         if (strat == TAO_CS_THRU_POA_STRATEGY)
00055           {
00056             // Perform invocations on the servant through the servant's ORB.
00057             CORBA::ORB_var servant_orb =
00058               this->effective_target ()->_stubobj ()->servant_orb_ptr ();
00059             TAO_ORB_Core * const orb_core = servant_orb->orb_core ();
00060 
00061             TAO_ServerRequest request (orb_core,
00062                                        this->details_,
00063                                        this->effective_target ());
00064 
00065             TAO_Request_Dispatcher * const dispatcher =
00066               orb_core->request_dispatcher ();
00067 
00068             // Retain ownership of the servant's ORB_Core in case
00069             // another thread attempts to destroy it (e.g. via
00070             // CORBA::ORB::destroy()) before this thread complete the
00071             // invocation.
00072             orb_core->_incr_refcnt ();
00073             TAO_ORB_Core_Auto_Ptr my_orb_core (orb_core);
00074 
00075             dispatcher->dispatch (orb_core,
00076                                   request,
00077                                   this->forwarded_to_.out ());
00078           }
00079         else
00080           {
00081             cpb->dispatch (this->effective_target (),
00082                            this->forwarded_to_.out (),
00083                            this->details_.args (),
00084                            this->details_.args_num (),
00085                            this->details_.opname (),
00086                            this->details_.opname_len (),
00087                            strat);
00088           }
00089 
00090         // Invocation completed succesfully
00091         s = TAO_INVOKE_SUCCESS;
00092 
00093 #if TAO_HAS_INTERCEPTORS == 1
00094         if (this->forwarded_to_.in () ||
00095             this->response_expected_ == false)
00096           {
00097             if (this->forwarded_to_.in ())
00098               this->reply_received (TAO_INVOKE_RESTART);
00099 
00100             s = this->receive_other_interception ();
00101           }
00102         // NOTE: Any other condition that needs handling?
00103         else if (this->response_expected ())
00104           {
00105             this->reply_received (TAO_INVOKE_SUCCESS);
00106 
00107             s = this->receive_reply_interception ();
00108           }
00109         if (s != TAO_INVOKE_SUCCESS)
00110           return s;
00111 #endif /*TAO_HAS_INTERCEPTORS */
00112       }
00113     catch ( ::CORBA::UserException& ex)
00114       {
00115         // Ignore CORBA exceptions for oneways
00116         if (this->response_expected_ == false)
00117           return TAO_INVOKE_SUCCESS;
00118 
00119 #if TAO_HAS_INTERCEPTORS == 1
00120         PortableInterceptor::ReplyStatus const status =
00121           this->handle_any_exception (&ex);
00122 
00123         if (status == PortableInterceptor::LOCATION_FORWARD ||
00124           status == PortableInterceptor::TRANSPORT_RETRY)
00125           s = TAO_INVOKE_RESTART;
00126         else
00127 #endif /* TAO_HAS_INTERCEPTORS */
00128           {
00129             // Check whether the user exception thrown matches the signature
00130             // list, if not, then throw an Unknown exception
00131             if (!this->details_.has_exception (ex))
00132               {
00133                 throw ::CORBA::UNKNOWN (CORBA::OMGVMCID | 1,
00134                                         CORBA::COMPLETED_MAYBE);
00135               }
00136             else
00137              {
00138                throw;
00139              }
00140           }
00141       }
00142     catch ( ::CORBA::SystemException& TAO_INTERCEPTOR (ex))
00143       {
00144         // Ignore CORBA exceptions for oneways
00145         if (this->response_expected_ == false)
00146           return TAO_INVOKE_SUCCESS;
00147 
00148 #if TAO_HAS_INTERCEPTORS == 1
00149         PortableInterceptor::ReplyStatus const status =
00150           this->handle_any_exception (&ex);
00151 
00152         if (status == PortableInterceptor::LOCATION_FORWARD ||
00153             status == PortableInterceptor::TRANSPORT_RETRY)
00154           s = TAO_INVOKE_RESTART;
00155         else
00156 #endif /* TAO_HAS_INTERCEPTORS */
00157           throw;
00158       }
00159 #if TAO_HAS_INTERCEPTORS == 1
00160     catch (...)
00161       {
00162         // Notify interceptors of non-CORBA exception, and propagate
00163         // that exception to the caller.
00164         PortableInterceptor::ReplyStatus const st =
00165           this->handle_all_exception ();
00166 
00167         if (st == PortableInterceptor::LOCATION_FORWARD ||
00168             st == PortableInterceptor::TRANSPORT_RETRY)
00169           s = TAO_INVOKE_RESTART;
00170         else
00171           throw;
00172       }
00173 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00174 
00175     if (this->forwarded_to_.in () != 0)
00176       s =  TAO_INVOKE_RESTART;
00177 
00178     return s;
00179   }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:17:55 2008 for TAO by doxygen 1.3.6