#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 80 of file Asynch_Reply_Dispatcher_Base.cpp.
00081 {
00082 }
|
|
|
Definition at line 99 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_DES_FREE, and ACE_GUARD.
00100 {
00101 {
00102 ACE_GUARD (ACE_Lock,
00103 mutex,
00104 *this->lock_);
00105 --this->refcount_;
00106
00107 if (this->refcount_ > 0)
00108 return;
00109 }
00110
00111 if (this->allocator_)
00112 {
00113 ACE_DES_FREE (this,
00114 this->allocator_->free,
00115 TAO_Asynch_Reply_Dispatcher_Base);
00116 }
00117 else
00118 {
00119 delete this;
00120 }
00121
00122 return;
00123 }
|
|
|
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.
00075 {
00076 return 0;
00077 }
|
|
|
Definition at line 90 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_GUARD.
|
|
|
Inform that the reply timed out.
Definition at line 85 of file Asynch_Reply_Dispatcher_Base.cpp.
00086 {
00087 }
|
|
||||||||||||
|
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 126 of file Asynch_Reply_Dispatcher_Base.cpp. References ACE_GUARD_RETURN, and is_reply_dispatched_.
00127 {
00128 if (this->is_reply_dispatched_)
00129 {
00130 return false;
00131 }
00132 else
00133 {
00134 ACE_GUARD_RETURN (ACE_Lock,
00135 mutex,
00136 *this->lock_,
00137 false);
00138
00139 if (!this->is_reply_dispatched_)
00140 {
00141 this->is_reply_dispatched_ = true;
00142 return true;
00143 }
00144 }
00145
00146 return false;
00147 }
|
|
|
Allocator that was used to allocate this reply dispatcher. In case of zero we come from the heap. Definition at line 135 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
The buffer that is used to initialise the data block.
Definition at line 110 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Datablock that is created on the stack to initialise the CDR stream underneath. Definition at line 114 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Has the reply been dispatched?
Definition at line 131 of file Asynch_Reply_Dispatcher_Base.h. Referenced by try_dispatch_reply(). |
|
|
Lock to protect refcount and
Definition at line 125 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
Refcount paraphernalia for this class.
Definition at line 128 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 118 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 107 of file Asynch_Reply_Dispatcher_Base.h. |
|
|
This invocation is using this transport, may change...
Definition at line 121 of file Asynch_Reply_Dispatcher_Base.h. Referenced by transport(), and ~TAO_Asynch_Reply_Dispatcher_Base(). |
1.3.6