public class PeriodicParameters extends ReleaseParameters implements Cloneable
Jamaica Real-Time Specification for Java class PeriodicParameters.
This class characterizes the release of schedulable objects that
are released regularly at constant intervals. Used as release
parameters for a RealtimeThread, this enables the thread to wait for
the next release by a call to RealtimeThread.waitForNextRelease()
.
Used as
release parameters for an AsyncBaseEventHandler
, this indicates
that this handler is released by events that occur periodically such as
a PeriodicTimer
. Note that for an AsyncBaseEventHandler
,
the periodic 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 schedulable 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 simultaneously without proper explicit synchronization.
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
clone creates 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 new
period, cost, and deadline parameters.
|
PeriodicParameters |
setPeriod(RelativeTime period)
setPeriod sets the period.
|
PeriodicParameters |
setStart(HighResolutionTime<?> start)
setStart set the start time.
|
getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, getEventQueueOverflowPolicy, isRousable, setCost, setCostOverrunHandler, setDeadline, setDeadlineMissHandler, setIfFeasible, setIfFeasible, setRousable
public PeriodicParameters(HighResolutionTime<?> start, RelativeTime period)
StaticIllegalArgumentException
- 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.start
- The time of the first release. If start is an instance of
RelativeTime, its value will be used as the release time of the associated
thread relative to the time the start() method of the thread was called.
If an instance of class AbsoluteTime is passed, the associated thread
will be released either at the time start() is called or at the time
corresponding to the start parameter, whichever comes later.
If null, the default value will be new RelativeTime(0, 0).period
- The time between two periodic releases, in other words,
the time interval between the return of two successive calls to
interval between the return of two successive calls to
waitForNextRelease()
or waitForNextReleaseInterruptible()
.
This argument must not be null or a time <= 0.public PeriodicParameters(RelativeTime period)
StaticIllegalArgumentException
- 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.period
- The time between two periodic releases, in other words,
the time interval between the return of two successive calls to
waitForNextRelease()
or waitForNextReleaseInterruptible()
.
This argument must not be null or a time <= 0.public PeriodicParameters(HighResolutionTime<?> start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
StaticIllegalArgumentException
- 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.start
- The time of the first release. If start is an instance of
RelativeTime, its value will be used as the release time of the associated
thread relative to the time the start() method of the thread was called.
If an instance of class AbsoluteTime is passed, the associated thread
will be released either at the time start() is called or at the time
corresponding to the start parameter, whichever comes later.
If null, the default value will be new RelativeTime(0, 0).period
- The time between two periodic releases, in other words,
the time interval between the return of two successive calls to
waitForNextRelease
or waitForNextReleaseInterruptible
.
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 RelativeTime(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.public boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline)
StaticIllegalArgumentException
- if the period is null
or negative or zero, if cost is negative or deadline is negative
or zero.period
- The time between two periodic releases, in other words,
the time interval between the return of two successive calls to
waitForNextRelease
or waitForNextReleaseInterruptible
.
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).public HighResolutionTime<?> getStart()
public PeriodicParameters setStart(HighResolutionTime<?> start)
StaticIllegalArgumentException
- if start is a negative
RelativeTime.start
- The time of the first release. If start is an instance of
RelativeTime, its value will be used as the release time of the associated
thread relative to the time the start() method of the thread will be called
If an instance of class AbsoluteTime is passed, the associated thread
will be released either at the time start() is called or at the time
corresponding to the start parameter, whichever comes later.
If null, the default value will be new RelativeTime(0, 0).public RelativeTime getPeriod()
public PeriodicParameters setPeriod(RelativeTime period)
StaticIllegalArgumentException
- if the period is null
or negative or zero.period
- The time between two periodic releases, in other words,
the time interval between the return of two successive calls to
waitForNextRelease
or waitForNextReleaseInterruptible
.
This argument must not be null or a time <= 0.public Object clone()
clone
in class ReleaseParameters
Cloneable
aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2019 aicas GmbH. All Rights Reserved.