All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.Scheduler

java.lang.Object
   |
   +----JavaGroups.Scheduler

public class Scheduler
extends Object
implements Runnable
Implementation of a priority scheduler. The scheduler maintains a queue to the end of which all tasks are added. It continually looks at the first queue element, assigns a thread to it, runs the thread and waits for completion. When a new priority task is added, it will be added to the head of the queue and the scheduler will be interrupted. In this case, the currently handled task is suspended, and the one at the head of the queue handled. This is recursive: a priority task can always be interrupted by another priority task. Resursion ends when no more priority tasks are added, or when the thread pool is exhausted.


Constructor Index

 o Scheduler()
 o Scheduler(int)

Method Index

 o Add(Runnable)
 o AddPrio(Runnable)
 o main(String[])
 o Reset()
 o run()
 o SetListener(SchedulerListener)
 o Start()
 o Stop()

Constructors

 o Scheduler
 public Scheduler()
 o Scheduler
 public Scheduler(int num_threads)

Methods

 o SetListener
 public void SetListener(SchedulerListener l)
 o run
 public void run()
 o AddPrio
 public void AddPrio(Runnable task)
 o Add
 public void Add(Runnable task)
 o Reset
 public void Reset()
 o Start
 public void Start()
 o Stop
 public void Stop()
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index