|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.realtime.SchedulingParameters
lejos.realtime.ReleaseParameters
lejos.realtime.PeriodicParameters
public class PeriodicParameters
Constructor Summary | |
---|---|
PeriodicParameters(HighResolutionTime start,
RelativeTime period)
Create a PeriodicParameters object. |
|
PeriodicParameters(HighResolutionTime start,
RelativeTime period,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Create a PeriodicParameters object. |
|
PeriodicParameters(RelativeTime period)
Create a PeriodicParameters object. |
Method Summary | |
---|---|
RelativeTime |
getPeriod()
Gets the period. |
HighResolutionTime |
getStart()
Gets the start time. |
void |
setDeadline(RelativeTime deadline)
Sets the deadline value. |
boolean |
setIfFeasible(RelativeTime period,
RelativeTime cost,
RelativeTime deadline)
This method first performs a feasibility analysis using the new period, cost and deadline attributes as replacements for the matching attributes of this. |
void |
setPeriod(RelativeTime period)
Sets the period. |
void |
setStart(HighResolutionTime start)
Sets the start time. |
Methods inherited from class lejos.realtime.ReleaseParameters |
---|
clone, getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadlineMissHandler, setIfFeasible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PeriodicParameters(RelativeTime period)
PeriodicParameters(null, period, null, null, null, null)
period
- The period is the interval between successive unblocks of the
RealtimeThread.waitForNextPeriod()
and
RealtimeThread.waitForNextPeriodInterruptible()
methods.
There is no default value. If period is null an exception is thrown.
IllegalArgumentException
- Thrown if the period is null or its time value is not greater
than zero.
IllegalAssignmentError
- Thrown if period cannot be stored in this.public PeriodicParameters(HighResolutionTime start, RelativeTime period)
PeriodicParameters(start, period, null, null, null, null)
start
- Time at which the first release begins (i.e. the real-time
thread becomes eligible for execution.) If a RelativeTime, this time
is relative to the first time the thread becomes activated (that is,
when start() is called). If an AbsoluteTime, then the first release is
the maximum of the start parameter and the time of the call to the
associated RealtimeThread.start() method. If null, the default value is
a new instance of RelativeTime(0,0).period
- The period is the interval between successive unblocks of the
RealtimeThread.waitForNextPeriod() and
RealtimeThread.waitForNextPeriodInterruptible() methods. There is no
default value. If period is null an exception is thrown.
IllegalArgumentException
- Thrown if the period is null or its time value is not greater
than zero.
IllegalAssignmentError
- Thrown if start or period cannot be stored in this.public PeriodicParameters(HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
start
- Time at which the first release begins (i.e. the real-time
thread becomes eligible for execution.) If a RelativeTime, this time is
relative to the first time the thread becomes activated (that is, when
start() is called). If an AbsoluteTime, then the first release is the
maximum of the start parameter and the time of the call to the
associated RealtimeThread.start() method. If null, the default value is
a new instance of RelativeTime(0,0).period
- The period is the interval between successive unblocks of the
RealtimeThread.waitForNextPeriod() and
RealtimeThread.waitForNextPeriodInterruptible() methods. There is no
default value. If period is null an exception is thrown.cost
- Processing time per release. On implementations which can
measure the amount of time a schedulable object is executed, this value
is the maximum amount of time a schedulable object receives per release.
On implementations which cannot measure execution time, this value is
used as a hint to the feasibility algorithm. On such systems it is not
possible to determine when any particular object exceeds or will exceed
cost time units in a release. If null, the default value is a new
instance of RelativeTime(0,0).deadline
- The latest permissible completion time measured from the
release time of the associated invocation of the schedulable object.
If null, the default value is new instance of RelativeTime(period).overrunHandler
- This handler is invoked if an invocation of the schedulable
object exceeds cost in the given release. Implementations may ignore this
parameter. If null, the default value no overrun handler.missHandler
- This handler is invoked if the run() method of the schedulable
object is still executing after the deadline has passed. Although minimum
implementations do not consider deadlines in feasibility calculations,
they must recognize variable deadlines and invoke the miss handler as
appropriate. If null, the default value no deadline miss handler.
IllegalArgumentException
- Thrown if the period is null or its time value is not greater
than zero, or if the time value of cost is less than zero, or if the
time value of deadline is not greater than zero.
IllegalAssignmentError
- Thrown if start, period, cost, deadline, overrunHandler or
missHandler cannot be stored in this.Method Detail |
---|
public RelativeTime getPeriod()
public HighResolutionTime getStart()
public void setDeadline(RelativeTime deadline)
setDeadline
in class ReleaseParameters
deadline
- The latest permissible completion time measured from the
release time of the associated invocation of the schedulable object.
If deadline is null, the deadline is set to a new instance of
RelativeTime equal to period.
IllegalArgumentException
- Thrown if the time value of deadline is less than or equal to
zero, or if the new value of this deadline is incompatible with the
scheduler for any associated schedulable object.
IllegalAssignmentError
- Thrown if deadline cannot be stored in this.public boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline)
period
- The proposed period. There is no default value. If period is
null an exception is thrown.cost
- The proposed cost. If null, the default value is a new instance
of RelativeTime(0,0).deadline
- The proposed deadline. If null, the default value is new
instance of RelativeTime(period).
IllegalArgumentException
- Thrown if the period is null or its time value is not greater
than zero, or if the time value of cost is less than zero, or if the
time value of deadline is not greater than zero. Also thrown if the
values are incompatible with the scheduler for any of the schedulable
objects which are presently using this parameter object.
IllegalAssignmentError
- Thrown if period, cost or deadline cannot be stored in this.public void setPeriod(RelativeTime period)
period
- The value to which period is set.
IllegalArgumentException
- Thrown if the given period is null or its time value is not
greater than zero. Also thrown if period is incompatible with the
scheduler for any associated schedulable object.
IllegalAssignmentError
- Thrown if period cannot be stored in this.public void setStart(HighResolutionTime start)
start
- The new start time. If null, the default value is a new
instance of RelativeTime(0,0).
IllegalArgumentException
- Thrown if the given start time is incompatible with the
scheduler for any of the schedulable objects which are presently using
this parameter object.
IllegalAssignmentError
- Thrown if start cannot be stored in this.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |