javax.realtime
Class AperiodicParameters
java.lang.Object
|
+--javax.realtime.ReleaseParameters
|
+--javax.realtime.AperiodicParameters
- Direct Known Subclasses:
- SporadicParameters
- public class AperiodicParameters
- extends ReleaseParameters
The release parameter object characterizes a schedulable object that may become
active at atny time. When a reference to a AperiodicParameters
object is given as a parameter to a constructor the
AperiodicParameters
object becomes bound to the object being created.
Changed to the values in the AperiodicParameters
object affect the
constructed object. If given to more than one constructor then changes to the values
in the AperiodicParameters
object affect all of the associated
objects. Note that this is a one-to-many relationship and not a many-to-many.
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.
Field Summary |
(package private) java.util.LinkedList |
schList
|
Constructor Summary |
AperiodicParameters(javax.realtime.RelativeTime cost,
javax.realtime.RelativeTime deadline,
javax.realtime.AsyncEventHandler overrunHandler,
javax.realtime.AsyncEventHandler missHandler)
Create an AperiodicParameters object. |
Method Summary |
boolean |
bindSchedulable(javax.realtime.Schedulable sch)
Informs this that there is one more instance of Schedulable
that uses this as its ReleaseParameters . |
boolean |
setIfFeasible(javax.realtime.RelativeTime cost,
javax.realtime.RelativeTime deadline)
This method appears in many classes in the RTSJ and with various parameters. |
boolean |
unbindSchedulable(javax.realtime.Schedulable sch)
Informs this that Schedulable sch
that uses this as its ReleaseParameters . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
schList
java.util.LinkedList schList
AperiodicParameters
public AperiodicParameters(javax.realtime.RelativeTime cost,
javax.realtime.RelativeTime deadline,
javax.realtime.AsyncEventHandler overrunHandler,
javax.realtime.AsyncEventHandler missHandler)
- Create an
AperiodicParameters
object.
- Parameters:
cost
- Processing time per invocation. 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. 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. Equivalent to
RelativeTime(0, 0)
if null.deadline
- The latest permissible completion time measured from the release
time of the associated invocation of the schedulable object. Not
used in feasibility analysis for minimum implementation. If null,
the deadline will be RelativeTime(Long.MAX_VALUE, 999999)
.overrunHandler
- This handler is invoked if an invocation of the schedulable
object exceeds cost. Not required for minimum implementation.
If null, nothing happens on the overrun condition.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, nothing
happens on the miss deadline condition.
setIfFeasible
public boolean setIfFeasible(javax.realtime.RelativeTime cost,
javax.realtime.RelativeTime deadline)
- This method appears in many classes in the RTSJ and with various parameters.
The parameters are either new scheduling characteristics for an instance
Schedulable
or an instance of Schedulable
. The
method first performs a feasibility analysis using the new scheduling
characteristics as replacements for the matching scheduling characteristics
of either this
or the given instance of Schedulable
.
If the resulting system is feasible the method replaces the current scheduling
characteristics, of either this
or the given instance of
Schedulable
as appropriate, with the new scheduling characteristics.
- Overrides:
setIfFeasible
in class ReleaseParameters
- Parameters:
cost
- The proposed cost.deadline
- The proposed deadline.
- Returns:
- True, if the resulting system is feasible and the changes are made.
False, if the resulting system is not feasible and no changes are made.
bindSchedulable
public boolean bindSchedulable(javax.realtime.Schedulable sch)
- Informs
this
that there is one more instance of Schedulable
that uses this
as its ReleaseParameters
.
- Overrides:
bindSchedulable
in class ReleaseParameters
unbindSchedulable
public boolean unbindSchedulable(javax.realtime.Schedulable sch)
- Informs
this
that Schedulable sch
that uses this
as its ReleaseParameters
.
- Overrides:
unbindSchedulable
in class ReleaseParameters