|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.Scheduler
javax.realtime.PriorityScheduler
Class which represents the required (by the RTSJ) priority-based scheduler. The default instance is the base scheduler which does fixed priority, preemptive scheduling.
This scheduler, like all schedulers, governs the default values for scheduling-related parameters in its client schedulable objects. The defaults are as follows:
Attribute |
Default Value |
---|---|
Priority parameters | |
Priority | norm priority |
Note that the system contains one instance of the PriorityScheduler
which is the system's base scheduler and is returned by
PriorityScheduler.instance()
.
It may, however, contain instances of
subclasses of PriorityScheduler
and even additional instances
of PriorityScheduler
itself created through this class'
protected constructor.
The instance returned by the
instance()
method
is the base scheduler and is
returned by
Scheduler.getDefaultScheduler()
unless the default scheduler
is reset with
Scheduler.setDefaultScheduler(Scheduler)
.
Field Summary | |
protected java.lang.String |
policyName
|
Constructor Summary | |
PriorityScheduler()
Construct an instance of PriorityScheduler. |
Method Summary | |
protected boolean |
addToFeasibility(Schedulable schedulable)
Inform the scheduler and cooperating facilities that the resouce demands (as expressed in the associated instances of
SchedulingParameters ,
ReleaseParameters ,
MemoryParameters ,
and
ProcessingGroupParameters )
of this
instance of Schedulable will be
considered in the feasibility analysis of the
associated Scheduler until further
notice. |
void |
fireSchedulable(Schedulable schedulable)
Trigger the execution of a schedulable object (like an AsynchEventHandler ). |
static int |
getMaxPriority()
Gets the maximum priority available for a schedulable object managed by this scheduler. |
static int |
getMaxPriority(java.lang.Thread thread)
Gets the maximum priority for the given thread. |
static int |
getMinPriority()
Gets the minimum priority available for a schedulable object managed by this scheduler. |
static int |
getMinPriority(java.lang.Thread thread)
Gets the minimum priority for the given thread. |
int |
getNormPriority()
Gets the normal priority available for a schedulable object managed by this scheduler. |
int |
getNormPriority(java.lang.Thread thread)
Gets the "norm" priority for the given thread. |
java.lang.String |
getPolicyName()
|
static PriorityScheduler |
instance()
Return a reference to the distinguished instance of PriorityScheduler
which is the system's base scheduler. |
boolean |
isFeasible()
Queries this scheduler about the feasibility of the set of schedulable objects currently in the feasibility set. |
protected boolean |
removeFromFeasibility(Schedulable schedulable)
Not currently implemented |
boolean |
setIfFeasible(Schedulable schedulable,
ReleaseParameters release,
MemoryParameters memory)
Returns true if, after considering the values of the parameters, the task set would still be feasible. |
boolean |
setIfFeasible(Schedulable schedulable,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
Returns true if, after considering the values of the parameters, the task set would still be feasible. |
Methods inherited from class javax.realtime.Scheduler |
getDefaultScheduler, setDefaultScheduler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String policyName
Constructor Detail |
public PriorityScheduler()
Method Detail |
protected boolean addToFeasibility(Schedulable schedulable)
SchedulingParameters
,
ReleaseParameters
,
MemoryParameters
,
and
ProcessingGroupParameters
)
of this
instance of Schedulable
will be
considered in the feasibility analysis of the
associated Scheduler
until further
notice. Whether the resulting system is
feasible or not, the addition is completed.Not currently implemented
addToFeasibility
in class Scheduler
schedulable
- The schedulable object to be added.
public void fireSchedulable(Schedulable schedulable)
AsynchEventHandler
).Not currently implemented
fireSchedulable
in class Scheduler
schedulable
- The schedulable object to make active.public java.lang.String getPolicyName()
getPolicyName
in class Scheduler
String
object which is the
name of the scheduling policy used by this.public boolean isFeasible()
Implementation Notes:
The default feasibility test for the
PriorityScheduler
considers a set of schedulable objects with bounded resource
requirements, to always be feasible. This covers all schedulable
objects with release parameters of types
PeriodicParameters
and
SporadicParameters
.
If any schedulable object within the feasibility set has release
parameters of the exact type AperiodicParameters (not a subclass thereof),
then the feasibility set is not feasible, as aperiodic release
characteristics require unbounded resources. In that case, this method
will return false and all methods in the setIfFeasible family of methods
will also return false. Consequently, any call to a setIfFeasible method
that passes a schedulable object which has release parameters of type
AperiodicParameters
,
or passes proposed release parameters of type AperiodicParameters, will
return false. The only time a setIfFeasible
method can return true, when there exists in the feasibility set a
schedulable object with release parameters of type
AperiodicParameters
,
is when the method will change those release parameters to not be
AperiodicParameters
.
Implementations may provide a feasibility test other than the default test just described. In which case the details of that test should be documented here in place of this description of the default implementation.
Not currently implemented
isFeasible
in class Scheduler
public boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
Scheduler
setIfFeasible
in class Scheduler
schedulable
- release
- memory
-
public boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
Scheduler
setIfFeasible
in class Scheduler
schedulable
- release
- memory
- group
-
Not currently implemented
protected boolean removeFromFeasibility(Schedulable schedulable)
removeFromFeasibility
in class Scheduler
schedulable
- The schedulable object to be removed from feasibility
analysis.
public static PriorityScheduler instance()
PriorityScheduler
which is the system's base scheduler.
PriorityScheduler
.public static int getMaxPriority()
public static int getMaxPriority(java.lang.Thread thread)
PriorityScheduler
,
then the maximum
priority for that scheduler is returned. If the given thread is a Java
thread then Thread.MAX_PRIORITY
is returned. Otherwise an exception is thrown.Not currently implemented
thread
- An instance of Thread.
If null, the maximum priority of this scheduler is returned.
thread
java.lang.IllegalArgumentException
- - Thrown if thread is a real-time
thread that is not scheduled by an instance of
PriorityScheduler
.public static int getMinPriority()
public static int getMinPriority(java.lang.Thread thread)
PriorityScheduler
,
then the minimum priority for that scheduler is
returned. If the given thread is a Java thread then
Thread.MIN_PRIORITY
is returned.
Otherwise an exception is thrown.Not currently implemented
thread
- An instance of Thread.
If null
, the minimum priority of this scheduler is returned.
thread
java.lang.IllegalArgumentException
- Thrown if thread is a
real-time thread that is not scheduled by an instance of
PriorityScheduler
.public int getNormPriority()
public int getNormPriority(java.lang.Thread thread)
PriorityScheduler
,
then the norm priority for that scheduler is returned. If the given
thread is a Java thread then
Thread.NORM_PRIORITY
is returned. Otherwise an exception
is thrown.
thread
- An instance of Thread. If
null
, the norm priority for this scheduler is returned.
java.lang.IllegalArgumentException
- Thrown if thread is a
real-time thread that is not scheduled by an instance of
PriorityScheduler
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |