Represents a "queue-able", synchronous, collocated, CORBA request. More...
#include <CSD_TP_Collocated_Synch_Request.h>
Public Member Functions | |
TP_Collocated_Synch_Request (TAO_ServerRequest &server_request, const PortableServer::ObjectId &object_id, PortableServer::POA_ptr poa, const char *operation, PortableServer::Servant servant, TP_Servant_State *servant_state) | |
Constructor. | |
virtual | ~TP_Collocated_Synch_Request () |
Virtual Destructor. | |
bool | wait (void) |
Protected Member Functions | |
virtual void | dispatch_i () |
Dispatch the request to the servant. | |
virtual void | cancel_i () |
Cancel the request. | |
Private Attributes | |
TP_Synch_Helper | synch_helper_ |
CORBA::Exception * | exception_ |
Represents a "queue-able", synchronous, collocated, CORBA request.
This kind request is the two-way or oneway(with SYNC_WITH_TARGET policy applied) collocated request. It is NOT cloned before enqueuing and the "enqueuing" thread will block until the request is dispatched/handled or cancelled.
Definition at line 50 of file CSD_TP_Collocated_Synch_Request.h.
TAO::CSD::TP_Collocated_Synch_Request::TP_Collocated_Synch_Request | ( | TAO_ServerRequest & | server_request, | |
const PortableServer::ObjectId & | object_id, | |||
PortableServer::POA_ptr | poa, | |||
const char * | operation, | |||
PortableServer::Servant | servant, | |||
TP_Servant_State * | servant_state | |||
) |
Constructor.
Definition at line 11 of file CSD_TP_Collocated_Synch_Request.inl.
: TP_Corba_Request(object_id, poa, operation, servant, servant_state, server_request), exception_(0) { }
TAO::CSD::TP_Collocated_Synch_Request::~TP_Collocated_Synch_Request | ( | ) | [virtual] |
void TAO::CSD::TP_Collocated_Synch_Request::cancel_i | ( | ) | [protected, virtual] |
Cancel the request.
Implements TAO::CSD::TP_Request.
Definition at line 46 of file CSD_TP_Collocated_Synch_Request.cpp.
{ this->synch_helper_.cancelled(); }
void TAO::CSD::TP_Collocated_Synch_Request::dispatch_i | ( | ) | [protected, virtual] |
Dispatch the request to the servant.
Note that we do not override our base class implementation of prepare_for_queue_i() (which does nothing), because we don't need to clone the Server Request object.
Implements TAO::CSD::TP_Request.
Definition at line 23 of file CSD_TP_Collocated_Synch_Request.cpp.
{ try { this->do_dispatch(); } catch (const ::CORBA::Exception& ex) { // We need to save off a copy of the exception. this->exception_ = ex._tao_duplicate(); } catch (...) { ACE_NEW (this->exception_ , CORBA::UNKNOWN (CORBA::SystemException::_tao_minor_code (TAO_UNHANDLED_SERVER_CXX_EXCEPTION, 0), CORBA::COMPLETED_MAYBE)); } this->synch_helper_.dispatched(); }
bool TAO::CSD::TP_Collocated_Synch_Request::wait | ( | void | ) |
Wait until the request has been dispatched (and completed), or until it has been cancelled. Returns true if the request has been dispatched, and returns false if the request has been cancelled.
Definition at line 30 of file CSD_TP_Collocated_Synch_Request.inl.
{ bool dispatched = this->synch_helper_.wait_while_pending(); if (dispatched) { // Check to see if the dispatching caused an exception to be raised. if (this->exception_ != 0) { // An exception was raised during the actual dispatching to // the servant. We need to raise the exception to our caller, // which is the thread that made the collocated request in the // first place. CORBA::Exception* ex = this->exception_; this->exception_ = 0; ACE_Auto_Basic_Ptr<CORBA::Exception> ex_holder(ex); ex->_raise (); } } return dispatched; }
CORBA::Exception* TAO::CSD::TP_Collocated_Synch_Request::exception_ [private] |
Set to NULL initially, and will only be set thereafter if an exception is raised from the dispatch() call on the server_request_.
Definition at line 95 of file CSD_TP_Collocated_Synch_Request.h.
TP_Synch_Helper TAO::CSD::TP_Collocated_Synch_Request::synch_helper_ [private] |
Helper used to block and unblock the thread that invokes our wait() method.
Definition at line 91 of file CSD_TP_Collocated_Synch_Request.h.