#include <Asynch_Reply_Dispatcher_Base.h>
Inheritance diagram for TAO_Asynch_Reply_Dispatcher_Base:


Public Member Functions | |
| TAO_Asynch_Reply_Dispatcher_Base (TAO_ORB_Core *orb_core, ACE_Allocator *allocator=0) | |
| Default constructor. | |
| void | transport (TAO_Transport *t) |
| Sets the transport for this invocation. | |
| virtual void | reply_timed_out (void)=0 |
| Inform that the reply timed out. | |
| virtual long | schedule_timer (CORBA::ULong, const ACE_Time_Value &)=0 |
| Install the timeout handler. | |
| bool | try_dispatch_reply (void) |
| A helper method that can be used by the subclasses. | |
The Reply Dispatcher methods | |
| virtual int | dispatch_reply (TAO_Pluggable_Reply_Params &)=0 |
| virtual void | connection_closed (void)=0 |
Mutators for refcount | |
| void | incr_refcount (void) |
| void | decr_refcount (void) |
Protected Member Functions | |
| virtual | ~TAO_Asynch_Reply_Dispatcher_Base (void) |
| Destructor. | |
Protected Attributes | |
| IOP::ServiceContextList | reply_service_info_ |
| The service context list. | |
| char | buf_ [ACE_CDR::DEFAULT_BUFSIZE] |
| The buffer that is used to initialise the data block. | |
| ACE_Data_Block | db_ |
| TAO_InputCDR | reply_cdr_ |
| TAO_Transport * | transport_ |
| This invocation is using this transport, may change... | |
Private Attributes | |
| ACE_Lock * | lock_ |
Lock to protect refcount and is_reply_dispatched_ flag. | |
| CORBA::ULong | refcount_ |
| Refcount paraphernalia for this class. | |
| bool | is_reply_dispatched_ |
| Has the reply been dispatched? | |
| ACE_Allocator * | allocator_ |
Definition at line 45 of file Asynch_Reply_Dispatcher_Base.h.
|
||||||||||||
|
Default constructor.
Definition at line 20 of file Asynch_Reply_Dispatcher_Base.cpp. References TAO_Resource_Factory::create_cached_connection_lock(), TAO_ORB_Core::resource_factory(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and TAO_ENCAP_BYTE_ORDER.
00024 : db_ (sizeof buf_, 00025 ACE_Message_Block::MB_DATA, 00026 this->buf_, 00027 orb_core->input_cdr_buffer_allocator (), 00028 orb_core->locking_strategy (), 00029 ACE_Message_Block::DONT_DELETE, 00030 orb_core->input_cdr_dblock_allocator ()), 00031 reply_cdr_ (&db_, 00032 ACE_Message_Block::MB_DATA, 00033 TAO_ENCAP_BYTE_ORDER, 00034 TAO_DEF_GIOP_MAJOR, 00035 TAO_DEF_GIOP_MINOR, 00036 orb_core) 00037 , transport_ (0) 00038 , lock_ (0) 00039 , refcount_ (1) 00040 , is_reply_dispatched_ (false) 00041 , allocator_ (allocator) 00042 { 00043 // @@ NOTE: Need a seperate option for this.. 00044 this->lock_ = 00045 orb_core->resource_factory ()->create_cached_connection_lock (); 00046 } |
|
|
Destructor.
Definition at line 49 of file Asynch_Reply_Dispatcher_Base.cpp. References TAO_Transport::remove_reference(), and transport_.
00050 {
00051 // Release the transport that we own
00052 if (this->transport_ != 0)
00053 this->transport_->remove_reference ();
00054
00055 if (this->lock_)
00056 delete this->lock_;
00057 }
|
|
|
The used for the pending reply has been closed. No reply is expected.
Implements TAO_Reply_Dispatcher. Definition at line 79 of file Asynch_Reply_Dispatcher_Base.cpp.
00080 {
00081 }
|
|
|
Definition at line 98 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_DES_FREE, and ACE_GUARD.
00099 {
00100 {
00101 ACE_GUARD (ACE_Lock,
00102 mutex,
00103 *this->lock_);
00104 --this->refcount_;
00105
00106 if (this->refcount_ > 0)
00107 return;
00108 }
00109
00110 if (this->allocator_)
00111 {
00112 ACE_DES_FREE (this,
00113 this->allocator_->free,
00114 TAO_Asynch_Reply_Dispatcher_Base);
00115 }
00116 else
00117 {
00118 delete this;
00119 }
00120
00121 return;
00122 }
|
|
|
Dispatch the reply. Return 1 on sucess, -1 on error.
Implements TAO_Reply_Dispatcher. Definition at line 72 of file Asynch_Reply_Dispatcher_Base.cpp.
00074 {
00075 return 0;
00076 }
|
|
|
Definition at line 89 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_GUARD.
|
|
|
Inform that the reply timed out.
Definition at line 84 of file Asynch_Reply_Dispatcher_Base.cpp.
00085 {
00086 }
|
|
||||||||||||
|
Install the timeout handler.
|
|
|
Sets the transport for this invocation.
Definition at line 60 of file Asynch_Reply_Dispatcher_Base.cpp. References TAO_Transport::add_reference(), TAO_Transport::remove_reference(), and transport_.
00061 {
00062 if (this->transport_ != 0)
00063 this->transport_->remove_reference ();
00064
00065 this->transport_ = t;
00066
00067 this->transport_->add_reference ();
00068 }
|
|
|
A helper method that can be used by the subclasses. The semantics of this helper method needs careful attention. A call to this method will do the following
Why are we clumping everything in one method. Answer is we need atomicity? Definition at line 125 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_GUARD_RETURN, and is_reply_dispatched_.
00126 {
00127 if (this->is_reply_dispatched_)
00128 {
00129 return false;
00130 }
00131 else
00132 {
00133 ACE_GUARD_RETURN (ACE_Lock,
00134 mutex,
00135 *this->lock_,
00136 false);
00137
00138 if (!this->is_reply_dispatched_)
00139 {
00140 this->is_reply_dispatched_ = true;
00141 return true;
00142 }
00143 }
00144
00145 return false;
00146 }
|
|
|
Allocator that was used to allocate this reply dispatcher. In case of zero we come from the heap. Definition at line 133 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
The buffer that is used to initialise the data block.
Definition at line 108 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Datablock that is created on the stack to initialise the CDR stream underneath. Definition at line 112 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Has the reply been dispatched?
Definition at line 129 of file Asynch_Reply_Dispatcher_Base.h. Referenced by try_dispatch_reply(). |
|
|
Lock to protect refcount and
Definition at line 123 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Refcount paraphernalia for this class.
Definition at line 126 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
CDR stream which has the reply information that needs to be demarshalled by the stubs Definition at line 116 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
The service context list. Note, that this is not a reference as in the synchronous case. We own the reply_service_info because our TAO_Asynch_Invocation or TAO_DII_Deferred_Invocation will go out of scope before we are done. Definition at line 105 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
This invocation is using this transport, may change...
Definition at line 119 of file Asynch_Reply_Dispatcher_Base.h. Referenced by transport(), and ~TAO_Asynch_Reply_Dispatcher_Base(). |
1.3.6