|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.realtime.ReleaseParameters
javax.realtime.PeriodicParameters
public class PeriodicParameters
Jamaica Realtime Specification for Java class PeriodicParameters.
This class characterizes the release of schedulable objects that are released regularly at constant intervals. Used as release parameters of a RealtimeThread, this enables the thread to wait for the next release by a call to waitForNextPeriod or waitForNextPeriodInterruptible(). Used as release parameters for an AsyncEventHandler, this indicates that this handler is released by events that occur periodically such as e PeriodicTimer. Note that for an AsyncEventHandler, the period release is not enforced automatically by the scheduler, the release parameters are only used for feasibility analysis in this case.
Note that any changes to RelativeTime or HighResolutionTime arguments of this object do not propagate to the schudable object until the corresponding setter method of AperiodicParameters is called to notify this object about the change.
NOTE: the methods in this class are not synchronized. They cannot be used by several threads simulataneously without proper explicit synchronization.
| Constructor Summary | |
|---|---|
PeriodicParameters(HighResolutionTime start,
RelativeTime period)
Create a PeriodicParameters object. |
|
PeriodicParameters(HighResolutionTime start,
RelativeTime period,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Constructor to create an instance of PeriodicParameters with the given initial settings. |
|
PeriodicParameters(RelativeTime period)
Create a PeriodicParameters object. |
|
| Method Summary | |
|---|---|
Object |
clone()
clone create a clone of this object with the same parameters but without association to any schedulable object |
RelativeTime |
getPeriod()
getPeriod returns the current period. |
HighResolutionTime |
getStart()
getStart returns the start time. |
boolean |
setIfFeasible(RelativeTime period,
RelativeTime cost,
RelativeTime deadline)
setIfFeasible performs a feasibility analysis using the the new period, cost and deadline parameters. |
void |
setPeriod(RelativeTime period)
setPeriod sets the period. |
void |
setStart(HighResolutionTime start)
setStart set the start time. |
| Methods inherited from class javax.realtime.ReleaseParameters |
|---|
getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadline, setDeadlineMissHandler, setIfFeasible, setIfFeasible |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PeriodicParameters(HighResolutionTime start,
RelativeTime period)
start - The time of the first release. If this will be used
as release parameter for a RealtimeThread, a start time of class
RelativeTime will be relative to the time method start() will be
called on this thread. A start time of class AbsoluteTime will
result in a release at that time start or immediately after a
call to the thread's start() method if, whichever comes later. If
null, the default value will be new RelativeTime(0,0).period - The time between two periodic releases. If this
will be associated with a RealtimeThread, then this give the time
interval between the return of two successive calls to
waitForNextPeriod() or waitForNextPeriodInterruptible(). This
argument must not be null or a time <=0.
IllegalArgumentException - if start is a negative
RelativeTime, if the period is null or negative or zero, if cost
is negative or deadline is negative or zero.public PeriodicParameters(RelativeTime period)
period - The time between two periodic releases. If this
will be associated with a RealtimeThread, then this give the time
interval between the return of two successive calls to
waitForNextPeriod() or waitForNextPeriodInterruptible(). This
argument must not be null or a time <=0.
IllegalArgumentException - if start is a negative
RelativeTime, if the period is null or negative or zero, if cost
is negative or deadline is negative or zero.
public PeriodicParameters(HighResolutionTime start,
RelativeTime period,
RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
start - The time of the first release. If this will be used
as release parameter for a RealtimeThread, a start time of class
RelativeTime will be relative to the time method start() will be
called on this thread. A start time of class AbsoluteTime will
result in a release at that time start or immediately after a
call to the thread's start() method if, whichever comes later. If
null, the default value will be new RelativeTime(0,0).period - The time between two periodic releases. If this
will be associated with a RealtimeThread, then this give the time
interval between the return of two successive calls to
waitForNextPeriod() or waitForNextPeriodInterruptible(). This
argument must not be null or a time <=0.cost - The CPU time required for each release. If cost
monitoring is performed, this gives the maximum amount of CPU
time that will be allowed for each release. In any case, this may
be used by the feasibility analysis. If null, the default value
will be new RelativeTime(0,0). Note that on a system with cost
monitoring, this default value will allow no execution time for
the associated schedulable object.deadline - The deadline for the completion of one release,
relative to the release time of that release. If null, the
default value is a new instance of RealtiveTime(period).overrunHandler - This handler will be invoked if the cost of
one invocation exceeds the cost parameter. If null, there will be
no overrunHandler.
For JamaicaVM, cost overrun checking is enabled if CpuTime.CPU_TIME_SUPPORTED is true. The
accuracy of the cost enforcement can be specified in nanoseconds
via the property jamaica.cost_monitoring_accuracy. The default
value is 5000000, i.e., 5milliseconds.
missHandler - This handler will be invoked if the deadline
of one release is missed. If null, there will be no deadline miss
handler.
IllegalArgumentException - if start is a negative
RelativeTime, if the period is null or negative or zero, if cost
is negative or deadline is negative or zero.| Method Detail |
|---|
public boolean setIfFeasible(RelativeTime period,
RelativeTime cost,
RelativeTime deadline)
period - The time between two periodic releases. If this
will be associated with a RealtimeThread, then this give the time
interval between the return of two successive calls to
waitForNextPeriod() or waitForNextPeriodInterruptible(). This
argument must not be null or a time <=0.cost - The CPU time required for each release. If cost
monitoring is performed, this gives the maximum amount of CPU
time that will be allowed for each release. In any case, this may
be used by the feasibility analysis. If null, the default value
will be new RelativeTime(0,0). Note that on a system with cost
monitoring, this default value will allow no execution time for
the associated schedulable object.deadline - The deadline for the completion of one release,
relative to the release time of that release. If null, the
default value is a new instance of
RealtiveTime(Long.MAX_VALUE,999999).
IllegalArgumentException - if the period is null
or negative or zero, if cost is negative or deadline is negative
or zero.public HighResolutionTime getStart()
public void setStart(HighResolutionTime start)
start - The time of the first release. If this will be used
as release parameter for a RealtimeThread, a start time of class
RelativeTime will be relative to the time method start() will be
called on this thread. A start time of class AbsoluteTime will
result in a release at that time start or immediately after a
call to the thread's start() method if, whichever comes later. If
null, the default value will be new RelativeTime(0,0).
IllegalArgumentException - if start is a negative
RelativeTime.public RelativeTime getPeriod()
public void setPeriod(RelativeTime period)
period - The time between two periodic releases. If this
will be associated with a RealtimeThread, then this give the time
interval between the return of two successive calls to
waitForNextPeriod() or waitForNextPeriodInterruptible(). This
argument must not be null or a time <=0.
IllegalArgumentException - if the period is null
or negative or zero.public Object clone()
clone in class ReleaseParameters
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||