All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface calypso.util.tasc.Scheduler

public interface Scheduler
extends Runnable
An interface for schedulers. Schedulers are objects that execute tasks by calling their run() methods. Different scheduler types base the execution order and the execution time of the tasks on different criterias. For example, a priority scheduler executes tasks based on their relative priority, and a timeout scheduler executes tasks at a given timeout, that is, in the future.

Schedulers implement the Runnable interface, that is, they can be executed by calling their run() methods. Schedulers are explicitely required not to reserve the CPU for too long. Due to this schedulers must give up the control to other threads sufficiently frequently. This can be done, for example, by letting a scheduler call the yield() method of its thread sufficiently frequently.

Requirement 1: Scheduler and task interfaces form an inheritance hierarchy. A certain scheduler must be able to schedule tasks that implement or extend a corresponding task interface. This enables decoupling of tasks and schedulers.

Requirement 2: If a scheduler interface extends another scheduler interface, it must be able to schedule the same task types that the extended interface does. For example, a PriorityTaskScheduler must be able to schedule Tasks, not just PriorityTasks.

Author:
Petteri Koponen
See Also:
Task, SHandle

Method Index

 o stop()
Stops the scheduling.

Methods

 o stop
 public abstract 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