lejos.realtime
Class EDFScheduler

java.lang.Object
  extended by lejos.realtime.Scheduler
      extended by lejos.realtime.EDFScheduler

public class EDFScheduler
extends Scheduler

Author:
team iRbot

Method Summary
 void fireSchedulable(Schedulable schedulable)
          Trigger the execution of a schedulable object (like an AsyncEventHandler).
 String getPolicyName()
          Gets a string representing the policy of this.
static EDFScheduler instance()
           
 boolean isFeasible()
          Queries the system about the feasibility of the system currently being considered.
 boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
          This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of schedulable.
 boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
           
 boolean setIfFeasible(Schedulable schedulable, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
           
 
Methods inherited from class lejos.realtime.Scheduler
getDefaultScheduler, setDefaultScheduler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fireSchedulable

public void fireSchedulable(Schedulable schedulable)
Trigger the execution of a schedulable object (like an AsyncEventHandler).

Specified by:
fireSchedulable in class Scheduler
Parameters:
schedulable - - The schedulable object to make active. If null, nothing happens.
Throws:
UnsupportedOperationException - - Thrown if the scheduler cannot release schedulable for execution.

getPolicyName

public String getPolicyName()
Gets a string representing the policy of this. The string value need not be interned, but it must be created in a memory area that does not cause an illegal assignment error if stored in the current allocation context and does not cause a MemoryAccessError when accessed.

Specified by:
getPolicyName in class Scheduler
Returns:
The policy name (EDF) as a string

isFeasible

public boolean isFeasible()
Queries the system about the feasibility of the system currently being considered.

Specified by:
isFeasible in class Scheduler
Returns:
True, if the system is feasible. False, if not.

setIfFeasible

public boolean setIfFeasible(Schedulable schedulable,
                             ReleaseParameters release,
                             MemoryParameters memory)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of schedulable. If the resulting system is feasible, this method replaces the current parameters of schedulable with the proposed ones. This method does not require that the schedulable object be in the feasibility set before it is called. If it is not initially a member of the feasibility set it will be added if the resulting system is feasible.

Specified by:
setIfFeasible in class Scheduler
Parameters:
schedulable - - The schedulable object for which the changes are proposed.
release - - The proposed release parameters. If null, the default value of this scheduler is used (a new object is created if the default value is not null).
memory - - The proposed memory parameters. If null, the default value of this scheduler is used (a new object is created if the default value is not null).
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.
Throws:
IllegalArgumentException - - Thrown if schedulable is null, or schedulable is not associated with this scheduler, or the proposed parameters are not compatible with this scheduler.
IllegalAssignmentError - - Thrown if schedulable cannot hold references to the proposed parameter objects, or the parameter objects cannot hold a reference to schedulable.
java.lang.IllegalThreadStateException - - Thrown if the new release parameters change schedulable from periodic scheduling to some other protocol and schedulable is currently waiting for the next release in RealtimeThread.waitForNextPeriod() or RealtimeThread.waitForNextPeriodInterruptible().

setIfFeasible

public boolean setIfFeasible(Schedulable schedulable,
                             ReleaseParameters release,
                             MemoryParameters memory,
                             ProcessingGroupParameters group)
Specified by:
setIfFeasible in class Scheduler

setIfFeasible

public boolean setIfFeasible(Schedulable schedulable,
                             SchedulingParameters scheduling,
                             ReleaseParameters release,
                             MemoryParameters memory,
                             ProcessingGroupParameters group)
Specified by:
setIfFeasible in class Scheduler

instance

public static EDFScheduler instance()