Public Types | Public Member Functions | Private Attributes

TAO_Notify_validate_client_Task Class Reference

ClientControl. More...

#include <Validate_Client_Task.h>

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

List of all members.

Public Types

typedef TAO_Condition
< TAO_SYNCH_MUTEX > 
CONDITION

Public Member Functions

 TAO_Notify_validate_client_Task (const ACE_Time_Value &delay, const ACE_Time_Value &interval, TAO_Notify_EventChannelFactory *ecf)
virtual ~TAO_Notify_validate_client_Task (void)
 destructor...
virtual int svc (void)
void shutdown (void)

Private Attributes

ACE_Time_Value delay_
 The delay of first time validate.
ACE_Time_Value interval_
 The validate interval.
TAO_Notify_EventChannelFactoryecf_
 The event channel.
CONDITION condition_
bool shutdown_

Detailed Description

ClientControl.

Defines the interface for the consumer control strategy. This strategy handles misbehaving or failing consumers. = MEMORY MANAGMENT = LOCKING = TODO

Definition at line 44 of file Validate_Client_Task.h.


Member Typedef Documentation

Definition at line 49 of file Validate_Client_Task.h.


Constructor & Destructor Documentation

TAO_Notify_validate_client_Task::TAO_Notify_validate_client_Task ( const ACE_Time_Value delay,
const ACE_Time_Value interval,
TAO_Notify_EventChannelFactory ecf 
)

Constructor. It does not assume ownership of the <event_channel> parameter.

Definition at line 15 of file Validate_Client_Task.cpp.

  : delay_ (delay),
    interval_ (interval),
    ecf_ (ecf),
    shutdown_ (false)
{
  if (this->activate (THR_NEW_LWP | THR_JOINABLE, 1) == -1)
  {
    ACE_ERROR ((LM_ERROR,
      ACE_TEXT("(%P|%t)TAO_Notify_validate_client_Task: %p\n"),"activate"));
  }
}

TAO_Notify_validate_client_Task::~TAO_Notify_validate_client_Task ( void   )  [virtual]

destructor...

Definition at line 31 of file Validate_Client_Task.cpp.

{
}


Member Function Documentation

void TAO_Notify_validate_client_Task::shutdown ( void   ) 

Definition at line 78 of file Validate_Client_Task.cpp.

{
  {
    ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *(this->condition_.mutex()));
    this->shutdown_ = true;
    this->condition_.signal ();
  }
  this->wait ();
}

int TAO_Notify_validate_client_Task::svc ( void   )  [virtual]

Reimplemented from ACE_Task_Base.

Definition at line 37 of file Validate_Client_Task.cpp.

{
  ACE_Time_Value due = ACE_OS::gettimeofday () + this->delay_;
  while (! this->shutdown_)
  {
    {
      ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, *(this->condition_.mutex()), -1);
      this->condition_.wait (&due);
    }

    if (this->shutdown_)
      break;

    try
    {
      if (TAO_debug_level > 0)
      {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%P|%t)%T TAO_Notify_validate_client_Task::svc validate start\n")));
      }
      this->ecf_->validate ();
      if (TAO_debug_level > 0)
      {
        ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%P|%t)%T TAO_Notify_validate_client_Task::svc validate end\n")));
      }
    }
    catch (...)
    {
      // Ignore all exceptions
    }

    if (this->interval_ == ACE_Time_Value::zero)
      break;

    due = ACE_OS::gettimeofday () + this->interval_;
  }

  return 0;
}


Member Data Documentation

Definition at line 74 of file Validate_Client_Task.h.

The delay of first time validate.

Definition at line 66 of file Validate_Client_Task.h.

The event channel.

Definition at line 72 of file Validate_Client_Task.h.

The validate interval.

Definition at line 69 of file Validate_Client_Task.h.

Definition at line 76 of file Validate_Client_Task.h.


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