com.intel.util
Class TimerManager
java.lang.Objectcom.intel.util.TimerManager
public abstract class TimerManager
- extends java.lang.Object
This class allows timers creation and management.
Nested Class Summary | |
---|---|
class |
TimerManager.Timer
This class describes a single timer object and allows to start, stop and destroy the timer. |
Constructor Summary | |
---|---|
TimerManager()
|
Method Summary | |
---|---|
abstract TimerManager.Timer |
createTimer(TimerClient client)
Creates a timer object and registers the provided TimerClient to
be called on the timer expiration. |
static TimerManager |
getInstance()
A factory method that returns a single instance of TimerManager class. |
Methods inherited from class java.lang.Object |
---|
equals, hashCode, toString |
Constructor Detail |
---|
TimerManager
public TimerManager()
Method Detail |
---|
getInstance
public static final TimerManager getInstance() throws UtilException
- A factory method that returns a single instance of
TimerManager
class.- Returns:
- A single
TimerManager
instance. - Throws:
UtilException
createTimer
public abstract TimerManager.Timer createTimer(TimerClient client) throws UtilException
- Creates a timer object and registers the provided
TimerClient
to be called on the timer expiration. Timer should be destroyed using destroy() method at the end of the use. Pay attention that once timer is destroyed it can not be used and will generate NotInitializedException on each method call. TimerClient must be none null value or IllegalParameterException will be thrown.- Parameters:
client
- theTimerClient
to be invoked on timer expiration- Returns:
- Timer timer object for further start, stop and destroy operations
- Throws:
IllegalParameterException
- exception when method parameters are illegalUtilException