Package com.iizix.timeout.engine
Class TimerEngine
java.lang.Object
com.iizix.timeout.engine.TimerEngine
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
Method Summary
Modifier and TypeMethodDescriptionstatic ITimerEngine
Gets the single instance of the timeout engine.static ITimerEngine
Creates a new engine for use in e.g.
Constructor Details
TimerEngine
public TimerEngine()
Method Details
getSystemInstance
Gets the single instance of the timeout engine.newInstance
Creates a new engine for use in e.g. an application or client session.- Returns:
- The new engine. Dispose it after use.
- Throws:
IllegalStateException
- If the system instance is disposed of.