aicas logoJamaica 6.1 release 1

javax.realtime
Class Scheduler

java.lang.Object
  extended by javax.realtime.Scheduler
Direct Known Subclasses:
PriorityScheduler

public abstract class Scheduler
extends java.lang.Object

Jamaica Real-Time Specification for Java class Scheduler.

Instances of concrete subclasses of this class manage the execution of schedulable objects according to a given scheduling policy.

Additionally, subclasses may implement an algorithm to perform feasibility analysis on the set of schedulable objects is feasible under the implemented scheduling policy.

Concrete subclasses should typically be singletons, i.e., they should provide a method instance() to obtain the instance of the scheduler.


Constructor Summary
protected Scheduler()
          Constructor to be called by sub-classes of this to initialize the Scheduler.
 
Method Summary
protected abstract  boolean addToFeasibility(Schedulable schedulable)
          addToFeasibility adds the provided schedulable object to the set of schedulable objects that take part in feasibility analysis.
abstract  void fireSchedulable(Schedulable schedulable)
          Fire a release for the given schedulable object.
static Scheduler getDefaultScheduler()
          getDefaultScheduler returns a reference to the default scheduler, which is an instance of PriorityScheduler.
abstract  java.lang.String getPolicyName()
          getPolicyName returns the name of this scheduling policy.
abstract  boolean isFeasible()
          isFeasible checks if the current set of schedulable objects that take part in feasibility analysis form a feasible set
protected abstract  boolean removeFromFeasibility(Schedulable schedulable)
          removeFromFeasibility removes the provided schedulable object from the set of schedulable objects that take part in feasibility analysis.
static void setDefaultScheduler(Scheduler scheduler)
          setDefaultScheduler sets the default scheduler to the given scheduler.
abstract  boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
          setIfFeasible first performs a feasibility analysis using the new release and memory parameters for schedulable.
abstract  boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
          setIfFeasible first performs a feasibility analysis using the new release, memory, and group parameters for schedulable.
abstract  boolean setIfFeasible(Schedulable schedulable, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
          setIfFeasible first performs a feasibility analysis for schedulable using the new scheduling, release, memory, and group parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

protected Scheduler()
Constructor to be called by sub-classes of this to initialize the Scheduler.

Method Detail

addToFeasibility

protected abstract boolean addToFeasibility(Schedulable schedulable)
addToFeasibility adds the provided schedulable object to the set of schedulable objects that take part in feasibility analysis. This means that the schedulable's scheduling, release, memory, and processing group parameters will be taken into account for the feasibility analysis of the overall system.

Parameters:
schedulable - A schedulable object, must not be null.
Returns:
true iff the resulting system is feasible.
Throws:
java.lang.IllegalArgumentException - if schedulable is null or schedulable is neither RealtimeThread nor AsyncEventHandler.

removeFromFeasibility

protected abstract boolean removeFromFeasibility(Schedulable schedulable)
removeFromFeasibility removes the provided schedulable object from the set of schedulable objects that take part in feasibility analysis. This means that the schedulable's scheduling, release, memory, and processing group parameters will not longer be taken into account for the feasibility analysis of the overall system.

Parameters:
schedulable - A schedulable object, must not be null.
Returns:
true if schedulable was successfully removed from the set, false if it could not be removed since it was not part of the set.
Throws:
java.lang.IllegalArgumentException - if schedulable is null or schedulable is neither RealtimeThread nor AsyncEventHandler.

setIfFeasible

public abstract boolean setIfFeasible(Schedulable schedulable,
                                      ReleaseParameters release,
                                      MemoryParameters memory)
setIfFeasible first performs a feasibility analysis using the new release and memory parameters for schedulable. If the resulting system is feasible, the release and memory parameters will be replaced.

Parameters:
schedulable - A schedulable object whose parameters should be changed.
release - the new release parameters. If null, the default value for the associated scheduler will be used.
memory - the new memory parameters. If null, the default value for the associated scheduler will be used. The default value for PriorityScheduler is null.
Returns:
true iff the resulting system is feasible and the new release and memory parameters have been activated. false if the resulting system is not feasible, no changes are made in this case.
Throws:
java.lang.IllegalArgumentException - if schedulable is null, release is null, or the parameter values are not compatible with the scheduler associated to schedulable.
IllegalAssignmentError - if release or memory and schedulable reside in memory areas whose objects cannot refer to one another (in both directions).
java.lang.IllegalThreadStateException - If the old release parameters are periodic, the new release parameters are not periodic, and the schedulable object is currently blocked in waitForNextPeriod or waitForNextPeriodInterruptible.

setIfFeasible

public abstract boolean setIfFeasible(Schedulable schedulable,
                                      ReleaseParameters release,
                                      MemoryParameters memory,
                                      ProcessingGroupParameters group)
setIfFeasible first performs a feasibility analysis using the new release, memory, and group parameters for schedulable. If the resulting system is feasible, the release, memory, and group parameters will be replaced.

Parameters:
schedulable - A schedulable object whose parameters should be changed. Must not be null.
release - the new release parameters. Must not be null.
memory - the new memory parameters. If null, the default value for the associated scheduler will be used. The default value for PriorityScheduler is null.
group - the new processing group parameters. If null, the default value for the associated scheduler will be used. The default value for PriorityScheduler is null.
Returns:
true iff the resulting system is feasible and the new release, memory, and group parameters have been activated. false if the resulting system is not feasible, no changes are made in this case.
Throws:
java.lang.IllegalArgumentException - if schedulable is null, release is null, or the parameter values are not compatible with the scheduler associated to schedulable.
IllegalAssignmentError - if release, memory or group and schedulable reside in memory areas whose objects cannot refer to one another (in both directions).
java.lang.IllegalThreadStateException - If the old release parameters are periodic, the new release parameters are not periodic, and the schedulable object is currently blocked in waitForNextPeriod or waitForNextPeriodInterruptible.

setIfFeasible

public abstract boolean setIfFeasible(Schedulable schedulable,
                                      SchedulingParameters scheduling,
                                      ReleaseParameters release,
                                      MemoryParameters memory,
                                      ProcessingGroupParameters group)
                               throws java.lang.IllegalArgumentException,
                                      IllegalAssignmentError,
                                      java.lang.IllegalThreadStateException
setIfFeasible first performs a feasibility analysis for schedulable using the new scheduling, release, memory, and group parameters. If the resulting system is feasible, the scheduling, release, memory and group parameters of schedulable will be replaced.

Parameters:
schedulable - a schedulable object whose parameters should be changed. Must not be null.
scheduling - the new scheduling parameters.
release - the new release parameters. Must not be null.
memory - the new memory parameters. If null, the default value for the associated scheduler will be used. The default value for PriorityScheduler is null.
group - the new processing group parameters. If null, the default value for the associated scheduler will be used. The default value for PriorityScheduler is null.
Returns:
true if the resulting system is feasible and the new scheduling, release, memory, and group parameters have been activated. false if the resulting system is not feasible, no changes are made in this case.
Throws:
java.lang.IllegalArgumentException - if schedulable is null, release is null or the parameter values are not compatible with the scheduler associated to schedulable.
IllegalAssignmentError - if the parameters or the schedulable reside in memory areas whose objects cannot refer to one another (in both directions).
java.lang.IllegalThreadStateException - if the old release parameters are periodic, the new release parameters are not periodic, and the schedulable object is currently blocked in waitForNextPeriod or waitForNextPeriodInterruptible.

getDefaultScheduler

public static Scheduler getDefaultScheduler()
getDefaultScheduler returns a reference to the default scheduler, which is an instance of PriorityScheduler.

Returns:
PriorityScheduler.instance()

setDefaultScheduler

public static void setDefaultScheduler(Scheduler scheduler)
setDefaultScheduler sets the default scheduler to the given scheduler.

Parameters:
scheduler - the new default scheduler. null to leave the default scheduler unchanged.

getPolicyName

public abstract java.lang.String getPolicyName()
getPolicyName returns the name of this scheduling policy. The result must be in a memory area assignable to the caller's current allocation environment.

Returns:
the name of this policy.

isFeasible

public abstract boolean isFeasible()
isFeasible checks if the current set of schedulable objects that take part in feasibility analysis form a feasible set

Returns:
true iff the system can be proven to be feasible, false if not.

fireSchedulable

public abstract void fireSchedulable(Schedulable schedulable)
                              throws java.lang.UnsupportedOperationException
Fire a release for the given schedulable object.

Parameters:
schedulable - a schedulable object.
Throws:
java.lang.UnsupportedOperationException - is thrown if the scheduler cannot fire a release of schedulable.

aicas logoJamaica 6.1 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2012 aicas GmbH. All Rights Reserved.