|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.ReleaseParameters
javax.realtime.PeriodicParameters
This release parameter indicates that the public boolean RealtimeThread.waitForNextPeriod()
throws
IllegalThreadStateException method on the associated Schedulable
object will be unblocked at the start of each period.
When a reference to a PeriodicParameters
object is
given as a parameter to a constructor the
PeriodicParameters
object becomes bound to the object
being created. Changes to the values in the
PeriodicParameters
object affect the constructed
object. If given to more than one constructor then changes to the
values in the PeriodicParameters
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 | |
protected RelativeTime |
period
|
protected HighResolutionTime |
start
|
Fields inherited from class javax.realtime.ReleaseParameters |
cost, deadline, missHandler, overrunHandler |
Constructor Summary | |
PeriodicParameters(HighResolutionTime start,
RelativeTime period)
Creates a new PeriodicParameters instance. |
|
PeriodicParameters(HighResolutionTime start,
RelativeTime period,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Creates a new PeriodicParameters instance. |
|
PeriodicParameters(RelativeTime period)
Creates a new PeriodicParameters instance. |
Method Summary | |
RelativeTime |
getPeriod()
Get the period value. |
HighResolutionTime |
getStart()
Get the start time. |
boolean |
setIfFeasible(RelativeTime period,
RelativeTime cost,
RelativeTime deadline)
Perform a feasibility analysis with the given replacement values. |
void |
setPeriod(RelativeTime period)
Set the period value. |
void |
setStart(HighResolutionTime start)
Set the start time. |
Methods inherited from class javax.realtime.ReleaseParameters |
clone, getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadline, setDeadlineMissHandler, setIfFeasible |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected HighResolutionTime start
protected RelativeTime period
Constructor Detail |
public PeriodicParameters(HighResolutionTime start, RelativeTime period)
PeriodicParameters
instance. This
constructor has the same effect as invoking
PeriodicParameters(start, period, null, null, null,
null)
.
start
- Time at which the first period begins. If a RelativeTime
, this time is relative to the first time the
schedulable object becomes schedulable (schedulable time)
(e.g., when start() is called on a thread). If an AbsoluteTime
and it is before the schedulable time, start is
equivalent to the schedulable time.period
- The period is the interval between successive
unblocks of RealtimeThread.waitForNextPeriod()
. Must be
greater than zero when entering feasibility analysis.public PeriodicParameters(HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
PeriodicParameters
instance.
start
- Time at which the first period begins. If a RelativeTime
, this time is relative to the first time the
schedulable object becomes schedulable (schedulable time)
(e.g., when start() is called on a thread). If an AbsoluteTime
and it is before the schedulable time, start is
equivalent to the schedulable time.period
- The period is the interval between successive
unblocks of RealtimeThread.waitForNextPeriod()
. Must be
greater than zero when entering feasibility analysis.cost
- Processing time per period. 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 period. 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 period. 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. For a minimum implementation for purposes
of feasibility analysis, the deadline is equal to the period.
Other implementations may use this parameter to compute
execution eligibility. If null, deadline will equal the period.overrunHandler
- This handler is invoked if an invocation
of the schedulable object exceeds cost in the given period. Not
required for minimum implementation. If null, nothing happens
on the overrun condition.missHandler
- This handler is invoked if the Runnable.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.public PeriodicParameters(RelativeTime period)
PeriodicParameters
instance. This
constructror has the same effect as invoking
PeriodicParameters(null, period, null, null, null,
null)
.
period
- the period parameterMethod Detail |
public RelativeTime getPeriod()
RelativeTime
representing the period value.public void setPeriod(RelativeTime period)
period
- The period is the interval between successive
unblocks of RealtimeThread.waitForNextPeriod()
. Must be
greater than zero when entering feasibility analysis.public HighResolutionTime getStart()
HighResolutionTime
valuepublic void setStart(HighResolutionTime start)
start
- time at which the first period begins.public boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline)
period
- the suggested periodcost
- the suggested costdeadline
- the suggested deadline
IllegalArgumentException
- if period
is
null or nonpositive, if cost
is negative,
if deadline
is nonpositive, or if values are
incompatible with the current scheduler(s)
IllegalAssignmentError
- if one or more of the arguments
cannot be referred to by this
; in this case, no
changes are made, even for those parameters that can be stored
in this
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |