aicas logoJamaica 6.1 release 1

javax.realtime
Class AperiodicParameters

java.lang.Object
  extended by javax.realtime.ReleaseParameters
      extended by javax.realtime.AperiodicParameters
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
SporadicParameters

public class AperiodicParameters
extends ReleaseParameters
implements java.lang.Cloneable

Jamaica Real-Time Specification for Java class AperiodicParameters

This class characterizes the release of schedulable objects that can be released at any time. Note that the presence of AperiodicParameters typically makes the feasibility analysis of any set of schedulable objects impossible, unless the total execution time required by aperiodic tasks are restricted by adequate ProcessingGroupParameters.

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.


Field Summary
static java.lang.String arrivalTimeQueueOverflowExcept
          The "EXCEPT" policy for dealing with arrival time queue overflow.
static java.lang.String arrivalTimeQueueOverflowIgnore
          The "IGNORE" policy for dealing with arrival time queue overflow.
static java.lang.String arrivalTimeQueueOverflowReplace
          The "REPLACE" policy for dealing with arrival time queue overflow.
static java.lang.String arrivalTimeQueueOverflowSave
          The "SAVE" policy for dealing with arrival time queue overflow.
 
Constructor Summary
AperiodicParameters()
          Create an AperiodicParameters object.
AperiodicParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Constructor of AperiodicParameters to be used as ReleaseParameters for AsyncEventHandler if the event handler will be scheduled aperiodically.
 
Method Summary
 java.lang.Object clone()
          clone creates a clone of this object with the same parameters but without association to any schedulable object.
 java.lang.String getArrivalTimeQueueOverflowBehavior()
          getArrivalTimeQueueOverflowBehavior returns the current arrival time queue overflow behavior.
 int getInitialArrivalTimeQueueLength()
          getInitialArrivalTimeQueueLength returns the initial length of the arrival time queue.
 void setArrivalTimeQueueOverflowBehavior(java.lang.String behavior)
          setArrivalTimeQueueOverflowBehavior sets the behavior for the case of an overflow in the arrival time queue.
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
          setIfFeasible performs a feasibility analysis using the new cost and deadline parameters.
 void setInitialArrivalTimeQueueLength(int initial)
          setInitialArrivalTimeQueueLength sets the initial number of elements in the arrival time queue for the schedulable object that receives this AperiodicParameters in its constructor.
 
Methods inherited from class javax.realtime.ReleaseParameters
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

arrivalTimeQueueOverflowExcept

public static final java.lang.String arrivalTimeQueueOverflowExcept
The "EXCEPT" policy for dealing with arrival time queue overflow. Throws an ArrivalTimeQueueOverflowException on a call to fire() when the arrival time queue would otherwise overflow.

Since:
RTSJ V1.0.1
See Also:
Constant Field Values

arrivalTimeQueueOverflowIgnore

public static final java.lang.String arrivalTimeQueueOverflowIgnore
The "IGNORE" policy for dealing with arrival time queue overflow. Ignores a call to fire() when the arrival time queue would otherwise overflow.

Since:
RTSJ V1.0.1
See Also:
Constant Field Values

arrivalTimeQueueOverflowReplace

public static final java.lang.String arrivalTimeQueueOverflowReplace
The "REPLACE" policy for dealing with arrival time queue overflow. Replaces an entry in the arrival time queue when the arrival time queue would otherwise overflow.

Since:
RTSJ V1.0.1
See Also:
Constant Field Values

arrivalTimeQueueOverflowSave

public static final java.lang.String arrivalTimeQueueOverflowSave
The "SAVE" policy for dealing with arrival time queue overflow. Extends the queue length when the arrival time queue would otherwise overflow. The initial queue length is not affected by this extension.

Since:
RTSJ V1.0.1
See Also:
Constant Field Values
Constructor Detail

AperiodicParameters

public AperiodicParameters()
Create an AperiodicParameters object. This constructor is equivalent to: AperiodicParameters(null, null, null, null).


AperiodicParameters

public AperiodicParameters(RelativeTime cost,
                           RelativeTime deadline,
                           AsyncEventHandler overrunHandler,
                           AsyncEventHandler missHandler)
Constructor of AperiodicParameters to be used as ReleaseParameters for AsyncEventHandler if the event handler will be scheduled aperiodically.

Parameters:
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).
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.
Throws:
java.lang.IllegalArgumentException - if cost is negative or deadline is negative or zero.
Method Detail

setIfFeasible

public boolean setIfFeasible(RelativeTime cost,
                             RelativeTime deadline)
setIfFeasible performs a feasibility analysis using the new cost and deadline parameters. If the resulting system remains feasible, the period, cost, and deadline will be set to the new values. This will change the corresponding attributes of all schedulable objects this is associated with.

Overrides:
setIfFeasible in class ReleaseParameters
Parameters:
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).
Returns:
true if the change was performed and the resulting system is feasible. false if the change would result in an infeasible system and was not performed.
Throws:
java.lang.IllegalArgumentException - if cost is negative or deadline is negative or zero.

getInitialArrivalTimeQueueLength

public int getInitialArrivalTimeQueueLength()
getInitialArrivalTimeQueueLength returns the initial length of the arrival time queue. This value may be different from the actual queue length if the length has been extended due to the use of the arrivalTimeQueueOverflowSave behavior or the length was changed by a call to setInitialArrivalTimeQueueLength after the schedulable object was constructed.

Returns:
the current value for the initial arrival time queue length.
Since:
RTSJ V1.0.1

setInitialArrivalTimeQueueLength

public void setInitialArrivalTimeQueueLength(int initial)
setInitialArrivalTimeQueueLength sets the initial number of elements in the arrival time queue for the schedulable object that receives this AperiodicParameters in its constructor.

Parameters:
initial - the initial arrival time queue length.
Since:
RTSJ V1.0.1

setArrivalTimeQueueOverflowBehavior

public void setArrivalTimeQueueOverflowBehavior(java.lang.String behavior)
setArrivalTimeQueueOverflowBehavior sets the behavior for the case of an overflow in the arrival time queue.

Parameters:
behavior - the behavior, must be one of arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave.
Throws:
java.lang.IllegalArgumentException - if behavior is not one of the constants arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave.
Since:
RTSJ V1.0.1

getArrivalTimeQueueOverflowBehavior

public java.lang.String getArrivalTimeQueueOverflowBehavior()
getArrivalTimeQueueOverflowBehavior returns the current arrival time queue overflow behavior.

Returns:
the current behavior, one of arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave.
Since:
RTSJ V1.0.1

clone

public java.lang.Object clone()
clone creates a clone of this object with the same parameters but without association to any schedulable object. According to RTSJ 1.0.2, the cost and deadline attributes are deep-copied, whereas the missHandler, overrunHandler, and the overflow behavior attributes are only shallow-copied.

Overrides:
clone in class ReleaseParameters
Returns:
a new instance of AperiodicParameters with equal cost and deadline attributes, and copied references of the overrunHandler, missHandler, and overflow behavior attributes.
Since:
RTSJ V1.0.1

aicas logoJamaica 6.1 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2012 aicas GmbH. All Rights Reserved.