#include <Synch_Reply_Dispatcher.h>
Inheritance diagram for TAO_Synch_Reply_Dispatcher:


Public Member Functions | |
| TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core, IOP::ServiceContextList &sc) | |
| Constructor. | |
| virtual | ~TAO_Synch_Reply_Dispatcher (void) |
| Destructor. | |
| TAO_InputCDR & | reply_cdr (void) |
| Return the reply CDR. | |
| virtual int | dispatch_reply (TAO_Pluggable_Reply_Params ¶ms) |
| virtual void | connection_closed (void) |
Protected Attributes | |
| IOP::ServiceContextList & | reply_service_info_ |
| The service context list. | |
Private Attributes | |
| TAO_ORB_Core * | orb_core_ |
| Cache the ORB Core pointer. | |
| char | buf_ [ACE_CDR::DEFAULT_BUFSIZE] |
| The buffer that is used to initialise the data block. | |
| ACE_Data_Block | db_ |
| TAO_InputCDR | reply_cdr_ |
Definition at line 44 of file Synch_Reply_Dispatcher.h.
|
||||||||||||
|
Constructor.
Definition at line 16 of file Synch_Reply_Dispatcher.cpp. References TAO_LF_Invocation_Event::state_changed_i(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and TAO_ENCAP_BYTE_ORDER.
00020 : reply_service_info_ (sc), 00021 orb_core_ (orb_core), 00022 db_ (sizeof buf_, 00023 ACE_Message_Block::MB_DATA, 00024 this->buf_, 00025 this->orb_core_->input_cdr_buffer_allocator (), 00026 this->orb_core_->locking_strategy (), 00027 ACE_Message_Block::DONT_DELETE, 00028 this->orb_core_->input_cdr_dblock_allocator ()), 00029 reply_cdr_ (&db_, 00030 ACE_Message_Block::DONT_DELETE, 00031 TAO_ENCAP_BYTE_ORDER, 00032 TAO_DEF_GIOP_MAJOR, 00033 TAO_DEF_GIOP_MINOR, 00034 orb_core) 00035 { 00036 // As a TAO_LF_Event we start in the active state.... 00037 this->state_changed_i (TAO_LF_Event::LFS_ACTIVE); 00038 } |
|
|
Destructor.
Definition at line 41 of file Synch_Reply_Dispatcher.cpp.
00042 {
00043 }
|
|
|
The used for the pending reply has been closed. No reply is expected.
Implements TAO_Reply_Dispatcher. Definition at line 114 of file Synch_Reply_Dispatcher.cpp. References TAO_LF_Event::state_changed().
00115 {
00116 this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED,
00117 this->orb_core_->leader_follower ());
00118 }
|
|
|
Dispatch the reply. Return 1 on sucess, -1 on error.
Implements TAO_Reply_Dispatcher. Definition at line 52 of file Synch_Reply_Dispatcher.cpp. References ACE_BIT_DISABLED, ACE_ERROR, ACE_InputCDR::clone_from(), TAO_InputCDR::clr_mb_flags(), ACE_Data_Block::flags(), TAO::unbounded_value_sequence< ServiceContext >::get_buffer(), TAO_Pluggable_Reply_Params::input_cdr_, TAO::unbounded_value_sequence< ServiceContext >::length(), LM_ERROR, TAO::unbounded_value_sequence< ServiceContext >::maximum(), ACE_Data_Block::release(), TAO::unbounded_value_sequence< ServiceContext >::replace(), TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_LF_Event::state_changed(), TAO_Pluggable_Reply_Params_Base::svc_ctx_, and TAO_debug_level.
00054 {
00055 if (params.input_cdr_ == 0)
00056 return -1;
00057
00058 this->reply_status_ = params.reply_status_;
00059
00060 // Steal the buffer, that way we don't do any unnecesary copies of
00061 // this data.
00062 CORBA::ULong const max = params.svc_ctx_.maximum ();
00063 CORBA::ULong const len = params.svc_ctx_.length ();
00064 IOP::ServiceContext* context_list = params.svc_ctx_.get_buffer (1);
00065 this->reply_service_info_.replace (max, len, context_list, 1);
00066
00067 // Must reset the message state, it is possible that the same reply
00068 // dispatcher is used because the request must be re-sent.
00069 //this->message_state_.reset (0);
00070
00071 // Transfer the <params.input_cdr_>'s content to this->reply_cdr_
00072 if (ACE_BIT_DISABLED ((*params.input_cdr_).start()->data_block()->flags(),
00073 ACE_Message_Block::DONT_DELETE))
00074 {
00075 // Data block is on the heap, so just duplicate it.
00076 this->reply_cdr_ = *params.input_cdr_;
00077 this->reply_cdr_.clr_mb_flags( ACE_Message_Block::DONT_DELETE );
00078 }
00079 else
00080 {
00081 ACE_Data_Block *db =
00082 this->reply_cdr_.clone_from (*params.input_cdr_);
00083
00084 if (db == 0)
00085 {
00086 if (TAO_debug_level > 2)
00087 {
00088 ACE_ERROR ((LM_ERROR,
00089 "TAO (%P|%t) - Synch_Reply_Dispatcher::dispatch_reply "
00090 "clone_from failed \n"));
00091 }
00092 return -1;
00093 }
00094
00095 // See whether we need to delete the data block by checking the
00096 // flags. We cannot be happy that we initally allocated the
00097 // datablocks of the stack. If this method is called twice, as is in
00098 // some cases where the same invocation object is used to make two
00099 // invocations like forwarding, the release becomes essential.
00100 if (ACE_BIT_DISABLED (db->flags (),
00101 ACE_Message_Block::DONT_DELETE))
00102 {
00103 db->release ();
00104 }
00105 }
00106
00107 this->state_changed (TAO_LF_Event::LFS_SUCCESS,
00108 this->orb_core_->leader_follower ());
00109
00110 return 1;
00111 }
|
|
|
Return the reply CDR.
Definition at line 46 of file Synch_Reply_Dispatcher.cpp.
00047 {
00048 return this->reply_cdr_;
00049 }
|
|
|
The buffer that is used to initialise the data block.
Definition at line 80 of file Synch_Reply_Dispatcher.h. |
|
|
datablock that is created on teh stack to initialise the CDR stream underneath. Definition at line 84 of file Synch_Reply_Dispatcher.h. |
|
|
Cache the ORB Core pointer.
Definition at line 70 of file Synch_Reply_Dispatcher.h. |
|
|
CDR stream which has the reply information that needs to be demarshalled by the stubs Definition at line 88 of file Synch_Reply_Dispatcher.h. |
|
|
The service context list.
Definition at line 66 of file Synch_Reply_Dispatcher.h. |
1.3.6