Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Synch_Reply_Dispatcher Class Reference

Reply dispatcher for Synchoronous Method Invocation (SMI)s. More...

#include <Synch_Reply_Dispatcher.h>

Inheritance diagram for TAO_Synch_Reply_Dispatcher:

Inheritance graph
[legend]
Collaboration diagram for TAO_Synch_Reply_Dispatcher:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core, IOP::ServiceContextList &sc)
 Constructor. More...

virtual ~TAO_Synch_Reply_Dispatcher (void)
 Destructor. More...

TAO_InputCDRreply_cdr (void)
 Return the reply CDR. More...

virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params)
virtual void connection_closed (void)

Protected Attributes

IOP::ServiceContextListreply_service_info_
 The service context list. More...


Private Attributes

TAO_ORB_Coreorb_core_
 Cache the ORB Core pointer. More...

char buf_ [ACE_CDR::DEFAULT_BUFSIZE]
 The buffer that is used to initialise the data block. More...

ACE_Data_Block db_
 datablock that is created on teh stack to initialise the CDR stream underneath. More...

TAO_InputCDR reply_cdr_
 CDR stream which has the reply information that needs to be demarshalled by the stubs. More...


Detailed Description

Reply dispatcher for Synchoronous Method Invocation (SMI)s.

Definition at line 40 of file Synch_Reply_Dispatcher.h.


Constructor & Destructor Documentation

TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher TAO_ORB_Core   orb_core,
IOP::ServiceContextList   sc
 

Constructor.

Definition at line 13 of file Synch_Reply_Dispatcher.cpp.

References TAO_LF_Event::LFS_ACTIVE, TAO_LF_Invocation_Event::state_changed_i, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and TAO_ENCAP_BYTE_ORDER.

00017   : reply_service_info_ (sc),
00018     orb_core_ (orb_core),
00019     db_ (sizeof buf_,
00020          ACE_Message_Block::MB_DATA,
00021          this->buf_,
00022          this->orb_core_->input_cdr_buffer_allocator (),
00023          this->orb_core_->locking_strategy (),
00024          ACE_Message_Block::DONT_DELETE,
00025          this->orb_core_->input_cdr_dblock_allocator ()),
00026     reply_cdr_ (&db_,
00027                 ACE_Message_Block::DONT_DELETE,
00028                 TAO_ENCAP_BYTE_ORDER,
00029                 TAO_DEF_GIOP_MAJOR,
00030                 TAO_DEF_GIOP_MINOR,
00031                 orb_core)
00032 {
00033   // As a TAO_LF_Event we start in the active state....
00034   this->state_changed_i (TAO_LF_Event::LFS_ACTIVE);
00035 }

TAO_Synch_Reply_Dispatcher::~TAO_Synch_Reply_Dispatcher void    [virtual]
 

Destructor.

Definition at line 38 of file Synch_Reply_Dispatcher.cpp.

00039 {
00040 }


Member Function Documentation

void TAO_Synch_Reply_Dispatcher::connection_closed void    [virtual]
 

The used for the pending reply has been closed. No reply is expected. @ TODO: If the connection was closed due to a CloseConnection message then we could re-issue the request instead of raising the exception, it would a matter of simply adding a boolean argument to this function.

Implements TAO_Reply_Dispatcher.

Definition at line 84 of file Synch_Reply_Dispatcher.cpp.

References TAO_LF_Event::LFS_CONNECTION_CLOSED, and TAO_LF_Event::state_changed.

00085 {
00086   this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED);
00087 }

int TAO_Synch_Reply_Dispatcher::dispatch_reply TAO_Pluggable_Reply_Params   params [virtual]
 

Dispatch the reply. Return 1 on sucess, -1 on error. @ TODO Pluggable Messaging: this method has too many arguments, the "Right Thing"[tm] is for the Transport Object to create a "ClientReply" that encapsulates all we need to process a reply. Naturally it is possible that different messaging protocols implement different variants of such ClientReply class.

Implements TAO_Reply_Dispatcher.

Definition at line 49 of file Synch_Reply_Dispatcher.cpp.

References ACE_BIT_DISABLED, ACE_InputCDR::clone_from, ACE_Message_Block::DONT_DELETE, ACE_Data_Block::flags, IOP::_TAO_Unbounded_Sequence_IOP_ServiceContextList::get_buffer, TAO_Pluggable_Reply_Params::input_cdr_, TAO_Unbounded_Base_Sequence::length, TAO_LF_Event::LFS_SUCCESS, TAO_Base_Sequence::maximum, ACE_Data_Block::release, IOP::_TAO_Unbounded_Sequence_IOP_ServiceContextList::replace, reply_cdr_, reply_service_info_, TAO_Pluggable_Reply_Params_Base::reply_status_, TAO_Reply_Dispatcher::reply_status_, TAO_LF_Event::state_changed, and TAO_Pluggable_Reply_Params_Base::svc_ctx_.

00051 {
00052   this->reply_status_ = params.reply_status_;
00053 
00054   // Steal the buffer, that way we don't do any unnecesary copies of
00055   // this data.
00056   CORBA::ULong max = params.svc_ctx_.maximum ();
00057   CORBA::ULong len = params.svc_ctx_.length ();
00058   IOP::ServiceContext* context_list = params.svc_ctx_.get_buffer (1);
00059   this->reply_service_info_.replace (max, len, context_list, 1);
00060 
00061   // Must reset the message state, it is possible that the same reply
00062   // dispatcher is used because the request must be re-sent.
00063   //this->message_state_.reset (0);
00064 
00065   // Transfer the <params.input_cdr_>'s content to this->reply_cdr_
00066   ACE_Data_Block *db =
00067     this->reply_cdr_.clone_from (params.input_cdr_);
00068 
00069   // See whether we need to delete the data block by checking the
00070   // flags. We cannot be happy that we initally allocated the
00071   // datablocks of the stack. If this method is called twice, as is in
00072   // some cases where the same invocation object is used to make two
00073   // invocations like forwarding, the release becomes essential.
00074   if (ACE_BIT_DISABLED (db->flags (),
00075                         ACE_Message_Block::DONT_DELETE))
00076     db->release ();
00077 
00078   this->state_changed (TAO_LF_Event::LFS_SUCCESS);
00079 
00080   return 1;
00081 }

TAO_InputCDR & TAO_Synch_Reply_Dispatcher::reply_cdr void   
 

Return the reply CDR.

Definition at line 43 of file Synch_Reply_Dispatcher.cpp.

References reply_cdr_.

Referenced by TAO_GIOP_Synch_Invocation::inp_stream.

00044 {
00045   return this->reply_cdr_;
00046 }


Member Data Documentation

char TAO_Synch_Reply_Dispatcher::buf_[ACE_CDR::DEFAULT_BUFSIZE] [private]
 

The buffer that is used to initialise the data block.

Definition at line 76 of file Synch_Reply_Dispatcher.h.

ACE_Data_Block TAO_Synch_Reply_Dispatcher::db_ [private]
 

datablock that is created on teh stack to initialise the CDR stream underneath.

Definition at line 80 of file Synch_Reply_Dispatcher.h.

TAO_ORB_Core* TAO_Synch_Reply_Dispatcher::orb_core_ [private]
 

Cache the ORB Core pointer.

Definition at line 66 of file Synch_Reply_Dispatcher.h.

TAO_InputCDR TAO_Synch_Reply_Dispatcher::reply_cdr_ [private]
 

CDR stream which has the reply information that needs to be demarshalled by the stubs.

Definition at line 84 of file Synch_Reply_Dispatcher.h.

Referenced by dispatch_reply, and reply_cdr.

IOP::ServiceContextList& TAO_Synch_Reply_Dispatcher::reply_service_info_ [protected]
 

The service context list.

Definition at line 62 of file Synch_Reply_Dispatcher.h.

Referenced by dispatch_reply.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:41:24 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002