public abstract class Scheduler extends 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.
Modifier | Constructor and Description |
---|---|
protected |
Scheduler()
Constructor to be called by sub-classes of this to initialize the
Scheduler.
|
Modifier and Type | Method and Description |
---|---|
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 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.
|
protected Scheduler()
protected abstract boolean addToFeasibility(Schedulable schedulable)
StaticIllegalArgumentException
- if schedulable is null or
schedulable is neither RealtimeThread nor AsyncBaseEventHandler.schedulable
- A schedulable object, must not be null.protected abstract boolean removeFromFeasibility(Schedulable schedulable)
StaticIllegalArgumentException
- if schedulable is null or
schedulable is neither RealtimeThread nor AsyncBaseEventHandler.schedulable
- A schedulable object, must not be null.public abstract boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
StaticIllegalArgumentException
- 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).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.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.public abstract boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
StaticIllegalArgumentException
- 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).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.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.public abstract boolean setIfFeasible(Schedulable schedulable, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group) throws StaticIllegalArgumentException, IllegalAssignmentError, IllegalThreadStateException
StaticIllegalArgumentException
- 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).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.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.public static Scheduler getDefaultScheduler()
public static void setDefaultScheduler(Scheduler scheduler)
scheduler
- the new default scheduler. null to leave the
default scheduler unchanged.public abstract String getPolicyName()
public abstract boolean isFeasible()
public abstract void fireSchedulable(Schedulable schedulable) throws UnsupportedOperationException
UnsupportedOperationException
- is thrown if the scheduler
cannot fire a release of schedulable.schedulable
- a schedulable object.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.