javax.realtime
Class AperiodicParameters
java.lang.Object
|
+--javax.realtime.ReleaseParameters
|
+--javax.realtime.AperiodicParameters
- Direct Known Subclasses:
- SporadicParameters
- public class AperiodicParameters
- extends ReleaseParameters
This release parameter object characterizes a schedulable object that may
become active at any 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. Changes 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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AperiodicParameters
public AperiodicParameters(RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
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(RelativeTime cost,
RelativeTime deadline)
- Attempt to change the cost and deadline. The values will be changed
if the resulting system is feasible. If
the resulting system would not be feasible no changes are made.
- Overrides:
setIfFeasible
in class ReleaseParameters
- Parameters:
cost
- The proposed cost. If zero, no change is made.deadline
- The proposed deadline. If zero, no change is made.- 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.