public abstract class ReleaseParameters<T extends ReleaseParameters<T>> extends Object implements Serializable, Cloneable
Jamaica Real-Time Specification for Java class ReleaseParameters
Release parameter object can be associated to schedulable objects by passing an instance of release parameters to the constructor of the schedulable object or by explicitly setting the release parameters of this schedulable object. A single instance of release parameters can be associated with several different schedulable objects. Changes to the instance of release parameters affect the behavior of all schedulable objects they are associated with.
Note that any changes to RelativeTime 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.
Modifier | Constructor and Description |
---|---|
protected |
ReleaseParameters()
Constructor to construct release parameters with default values
parameters.
|
protected |
ReleaseParameters(RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler)
Constructor to create a new instance of ReleaseParameters.
|
protected |
ReleaseParameters(RelativeTime cost,
RelativeTime deadline,
AsyncEventHandler overrunHandler,
AsyncEventHandler missHandler,
boolean rousable)
Constructor to create a new instance of ReleaseParameters.
|
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 |
getCost()
getCost rturns the current value of cost
|
AsyncEventHandler |
getCostOverrunHandler()
getCostOverrunHandler returns the current cost overrun handler.
|
RelativeTime |
getDeadline()
getDeadline returns the current deadline.
|
AsyncEventHandler |
getDeadlineMissHandler()
getDeadlineMissHandler the current deadline miss handler.
|
QueueOverflowPolicy |
getEventQueueOverflowPolicy()
Gets the behavior of the arrival time queue in the event of
an overflow.
|
boolean |
isRousable()
Determines whether or not a thread interrupt will cause instances of
Schedulable associated with an instance of this class
to be prematurely released, i.e., released before the very first release
event happens. |
T |
setCost(RelativeTime cost)
setCost sets the cost for this ReleaseParameters.
|
T |
setCostOverrunHandler(AsyncEventHandler overrunHandler)
setCostOverrunHandler sets the cost overrun handler.
|
T |
setDeadline(RelativeTime deadline)
setDeadline sets the deadline.
|
T |
setDeadlineMissHandler(AsyncEventHandler handler)
setDeadlineMissHandler sets the deadline miss handler
|
boolean |
setIfFeasible(RelativeTime cost,
RelativeTime deadline)
setIfFeasible performs a feasibility analysis using the new
cost and deadline parameters.
|
T |
setRousable(boolean value)
Dictates whether or not a thread interrupt will cause instances of
Schedulable associated with an instance of this class
to be prematurely released, i.e., released before the very first release
event happens. |
protected ReleaseParameters()
ReleaseParemeters(null, null, null, null);
protected ReleaseParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
StaticIllegalArgumentException
- if cost is negative or
deadline is negative or zero.IllegalAssignmentError
- when cost, deadline,
overrunHandler, or missHandler cannot be stored in this.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(Long.MAX_VALUE, 999999).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.protected ReleaseParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler, boolean rousable)
StaticIllegalArgumentException
- if cost is negative or
deadline is negative or zero.IllegalAssignmentError
- when cost, deadline,
overrunHandler, or missHandler cannot be stored in this.
Since RTSJ 2.0cost
- 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(Long.MAX_VALUE, 999999).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.rousable
- When true
, an interrupt will cause this
schedulable fire immediately.public boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
StaticIllegalArgumentException
- if cost is negative or
deadline is negative or zero.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 T setRousable(boolean value)
Schedulable
associated with an instance of this class
to be prematurely released, i.e., released before the very first release
event happens.value
- When rousable, true
and false
when not.this
public boolean isRousable()
Schedulable
associated with an instance of this class
to be prematurely released, i.e., released before the very first release
event happens. It has no effect for periodic realtime threads, since
the first event of a timing is when start is called. The default value,
i.e., before any call to setRousable(boolean)
, is false
.
Note that the rousable state has no effect on instances of
RealtimeThread
which have an instance of
BackgroundParameters
for ReleaseParameters
or
on ordinary event handlers, i.e., those which do not extend
ActiveEvent
. In the former case, there are no releases to
interrupt and, in the case, the handler does not have a
ActiveEventDispatcher
to release it.
true
when rousable and false
when not.public RelativeTime getCost()
public AsyncEventHandler getCostOverrunHandler()
public RelativeTime getDeadline()
public AsyncEventHandler getDeadlineMissHandler()
public T setCost(RelativeTime cost)
StaticIllegalArgumentException
- if cost is negativecost
- 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.
public T setCostOverrunHandler(AsyncEventHandler overrunHandler)
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.overrunHandler
- handler to be invoked in case of an overrun
situation, i.e., if the handler does not finish execution before
the next invocation.public T setDeadline(RelativeTime deadline)
StaticIllegalArgumentException
- if deadline is
negative or zero.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 T setDeadlineMissHandler(AsyncEventHandler handler)
handler
- handler to be invoked in case the deadline is
missed, i.e., the execution took longer than the specified
deadline.public Object clone()
public QueueOverflowPolicy getEventQueueOverflowPolicy()
AperiodicParameters.getInitialArrivalTimeQueueLength()
in the subclass AperiodicParameters should be used.StaticUnsupportedOperationException
- when used with an
AperiodParameters, since that class is not yet implemented
for this method.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2022 aicas GmbH. All Rights Reserved.