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

Variable Index

 o _continue
This is true, if the scheduler should continue executing tasks.
 o _earliestTimeout
The earliest timeout in milliseconds.
 o _handleList
An OrderedList that holds TimeoutTaskSHandles.
 o _hasEarliestTimeoutChanged
This is true, if earliest timeout has changed.
 o _timeoutResolution
Timeout resolution.
 o NORM_TIMEOUT_RESOLUTION
The default timeout resolution in msecs.

Constructor Index

 o TimeoutTaskBasicScheduler()
 o TimeoutTaskBasicScheduler(long)

Method Index

 o makeTimeoutTaskSHandle(TimeoutTask)
Returns a timeout task scheduling handle for a timeout task.
 o run()
Runs the timeout scheduler.
 o stop()
Stops the scheduling.

Variables

 o 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
 o _timeoutResolution
 protected long _timeoutResolution
Timeout resolution.

 o _continue
 boolean _continue
This is true, if the scheduler should continue executing tasks.

 o _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.

 o _earliestTimeout
 protected long _earliestTimeout
The earliest timeout in milliseconds. Initially --- and if there are no timeouts --- equal to Long.MAX_VALUE.

 o _hasEarliestTimeoutChanged
 protected boolean _hasEarliestTimeoutChanged
This is true, if earliest timeout has changed.

Constructors

 o TimeoutTaskBasicScheduler
 public TimeoutTaskBasicScheduler()
 o TimeoutTaskBasicScheduler
 public TimeoutTaskBasicScheduler(long timeoutResolution_)

Methods

 o 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.
 o run
 public synchronized void run()
Runs the timeout scheduler.

 o 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