public class SporadicParameters extends AperiodicParameters
When a reference to a SporadicParameters
object is
given as a parameter to a schedulable's constructor or passed
as an argument to one of the schedulable's setter methods, the
SporadicParameters
object becomes the release parameters
object bound to that schedulable. Changes to the values in the
SporadicParameters
object affect that schedulable
object. When bound to more than one schedulable 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 when 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
schedulables using the parameter object. For instance,
calling setCost
on a SporadicParameters
object will make the change, then notify 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, the parameter
object is used in setReleaseParameters()
, or the object is used in a
constructor for an SO.
The following table gives the default parameter values for the constructors.
Attribute |
Value |
---|---|
minInterarrival time | No default. A value must be supplied |
cost | new RelativeTime(0,0) |
deadline | new RelativeTime(mit) |
overrunHandler | None |
missHandler | None |
rousable | false |
MIT violation policy | SAVE |
Arrival queue overflow policy | SAVE |
Initial arrival queue length | 0 |
This class enables the application to specify one of four
arrival behaviors defined by MinimumInterarrivalPolicy
.
Each behavior indicates what to do when an arrival occurs that is
closer in time to the previous arrival than the value given in this
class as minimum interarrival time. They also specify what to do
when, for any reason, the queue overflows, and what the initial
size of the queue should be.
Caution: This class is explicitly unsafe for multithreading when being changed. Code that mutates instances of this class should synchronize at a higher level.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
mitViolationExcept
Deprecated.
since RTSJ 2.0
|
static java.lang.String |
mitViolationIgnore
Deprecated.
since RTSJ 2.0
|
static java.lang.String |
mitViolationReplace
Deprecated.
since RTSJ 2.0
|
static java.lang.String |
mitViolationSave
Deprecated.
since RTSJ 2.0
|
arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave
DISABLE_MONITORING
Constructor and Description |
---|
SporadicParameters(RelativeTime minInterarrival)
Equivalent to
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean) with an
argument list of (minInterarrival, null, null, null, null, false) . |
SporadicParameters(RelativeTime minInterarrival,
RelativeTime deadline,
AsyncEventHandler missHandler,
boolean rousable)
Equivalent to
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean) with an
argument list of (minInterarrival, null, deadline, null,
missHandler, rousable) . |
SporadicParameters(RelativeTime minInterarrival,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Equivalent to
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean) with an
argument list of (minInterarrival, cost, deadline, overrunHandler,
missHandler, false) . |
SporadicParameters(RelativeTime minInterarrival,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler,
boolean rousable)
Creates a
SporadicParameters object. |
Modifier and Type | Method and Description |
---|---|
RelativeTime |
getMinimumInterarrival()
Determines the current value of minimal interarrival.
|
RelativeTime |
getMinimumInterarrival(RelativeTime value)
Determines the current value of minimum interarrival.
|
MinimumInterarrivalPolicy |
getMinimumInterarrivalPolicy()
Gets the arrival time queue policy for handling minimal interarrival
time underflow.
|
java.lang.String |
getMitViolationBehavior()
Deprecated.
since RTSJ 2.0 and replaced by
getMinimumInterarrivalPolicy() . |
boolean |
setIfFeasible(RelativeTime cost,
RelativeTime deadline)
Deprecated.
as of RTSJ 2.0 The framework for feasibility analysis is inadequate
|
boolean |
setIfFeasible(RelativeTime interarrival,
RelativeTime cost,
RelativeTime deadline)
Deprecated.
as of RTSJ 2.0 The framework for feasibility analysis is inadequate
|
SporadicParameters |
setMinimumInterarrival(RelativeTime minimum)
Sets the minimum interarrival time.
|
SporadicParameters |
setMinimumInterarrivalPolicy(MinimumInterarrivalPolicy policy)
Sets the policy for handling the arrival time queue when the
new arrival time is closer to the previous arrival time than the
minimum interarrival time given in
this . |
void |
setMitViolationBehavior(java.lang.String behavior)
Deprecated.
since RTSJ 2.0 and replaced by
setMinimumInterarrivalPolicy(javax.realtime.MinimumInterarrivalPolicy) . |
getArrivalTimeQueueOverflowBehavior, getInitialArrivalTimeQueueLength, setArrivalTimeQueueOverflowBehavior, setInitialArrivalTimeQueueLength
clone, getCost, getCost, getCostOverrunHandler, getDeadline, getDeadline, getDeadlineMissHandler, getEventQueueOverflowPolicy, getInitialQueueLength, isRousable, setCost, setCostOverrunHandler, setDeadline, setDeadlineMissHandler, setEventQueueOverflowPolicy, setInitialQueueLength, setRousable
@Deprecated 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 schedulables using these
sporadic parameters. When the arrival time is a result of a happening to
which the instance of AsyncEventHandler
is bound then the
arrival time is ignored.@Deprecated 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 schedulables using these
sporadic parameters.@Deprecated 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.@Deprecated 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
schedulables using these sporadic parameters.public SporadicParameters(RelativeTime minInterarrival, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler, boolean rousable)
SporadicParameters
object.minInterarrival
- The release times of the schedulable
will occur no closer than this interval. This time object
is treated as if it were copied. Changes to
minInterarrival
will not affect the
SporadicParameters
object. There is no default
value. When 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 is
executed, this value is the maximum amount of time a
schedulable receives per release. When
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. When null
, the default value is a new
instance of minInterarrival
:
new RelativeTime(minInterarrival)
.overrunHandler
- This handler is invoked when an invocation of
the schedulable exceeds cost. Not required for
minimum implementation. When null
no overrun
handler will be used.missHandler
- This handler is invoked when the
run()
method of the schedulable is
still executing after the deadline has passed. When
null
, no deadline miss handler will be used.rousable
- Determines whether or not an instance of
Schedulable
can be prematurely released by a thread
interrupt.StaticIllegalArgumentException
- when 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, or when the chronograph associated with deadline
and minInterarrival
parameters are not identical or not
an instance of Clock
.IllegalAssignmentError
- when minInterarrival
,
cost
, deadline
, overrunHandler
or
missHandler
cannot be stored in this
.public SporadicParameters(RelativeTime minInterarrival, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean)
with an
argument list of (minInterarrival, cost, deadline, overrunHandler,
missHandler, false)
.public SporadicParameters(RelativeTime minInterarrival, RelativeTime deadline, AsyncEventHandler missHandler, boolean rousable)
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean)
with an
argument list of (minInterarrival, null, deadline, null,
missHandler, rousable)
.public SporadicParameters(RelativeTime minInterarrival)
SporadicParameters(RelativeTime, RelativeTime,
RelativeTime, AsyncEventHandler, AsyncEventHandler, boolean)
with an
argument list of (minInterarrival, null, null, null, null, false)
.public RelativeTime getMinimumInterarrival()
public RelativeTime getMinimumInterarrival(RelativeTime value)
value
- A relative time object to fill and return.value
or, when null
, the last object used
to set the minimal interarrival, set to the current value
of minimal interarrival.public SporadicParameters setMinimumInterarrival(RelativeTime minimum)
minimum
- The release times of the schedulable will
occur no closer than this interval.this
StaticIllegalArgumentException
- when minimum
is null
or
its time value is not greater than zero.IllegalAssignmentError
- when minimum
cannot be stored in this
.public SporadicParameters setMinimumInterarrivalPolicy(MinimumInterarrivalPolicy policy)
this
.policy
- The current policy for MIT violations.public MinimumInterarrivalPolicy getMinimumInterarrivalPolicy()
@Deprecated public void setMitViolationBehavior(java.lang.String behavior)
setMinimumInterarrivalPolicy(javax.realtime.MinimumInterarrivalPolicy)
. Values of behavior
are compared using reference
equality (==) not value equality (equals()
).
behavior
- A string representing the behavior.StaticIllegalArgumentException
- when behavior
is not
one of the final
MIT violation behavior values
defined in this class.@Deprecated public java.lang.String getMitViolationBehavior()
getMinimumInterarrivalPolicy()
.@Deprecated public boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
this
with the new
scheduling characteristics.setIfFeasible
in class AperiodicParameters
cost
- The proposed cost used to determine when any particular
object exceeds cost. When null
, the default
value is a new instance of RelativeTime(0,0)
.deadline
- The proposed deadline. When null
,
the default value is a new instance of RelativeTime(mit)
.true
, when the resulting system is feasible and
the changes are made;
false
, when the resulting system is
not feasible and no changes are made.StaticIllegalArgumentException
- when 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 schedulables which are presently using this
parameter object.IllegalAssignmentError
- when cost
or
deadline
cannot be stored in
this
.@Deprecated 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. When minInterarrival
is
null
an illegal argument exception is thrown.cost
- The proposed cost. When null
, the default
value is a new instance of RelativeTime(0,0)
.deadline
- The proposed deadline. When null
, the
default value is a new instance of
RelativeTime(mit)
.true
, when the resulting system is feasible and
the changes are made;
false
, when the resulting system is
not feasible and no changes are made.StaticIllegalArgumentException
- when 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
- when interarrival
,
cost
or deadline
cannot be stored
in this
.