com.google.code.rees.scope.util.monitor
Interface TimeoutMonitor<T extends Timeoutable<T>>

All Superinterfaces:
Serializable
All Known Implementing Classes:
ScheduledExecutorTimeoutMonitor

public interface TimeoutMonitor<T extends Timeoutable<T>>
extends Serializable

This interface works in conjunction with the Timeoutable interface to provide a simple timeout mechanism

Author:
rees.byars

Field Summary
static long DEFAULT_MONITOR_FREQUENCY
          5 minutes
 
Method Summary
 void addTimeoutable(T timeoutable)
          Adds the Timeoutable to this monitor
 void destroy()
          Destroys this monitor, stopping its background thread and clearing its Timeoutable cache.
 void init()
          Initializes this monitor, beginning a background thread for monitoring its Timeoutables.
 void removeTimeoutable(T timeoutable)
          Removes this Timeoutable from this monitor
 void setMonitoringFrequency(long frequencyMillis)
          The frequency, in milliseconds, that this monitor will check its Timeoutables for their remaining times.
 

Field Detail

DEFAULT_MONITOR_FREQUENCY

static final long DEFAULT_MONITOR_FREQUENCY
5 minutes

See Also:
Constant Field Values
Method Detail

setMonitoringFrequency

void setMonitoringFrequency(long frequencyMillis)
The frequency, in milliseconds, that this monitor will check its Timeoutables for their remaining times. It should be noted that the frequency is guaranteed to not be less the the given time, but it may incrementally exceed the given time as more Timeoutables are added. This is due to the time required to check each of the Timeoutables.

Parameters:
frequencyMillis -

addTimeoutable

void addTimeoutable(T timeoutable)
Adds the Timeoutable to this monitor

Parameters:
timeoutable -

removeTimeoutable

void removeTimeoutable(T timeoutable)
Removes this Timeoutable from this monitor

Parameters:
timeoutable -

init

void init()
Initializes this monitor, beginning a background thread for monitoring its Timeoutables.


destroy

void destroy()
Destroys this monitor, stopping its background thread and clearing its Timeoutable cache.



Copyright © 2012-2013. All Rights Reserved.