|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.realtime.Scheduler
lejos.realtime.PriorityScheduler
public class PriorityScheduler
Method Summary | |
---|---|
void |
fireSchedulable(Schedulable schedulable)
Trigger the execution of a schedulable object (like an AsyncEventHandler). |
int |
getMaxPriority()
Gets the maximum priority available for a schedulable object managed by this scheduler. |
static int |
getMaxPriority(Thread thread)
Gets the maximum priority for the given thread. |
int |
getMinPriority()
Gets the minimum priority available for a schedulable object managed by this scheduler. |
static int |
getMinPriority(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. |
static int |
getNormPriority(Thread thread)
Gets the "norm" priority for the given thread. |
String |
getPolicyName()
Gets the policy name of this. |
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. |
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)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of schedulable. |
boolean |
setIfFeasible(Schedulable schedulable,
SchedulingParameters scheduling,
ReleaseParameters release,
MemoryParameters memory,
ProcessingGroupParameters group)
This method first performs a feasibility analysis using the proposed parameter objects as replacements for the current parameters of schedulable. |
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 |
---|
public static PriorityScheduler instance()
public int getMaxPriority()
public static int getMaxPriority(Thread thread)
thread
- - An instance of Thread. If null, the maximum priority of
this scheduler is returned.
IllegalArgumentException
- - Thrown if thread is a
real-time thread that is not scheduled by an instance of
PriorityScheduler.public int getMinPriority()
public static int getMinPriority(Thread thread)
thread
- - An instance of Thread. If null, the minimum priority of
this scheduler is returned.
IllegalArgumentException
- - Thrown if thread is a
real-time thread that is not scheduled by an instance of
PriorityScheduler.public int getNormPriority()
public static int getNormPriority(Thread thread)
thread
- - An instance of Thread. If null, the norm priority for
this scheduler is returned.
IllegalArgumentException
- - Thrown if thread is a
real-time thread that is not scheduled by an instance3 of
PriorityScheduler.public boolean isFeasible()
isFeasible
in class Scheduler
public boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory)
setIfFeasible
in class Scheduler
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). (See PriorityScheduler.)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). (See PriorityScheduler.)
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().public boolean setIfFeasible(Schedulable schedulable, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
setIfFeasible
in class Scheduler
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). (See PriorityScheduler.)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). (See PriorityScheduler.)group
- - The proposed processing group parameters. If null, the
default value of this scheduler is used (a new object is created if the
default value is not null). (See PriorityScheduler.)
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().public boolean setIfFeasible(Schedulable schedulable, SchedulingParameters scheduling, ReleaseParameters release, MemoryParameters memory, ProcessingGroupParameters group)
setIfFeasible
in class Scheduler
schedulable
- - The schedulable object for which the changes are
proposed.scheduling
- - The proposed scheduling parameters. If null, the
default value of this scheduler is used (a new object is created if the
default value is not null). (See PriorityScheduler.)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). (See PriorityScheduler.)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). (See PriorityScheduler.)group
- - The proposed processing group parameters. If null, the
default value of this scheduler is used (a new object is created if the
default value is not null). (See PriorityScheduler.)
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().public void fireSchedulable(Schedulable schedulable)
fireSchedulable
in class Scheduler
schedulable
- - The schedulable object to make active. If null,
nothing happens.
UnsupportedOperationException
- - Thrown in all cases by
the PrioritySchedulerpublic String getPolicyName()
getPolicyName
in class Scheduler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |