javax.realtime
Class Scheduler

java.lang.Object
  |
  +--javax.realtime.Scheduler
Direct Known Subclasses:
PriorityScheduler

public abstract class Scheduler
extends java.lang.Object

An instance of Scheduler manages the execution of schedulable objects and may implement a feasibility algorithm. The feasibility algorithm may determine if the known set of schedulable objects, given their particular execution ordering (or priority assignment), is a feasible schedule. Subclasses of Scheduler are used for alternative scheduling policies and should define an instance() class method to return the default instance of the subclass. The name of the subclass should be descriptive of the policy, allowing applications to deduce the policy available for the scheduler obtained via getDefaultScheduler() (e.g., EDFScheduler).


Constructor Summary
protected Scheduler()
           
 
Method Summary
protected abstract  boolean addToFeasibility(Schedulable schedulable)
          Inform the scheduler that this thread's ReleaseParameters should be considered in feasibility analysis until further notified.
abstract  void fireSchedulable(Schedulable schedulable)
          Trigger the execution of a schedulable object (like an AsyncEventHandler).
static Scheduler getDefaultScheduler()
          Return a reference to the default scheduler.
abstract  java.lang.String getPolicyName()
          Used to determine the policy of the Scheduler.
abstract  boolean isFeasible()
          Returns true if and only if the system is able to satisfy the constraints expressed in the release parameters of the existing schedulable objects.
protected abstract  boolean removeFromFeasibility(Schedulable schedulable)
          Inform the scheduler that this thread's ReleaseParameters should not be considered in feasibility analysis until further notified.
static void setDefaultScheduler(Scheduler scheduler)
          Set the default scheduler.
 boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
          Returns true if, after changing the Schedulable's release and GC parameters isFeasible would return true.
 boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

protected Scheduler()
Method Detail

addToFeasibility

protected abstract boolean addToFeasibility(Schedulable schedulable)
Inform the scheduler that this thread's ReleaseParameters should be considered in feasibility analysis until further notified.

setIfFeasible

public boolean setIfFeasible(Schedulable schedulable,
                             ReleaseParameters release,
                             MemoryParameters memory)
Returns true if, after changing the Schedulable's release and GC parameters isFeasible would return true. The parameters wil be changed. If the resulting system would not be feasible, this method returns false and no changes are made.
Parameters:
schedulable - The Schedulable object for which to check admittance. If null nothing happens.
release - The proposed ReleaseParameters. If null, no change is made.
memory - The proposed MemoryParameters. If null, no change is made.

setIfFeasible

public boolean setIfFeasible(Schedulable schedulable,
                             ReleaseParameters release,
                             MemoryParameters memory,
                             ProcessingGroupParameters group)

getDefaultScheduler

public static Scheduler getDefaultScheduler()
Return a reference to the default scheduler.

getPolicyName

public abstract java.lang.String getPolicyName()
Used to determine the policy of the Scheduler.
Returns:
A String object which is the name of the scheduling policy used by this.

isFeasible

public abstract boolean isFeasible()
Returns true if and only if the system is able to satisfy the constraints expressed in the release parameters of the existing schedulable objects.

removeFromFeasibility

protected abstract boolean removeFromFeasibility(Schedulable schedulable)
Inform the scheduler that this thread's ReleaseParameters should not be considered in feasibility analysis until further notified.

setDefaultScheduler

public static void setDefaultScheduler(Scheduler scheduler)
Set the default scheduler. This is the scheduler given to instances of RealtimeThread when they are constructed. The default scheduler is set to the required PriorityScheduler at startup.
Parameters:
scheduler - The Scheduler that becomes the default scheduler assigned to new threads. If null nothing happens.

fireSchedulable

public abstract void fireSchedulable(Schedulable schedulable)
Trigger the execution of a schedulable object (like an AsyncEventHandler).
Parameters:
h - The schedulable object to make active.