All Packages Class Hierarchy This Package Previous Next Index
Class calypso.util.tasc.TimeoutTaskBasicScheduler
java.lang.Object
|
+----calypso.util.tasc.TimeoutTaskBasicScheduler
- public class TimeoutTaskBasicScheduler
- extends Object
- implements TimeoutTaskScheduler
A basic scheduler for timeout tasks.
- Author:
- Petteri Koponen
- See Also:
- TimeoutTask, TimeoutTaskSHandle
-
_continue
- This is true, if the scheduler should continue executing tasks.
-
_earliestTimeout
- The earliest timeout in milliseconds.
-
_handleList
- An OrderedList that holds TimeoutTaskSHandles.
-
_hasEarliestTimeoutChanged
- This is true, if earliest timeout has changed.
-
_timeoutResolution
- Timeout resolution.
-
NORM_TIMEOUT_RESOLUTION
- The default timeout resolution in msecs.
-
TimeoutTaskBasicScheduler()
-
-
TimeoutTaskBasicScheduler(long)
-
-
makeTimeoutTaskSHandle(TimeoutTask)
- Returns a timeout task scheduling handle for a timeout task.
-
run()
- Runs the timeout scheduler.
-
stop()
- Stops the scheduling.
NORM_TIMEOUT_RESOLUTION
public static final long NORM_TIMEOUT_RESOLUTION
- The default timeout resolution in msecs.
This is used to avoid too short-length waits in the scheduler's run()
method.
- See Also:
- run
_timeoutResolution
protected long _timeoutResolution
- Timeout resolution.
_continue
boolean _continue
- This is true, if the scheduler should continue executing tasks.
_handleList
OrderedList _handleList
- An OrderedList that holds TimeoutTaskSHandles.
When inserted into the list push() method, the handle to be inserted
compares itself with other handles and gets inserted before all the
handles with greater timeout.
_earliestTimeout
protected long _earliestTimeout
- The earliest timeout in milliseconds.
Initially --- and if there are no timeouts --- equal to Long.MAX_VALUE.
_hasEarliestTimeoutChanged
protected boolean _hasEarliestTimeoutChanged
- This is true, if earliest timeout has changed.
TimeoutTaskBasicScheduler
public TimeoutTaskBasicScheduler()
TimeoutTaskBasicScheduler
public TimeoutTaskBasicScheduler(long timeoutResolution_)
makeTimeoutTaskSHandle
public TimeoutTaskSHandle makeTimeoutTaskSHandle(TimeoutTask task_)
- Returns a timeout task scheduling handle for a timeout task.
- Parameters:
- task_ - A timeout task.
- Returns:
- A timeout task scheduling handle.
run
public synchronized void run()
- Runs the timeout scheduler.
stop
public void stop()
- Stops the scheduling.
This method causes the scheduler to return from its run() method and
by doing so to deactivate its thread. However, this method does not
clear the queue(s) of the thread.
All Packages Class Hierarchy This Package Previous Next Index