Public Member Functions | Protected Attributes | Private Attributes

TAO_Synch_Reply_Dispatcher Class Reference

Reply dispatcher for Synchronous 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 Member Functions

 TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core, IOP::ServiceContextList &sc)
 Constructor.
virtual ~TAO_Synch_Reply_Dispatcher (void)
 Destructor.
TAO_InputCDRreply_cdr (void)
 Return the reply CDR.
virtual int dispatch_reply (TAO_Pluggable_Reply_Params &params)
virtual void connection_closed (void)
virtual void reply_timed_out (void)

Protected Attributes

IOP::ServiceContextList & reply_service_info_
 The service context list.

Private Attributes

TAO_ORB_Coreorb_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_

Detailed Description

Reply dispatcher for Synchronous Method Invocation (SMI)s.

Definition at line 44 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 
)
TAO_Synch_Reply_Dispatcher::~TAO_Synch_Reply_Dispatcher ( void   )  [virtual]

Destructor.

Definition at line 41 of file Synch_Reply_Dispatcher.cpp.

{
}


Member Function Documentation

void TAO_Synch_Reply_Dispatcher::connection_closed ( void   )  [virtual]
int TAO_Synch_Reply_Dispatcher::dispatch_reply ( TAO_Pluggable_Reply_Params params  )  [virtual]

Definition at line 58 of file Synch_Reply_Dispatcher.cpp.

{
  if (params.input_cdr_ == 0)
    return -1;

  this->reply_status_ = params.reply_status ();
  this->locate_reply_status_ = params.locate_reply_status ();

  // Steal the buffer, that way we don't do any unnecesary copies of
  // this data.
  CORBA::ULong const max = params.svc_ctx_.maximum ();
  CORBA::ULong const len = params.svc_ctx_.length ();
  IOP::ServiceContext* context_list = params.svc_ctx_.get_buffer (true);
  this->reply_service_info_.replace (max, len, context_list, true);

  if (this->reply_service_info_.length() > 0)
    {
      orb_core_->service_context_registry ().
        process_service_contexts (this->reply_service_info_, *(params.transport_));
    }

  // Must reset the message state, it is possible that the same reply
  // dispatcher is used because the request must be re-sent.
  // this->message_state_.reset (0);

  // Transfer the <params.input_cdr_>'s content to this->reply_cdr_
  if (ACE_BIT_DISABLED ((*params.input_cdr_).start()->data_block()->flags(),
                        ACE_Message_Block::DONT_DELETE))
  {
    // Data block is on the heap, so just duplicate it.
    this->reply_cdr_ = *params.input_cdr_;
    this->reply_cdr_.clr_mb_flags (ACE_Message_Block::DONT_DELETE);
  }
  else
  {
    ACE_Data_Block *db = this->reply_cdr_.clone_from (*params.input_cdr_);

    if (db == 0)
      {
        if (TAO_debug_level > 2)
          {
            ACE_ERROR ((LM_ERROR,
                        "TAO (%P|%t) - Synch_Reply_Dispatcher::dispatch_reply "
                        "clone_from failed\n"));
          }
        return -1;
      }

    // See whether we need to delete the data block by checking the
    // flags. We cannot be happy that we initally allocated the
    // datablocks of the stack. If this method is called twice, as is in
    // some cases where the same invocation object is used to make two
    // invocations like forwarding, the release becomes essential.
    if (ACE_BIT_DISABLED (db->flags (),
                          ACE_Message_Block::DONT_DELETE))
      {
        db->release ();
      }
  }

  this->state_changed (TAO_LF_Event::LFS_SUCCESS,
                       this->orb_core_->leader_follower ());

  return 1;
}

TAO_InputCDR & TAO_Synch_Reply_Dispatcher::reply_cdr ( void   ) 

Return the reply CDR.

Definition at line 46 of file Synch_Reply_Dispatcher.cpp.

{
  return this->reply_cdr_;
}

void TAO_Synch_Reply_Dispatcher::reply_timed_out ( void   )  [virtual]

Definition at line 52 of file Synch_Reply_Dispatcher.cpp.

{
  // noop
}


Member Data Documentation

The buffer that is used to initialise the data block.

Definition at line 82 of file Synch_Reply_Dispatcher.h.

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

Definition at line 86 of file Synch_Reply_Dispatcher.h.

Cache the ORB Core pointer.

Definition at line 72 of file Synch_Reply_Dispatcher.h.

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

Definition at line 90 of file Synch_Reply_Dispatcher.h.

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

The service context list.

Definition at line 68 of file Synch_Reply_Dispatcher.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines