Package com.iizix.timeout.engine
Class TimerEngine
- java.lang.Object
- com.iizix.timeout.engine.TimerEngine
public class TimerEngine extends java.lang.Object
The timer engine handles timeouts and scheduled events.It can be used to register a timeout for a task that runs in a thread. When timeout is reached, the method
ITimeoutListener.onTimeout()
is called from another thread, informing the running thread of this timeout. It is up to the running thread to take appropriate action.It can also handle a scheduled periodic event notification that also runs in a thread.
- Author:
- Christopher Mindus
Constructor Summary
Constructors Constructor Description TimerEngine()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ITimerEngine
getSystemInstance()
Gets the single instance of the timeout engine.static ITimerEngine
newInstance()
Creates a new engine for use in e.g.
Method Detail
getSystemInstance
public static ITimerEngine getSystemInstance()
Gets the single instance of the timeout engine.
newInstance
public static ITimerEngine newInstance()
Creates a new engine for use in e.g. an application or client session.- Returns:
- The new engine. Dispose it after use.