Public Member Functions | Public Attributes

TAO_Asynch_Timeout_Handler Class Reference

Handler registered with the reactor in case of AMI timeouts. More...

#include <Asynch_Timeout_Handler.h>

Inheritance diagram for TAO_Asynch_Timeout_Handler:
Inheritance graph
[legend]
Collaboration diagram for TAO_Asynch_Timeout_Handler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TAO_Asynch_Timeout_Handler (ACE_Reactor *reactor)
 ~TAO_Asynch_Timeout_Handler ()
long schedule_timer (TAO_Transport_Mux_Strategy *tms, CORBA::ULong request_id, const ACE_Time_Value &max_wait_time)
 Schedule a timer.
virtual int handle_timeout (const ACE_Time_Value &current_time, const void *act)
 Invoked by the reactor on timeout.
virtual void cancel ()
 Cancel this timer, remove it from the reactor.

Public Attributes

TAO_Transport_Mux_Strategytms_
 The transport mux strategy dispatching the reply.
CORBA::ULong request_id_
 Remember the ID of the request.
ACE_Reactorreactor_
 Our reactor.

Detailed Description

Handler registered with the reactor in case of AMI timeouts.

Definition at line 42 of file Asynch_Timeout_Handler.h.


Constructor & Destructor Documentation

TAO_Asynch_Timeout_Handler::TAO_Asynch_Timeout_Handler ( ACE_Reactor reactor  ) 

Definition at line 16 of file Asynch_Timeout_Handler.cpp.

  : tms_ (0),
    request_id_ (0),
    reactor_ (reactor)
{
  // Enable reference counting on the event handler.
  this->reference_counting_policy ().value (
    ACE_Event_Handler::Reference_Counting_Policy::ENABLED);
}

TAO_Asynch_Timeout_Handler::~TAO_Asynch_Timeout_Handler (  ) 

Definition at line 27 of file Asynch_Timeout_Handler.cpp.

{
}


Member Function Documentation

void TAO_Asynch_Timeout_Handler::cancel ( void   )  [virtual]

Cancel this timer, remove it from the reactor.

Definition at line 81 of file Asynch_Timeout_Handler.cpp.

{
  // The tms_ is only set if we got scheduled.
  if (this->tms_)
    {
      this->reactor_->cancel_timer (this);
    }
}

int TAO_Asynch_Timeout_Handler::handle_timeout ( const ACE_Time_Value current_time,
const void *  act 
) [virtual]

Invoked by the reactor on timeout.

Reimplemented from ACE_Event_Handler.

Definition at line 47 of file Asynch_Timeout_Handler.cpp.

{
  // Check if there was a reply dispatcher registered in the tms, if not
  // the reply already got dispatched by another thread
  if (this->tms_->reply_timed_out (this->request_id_) == 0)
    {
      if (TAO_debug_level >= 4)
        {
          ACE_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("TAO_Messaging (%P|%t) - Asynch_Timeout_Handler")
                      ACE_TEXT ("::handle_timeout, request %d timed out\n"),
                                this->request_id_));
        }
    }
  else
    {
      if (TAO_debug_level >= 1)
        {
          ACE_ERROR ((LM_ERROR,
                      ACE_TEXT ("TAO_Messaging (%P|%t) - Asynch_Timeout_Handler")
                      ACE_TEXT ("::handle_timeout, unable to dispatch timed out request %d\n"),
                                this->request_id_));
        }
    }

  // reset any possible timeout errno
  errno = 0;

  // we are unregistered anyway
  return 0;
}

long TAO_Asynch_Timeout_Handler::schedule_timer ( TAO_Transport_Mux_Strategy tms,
CORBA::ULong  request_id,
const ACE_Time_Value max_wait_time 
)

Schedule a timer.

Definition at line 33 of file Asynch_Timeout_Handler.cpp.

{
  // Remember them for later.
  this->tms_ = tms;
  this->request_id_ = request_id;

  return this->reactor_->schedule_timer (this,          // handler
                                         0,             // arg
                                         max_wait_time);
}


Member Data Documentation

Our reactor.

Reimplemented from ACE_Event_Handler.

Definition at line 70 of file Asynch_Timeout_Handler.h.

Remember the ID of the request.

Definition at line 67 of file Asynch_Timeout_Handler.h.

The transport mux strategy dispatching the reply.

Definition at line 64 of file Asynch_Timeout_Handler.h.


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