| java.lang.Object org.continuent.sequoia.driver.WatchedControllers
WatchedControllers | public class WatchedControllers (Code) | | Provides a list of controllers and maintains their state (up or down),
launching appropriatly methods from callback given callback instance.
To each controller is associated a lastTimeSeen value corresponding to the
last time the controller responded to a ping. Their state is updated each
time the lastTimeSeen value is accessed (read or written). At init time, all
controllers are considered as up (responding to pings). Controllers can also
be forced as 'no more responding to pings' (ie. down)
author: Gilles Rayrat version: 1.0 |
allControllersAndStates | final HashMap allControllersAndStates(Code) | | All controllers with their corresponding state
|
controllerTimeout | int controllerTimeout(Code) | | Delay after which a controller will be considered as failing if it did not
respond to pings
|
WatchedControllers | public WatchedControllers(ControllerInfo[] controllers, long initTime, int controllerTimeout, ControllerStateChangedCallback callback)(Code) | | Creates a new list of watched controllers with the given list of
controllers and an initial lastTimeSeen value.
Parameters: controllers - list of all controllers identified by theirControllerInfo Parameters: initTime - initial lastTimeSeen value, typicallySystem.currentTimeMillis() Parameters: callback - Callback implementation to call when a controller statechanges Parameters: controllerTimeout - delay after which a controller will be consideredas failing if it did not respond to pings |
getControllerIterator | final public Iterator getControllerIterator()(Code) | | Returns a 'safe' read-only iterator on controllers' ControllerInfo.
Creates a copy of the controller hashmap keys and returns a iterator on it.
This way, the iterator will not be affected by hashmap operations
|
getOriginalIndexOf | public int getOriginalIndexOf(ControllerInfo controller)(Code) | | Returns the given controllers index in the original list
Parameters: controller - the controller to get index of original index of the given controller |
|
|