CarobNS::ControllerPinger Class Reference

Singleton (library-wide) class that manages the list of controllers suspected of failure. More...

#include <ControllerPinger.hpp>

List of all members.

Public Member Functions

void suspectControllerOfFailure (ControllerInfo &controllerInfoPrm)
 Adds the given controller to the list of suspects.
bool isSuspectedOfFailure (const ControllerInfo &controllerInfoPrm)
 Returns true if the specified controller is suspected of failure.
void run ()
 Tries to connect to each suspected controller with a non-blocking connect and checks the connection state.

Static Public Member Functions

static ControllerPingergetInstance ()
 Singleton-access function: retrieves the existing or newly created instance of the ControllerPinger.
static int getNumberOfFailures ()
 Gives the number of controller failures since this process started.


Detailed Description

Singleton (library-wide) class that manages the list of controllers suspected of failure.


Used by controller pools, provides 3 main functions: one for adding a suspect in the list, one for knowing if a controller is already suspected, and on to update the list (ping the controllers to check if they are up again


Member Function Documentation

void CarobNS::ControllerPinger::suspectControllerOfFailure ( ControllerInfo controllerInfoPrm  ) 

Adds the given controller to the list of suspects.


The given controllerInfo argument will be *copied* in the suspected controllers list, but this function will modify the given controller info by setting its failure_number field

Parameters:
controllerInfoPrm the controller suspected of failure

bool CarobNS::ControllerPinger::isSuspectedOfFailure ( const ControllerInfo controllerInfoPrm  ) 

Returns true if the specified controller is suspected of failure.


Parameters:
controllerInfoPrm the controller to check
Returns:
true if the controller is in the suspect list

void CarobNS::ControllerPinger::run (  ) 

Tries to connect to each suspected controller with a non-blocking connect and checks the connection state.

In case of connection success, send the ping command and remove the controller from the suspect list.


The documentation for this class was generated from the following file:
Generated on Tue Oct 24 09:05:38 2006 for Carob by  doxygen 1.5.0