BEAST
eu.baltrad.beast.rules.timer.TimeoutManager Class Reference

The manager keeping track on all timeouts. More...

Inheritance diagram for eu.baltrad.beast.rules.timer.TimeoutManager:
eu.baltrad.beast.rules.timer.ITimeoutTaskListener

Public Member Functions

 TimeoutManager ()
 Default constructor.
 
void setTimer (Timer timer)
 Sets the timer instance.
 
void setFactory (ITimeoutTaskFactory factory)
 The factory for creating TimeoutTasks.
 
void setMessageManager (IBltMessageManager messageManager)
 
synchronized boolean isRegistered (Object data)
 Checks if any task contains a data object equal to the provided data object.
 
synchronized TimeoutTask getRegisteredTask (Object data)
 Returns the task matching the provided data if any.
 
synchronized long register (ITimeoutRule rule, long delay, Object data)
 Registers a timeout that should be triggered after delay (ms).
 
synchronized void cancel (long id)
 Cancels the timeout with the specified id.
 
synchronized void unregister (long id)
 Unregisters the task with the specified id.
 
void cancelNotification (long id, ITimeoutRule rule, Object data)
 
void timeoutNotification (long id, ITimeoutRule rule, Object data)
 
void destroy () throws Exception
 

Protected Member Functions

synchronized void setStartID (long v)
 Sets the start value for the id-sequence.
 
synchronized long newID ()
 Returns a new unique id for each call.
 

Protected Attributes

Map< Long, TimeoutTasktasks = null
 The registered tasks.
 

Detailed Description

The manager keeping track on all timeouts.

Author
Anders Henja

Constructor & Destructor Documentation

◆ TimeoutManager()

eu.baltrad.beast.rules.timer.TimeoutManager.TimeoutManager ( )
inline

Default constructor.

Member Function Documentation

◆ cancel()

synchronized void eu.baltrad.beast.rules.timer.TimeoutManager.cancel ( long id)
inline

Cancels the timeout with the specified id.

Parameters
idthe id

◆ cancelNotification()

void eu.baltrad.beast.rules.timer.TimeoutManager.cancelNotification ( long id,
ITimeoutRule rule,
Object data )
inline

◆ destroy()

void eu.baltrad.beast.rules.timer.TimeoutManager.destroy ( ) throws Exception
inline
See also
org.springframework.beans.factory.DisposableBean.destroy()

◆ getRegisteredTask()

synchronized TimeoutTask eu.baltrad.beast.rules.timer.TimeoutManager.getRegisteredTask ( Object data)
inline

Returns the task matching the provided data if any.

Parameters
datathe data object to match against
Returns
the object if found otherwise null

◆ isRegistered()

synchronized boolean eu.baltrad.beast.rules.timer.TimeoutManager.isRegistered ( Object data)
inline

Checks if any task contains a data object equal to the provided data object.

Parameters
datathe data object
Returns
true if found otherwise false

◆ newID()

synchronized long eu.baltrad.beast.rules.timer.TimeoutManager.newID ( )
inlineprotected

Returns a new unique id for each call.

Returns
the unique id

◆ register()

synchronized long eu.baltrad.beast.rules.timer.TimeoutManager.register ( ITimeoutRule rule,
long delay,
Object data )
inline

Registers a timeout that should be triggered after delay (ms).

Parameters
rulethe rule to be called
delaythe delay in miliseconds
datadata to be passed on to the one registering the task
Returns
a unique id

◆ setFactory()

void eu.baltrad.beast.rules.timer.TimeoutManager.setFactory ( ITimeoutTaskFactory factory)
inline

The factory for creating TimeoutTasks.

Parameters
factorythe factory

◆ setMessageManager()

void eu.baltrad.beast.rules.timer.TimeoutManager.setMessageManager ( IBltMessageManager messageManager)
inline
Parameters
messageManagerthe message manager to set

◆ setStartID()

synchronized void eu.baltrad.beast.rules.timer.TimeoutManager.setStartID ( long v)
inlineprotected

Sets the start value for the id-sequence.

Parameters
v

◆ setTimer()

void eu.baltrad.beast.rules.timer.TimeoutManager.setTimer ( Timer timer)
inline

Sets the timer instance.

Parameters
timerthe timer

◆ timeoutNotification()

void eu.baltrad.beast.rules.timer.TimeoutManager.timeoutNotification ( long id,
ITimeoutRule rule,
Object data )
inline

◆ unregister()

synchronized void eu.baltrad.beast.rules.timer.TimeoutManager.unregister ( long id)
inline

Unregisters the task with the specified id.

Parameters
idthe id

Member Data Documentation

◆ tasks

Map<Long, TimeoutTask> eu.baltrad.beast.rules.timer.TimeoutManager.tasks = null
protected

The registered tasks.


The documentation for this class was generated from the following file: