|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.realtime.ReleaseParameters javax.realtime.AperiodicParameters javax.realtime.SporadicParameters
public class SporadicParameters
A notice to the scheduler that the associated schedulable object's run method will be released aperiodically but with a minimum time between releases.
When a reference to a SporadicParameters
object is given
as a parameter to a schedulable object's constructor or passed as an argument to one of the
schedulable object's setter methods, the
SporadicParameters
object becomes the release parameters object bound
to that schedulable object. Changes to the values in the SporadicParameters
object affect that schedulable object. If bound to more than one schedulable object
then changes to the values in the SporadicParameters
object affect all
of the associated objects. Note that this is a one-to-many relationship and
not a many-to-many.
The implementation must use modified copy semantics for each
HighResolutionTime parameter value. The value of each time object
should be treated as if it were copied at the time it is passed to
the parameter object, but the object reference must also be
retained. Only changes to a SporadicParameters
object
caused by methods on that object cause the change to propagate to
all schedulable objects using the parameter object. For instance,
calling setCost
on a SporadicParameters
object will make the change, then notify that the scheduler that
the parameter object has changed. At that point the object is
reconsidered for every SO that uses it. Invoking a method on the
RelativeTime
object that is the cost for this object
may change the cost but it does not pass the change to the
scheduler at that time. That change must not change the behavior
of the SOs that use the parameter object until a setter method on
the SporadicParameters
object is invoked, or the
parameter object is used in setReleaseParameters()
or
a constructor for an SO.
Caution: This class is explicitly unsafe in multithreaded situations when it is being changed. No synchronization is done. It is assumed that users of this class who are mutating instances will be doing their own synchronization at a higher level.
This class allows the application to specify one of four possible behaviors that indicate what to do if an arrival occurs that is closer in time to the previous arrival than the value given in this class as minimum interarrival time, what to do if, for any reason, the queue overflows, and the initial size of the queue.
Attribute |
Value |
---|---|
minInterarrival time | No default. A value must be supplied |
cost | new RelativeTime(0,0) |
deadline | new RelativeTime(min) |
overrunHandler | None |
missHandler | None |
MIT violation policy | SAVE |
Arrival queue overflow policy | SAVE |
Initial arrival queue length | 0 |
Field Summary | |
---|---|
static java.lang.String |
mitViolationExcept
Represents the "EXCEPT" policy for dealing with minimum interarrival time violations. |
static java.lang.String |
mitViolationIgnore
Represents the "IGNORE" policy for dealing with minimum interarrival time violations. |
static java.lang.String |
mitViolationReplace
Represents the "REPLACE" policy for dealing with minimum interarrival time violations. |
static java.lang.String |
mitViolationSave
Represents the "SAVE" policy for dealing with minimum interarrival time violations. |
Fields inherited from class javax.realtime.AperiodicParameters |
---|
arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave |
Constructor Summary | |
---|---|
SporadicParameters(RelativeTime minInterarrival)
Create a SporadicParameters object. |
|
SporadicParameters(RelativeTime minInterarrival,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Create a SporadicParameters object. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Return a clone of this . |
RelativeTime |
getMinimumInterarrival()
Gets the minimum interarrival time. |
java.lang.String |
getMitViolationBehavior()
Gets the arrival time queue behavior in the event of a minimum interarrival time violation. |
boolean |
setIfFeasible(RelativeTime cost,
RelativeTime deadline)
This method first performs a feasibility analysis using the new cost, and deadline as replacements for the matching attributes of this. |
boolean |
setIfFeasible(RelativeTime interarrival,
RelativeTime cost,
RelativeTime deadline)
This method first performs a feasibility analysis using the new interarrival, cost and deadline attributes as replacements for the matching attributes of this. |
void |
setMinimumInterarrival(RelativeTime minimum)
Set the minimum interarrival time. |
void |
setMitViolationBehavior(java.lang.String behavior)
Sets the behavior of the arrival time queue in the case where the new arrival time is closer to the previous arrival time than the minimum interarrival time given in this. |
Methods inherited from class javax.realtime.AperiodicParameters |
---|
getArrivalTimeQueueOverflowBehavior, getInitialArrivalTimeQueueLength, setArrivalTimeQueueOverflowBehavior, setDeadline, setInitialArrivalTimeQueueLength |
Methods inherited from class javax.realtime.ReleaseParameters |
---|
getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadlineMissHandler |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String mitViolationExcept
Schedulable
which has this
as its instance of
ReleaseParameters
occurs at a time less then the minimum interarrival time defined
here then the fire()
method shall throw MITViolationException
. Any other
associated semantics are governed by the schedulers for the schedulable objects using these
sporadic parameters.
If the
arrival time is a result of a happening to which the instance of AsyncEventHandler
is bound then the arrival time is ignored.
public static final java.lang.String mitViolationIgnore
Schedulable
which has this
as its instance of
ReleaseParameters
occurs at a time less then the minimum interarrival time defined
here then the new arrival time is ignored. Any other
associated semantics are governed by the schedulers for the
schedulable objects using these
sporadic parameters.
public static final java.lang.String mitViolationSave
Schedulable
which has
this
as its instance of
ReleaseParameters
is not compared to the specified minimum interarrival
time. Any other
associated semantics are governed by the schedulers for the
schedulable objects using these
sporadic parameters.
public static final java.lang.String mitViolationReplace
Schedulable
which has this
as its instance of
ReleaseParameters
occurs at a time less then the minimum interarrival time defined
here then the information for this arrival replaces a previous arrival. Any other
associated semantics are governed by the schedulers for the
schedulable objects using these
sporadic parameters.
Constructor Detail |
---|
public SporadicParameters(RelativeTime minInterarrival)
SporadicParameters
object.
This constructor is equivalent to:SporadicParameters(minInterarrival, null, null, null, null)
minInterarrival
- The release times of the schedulable object will
occur no closer than this interval.
This time object is treated as if it were copied. Changes to minInterarrival
will not effect the SporadicParameters
object.
There is no default value. If minInterarrival
is null
an illegal argument exception is thrown.
java.lang.IllegalArgumentException
- Thrown if minInterarrival
is null or its time value is not greater than zero.
IllegalAssignmentError
- Thrown if minInterarrival cannot
be stored in this.public SporadicParameters(RelativeTime minInterarrival, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
SporadicParameters
object.
minInterarrival
- The release times of the schedulable object will
occur no closer than this interval.
This time object is treated as if it were copied. Changes to minInterarrival
will not effect the SporadicParameters
object.
There is no default value. If minInterarrival
is null
an illegal argument 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 cost.
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.
For a minimum implementation for purposes of feasibility analysis,
the deadline is equal to the minimum interarrival interval.
Other implementations may use this parameter
to compute execution eligibility.
If null,
the default value is a new instance of RelativeTime(mit)
.overrunHandler
- This handler is invoked if an invocation of the schedulable
object exceeds cost. Not required for minimum implementation.
If null no overrun handler will be used.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,
no deadline miss handler will be used.
java.lang.IllegalArgumentException
- Thrown if minInterarrival
is null or its time value is not greater than zero,
or the time value of cost
is less than zero,
or the time value of deadline
is not greater than zero.
IllegalAssignmentErrorThrown
- if minInterarrival, cost,
deadline, overrunHandler or missHandler cannot be stored in
this.Method Detail |
---|
public java.lang.Object clone()
ReleaseParameters
this
. This method should behave effectively as if
it constructed a new object with clones of the high-resolution time values
of this
.
clone
does not copy any associations from this
and it does not
implicitly bind the new object to a SO.
clone
in class AperiodicParameters
public void setMitViolationBehavior(java.lang.String behavior)
behavior
- A string representing the behavior.
java.lang.IllegalArgumentException
- Thrown if behavior
is not one of the final
MIT violation behavior values
defined in this class.public java.lang.String getMitViolationBehavior()
public boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
this
with the new scheduling characteristics.
setIfFeasible
in class AperiodicParameters
cost
- The proposed cost.
to determine when any particular object exceeds cost.
If null,
the default value is a new instance of RelativeTime(0,0)
.deadline
- The proposed deadline.
If null,
the default value is a new instance of RelativeTime(mit)
.
java.lang.IllegalArgumentException
- Thrown if the time value of cost
is less than zero,
or the time value of deadline
is less than or equal to
zero, or the values are incompatible with the
scheduler for any of the schedulable objects which are presently
using this parameter object.
IllegalAssignmentError
- Thrown if cost or deadline
cannot be stored in this.public boolean setIfFeasible(RelativeTime interarrival, RelativeTime cost, RelativeTime deadline)
Changes to a SporadicParameters
instance effect subsequent
arrivals.
interarrival
- The proposed interarrival time.
There is no default value. If minInterarrival
is null
an illegal argument 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 a new instance of RelativeTime(mit)
.
java.lang.IllegalArgumentException
- Thrown if minInterarrival
is null or its time value is not greater than zero,
or the time value of cost
is less than zero,
or the time value of deadline
is not greater than zero.
IllegalAssignmentError
- Thrown if interarrival, cost or
deadline cannot be stored in this.public RelativeTime getMinimumInterarrival()
public void setMinimumInterarrival(RelativeTime minimum)
minimum
- The release times of the schedulable object will
occur no closer than this interval.
java.lang.IllegalArgumentException
- Thrown if minimum
is null or
its time value is not greater than zero.
IllegalAssignmentError
- Thrown if minimum cannot be
stored in this.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |