aicas logoJamaica 6.1 release 1

javax.realtime
Class SporadicParameters

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

public class SporadicParameters
extends AperiodicParameters
implements java.lang.Cloneable

Jamaica Real-Time Specification for Java class SporadicParameters.

This class characterizes the release of schedulable objects that can be released at any time but with a minimum time between two releases. Unlike AperiodicParameters, SporadicParameters does not necessarily make the feasibility analysis of a set of schedulable objects impossible.

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 mitViolationExcept
          The "EXCEPT" policy for dealing with minimum arrival time violations.
static java.lang.String mitViolationIgnore
          The "IGNORE" policy for dealing with minimum arrival time violations.
static java.lang.String mitViolationReplace
          The "REPLACE" policy for dealing with minimum arrival time violations.
static java.lang.String mitViolationSave
          The "SAVE" policy for dealing with minimum arrival time violations.
 
Fields inherited from class javax.realtime.AperiodicParameters
arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave
 
Constructor Summary
SporadicParameters(RelativeTime interarrival)
          Create a SporadicParameters object.
SporadicParameters(RelativeTime interarrival, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Constructor of SporadicParameters to be used as ReleaseParameters for AsyncEventHandler if the event handler will be scheduled aperiodically with a miminum interarrival time between each two releases.
 
Method Summary
 java.lang.Object clone()
          clone creates a clone of this object with the same parameters but without association to any schedulable object.
 RelativeTime getMinimumInterarrival()
          getMinimumInterarrival returns the minimum interarrival time.
 java.lang.String getMitViolationBehavior()
          getMitViolationBehavior returns the current setting of the policy for dealing with minimum arrival time violations.
 boolean setIfFeasible(RelativeTime interarrival, RelativeTime cost, RelativeTime deadline)
          setIfFeasible performs a feasibility analysis using the new period, cost and deadline parameters.
 void setMinimumInterarrival(RelativeTime interarrival)
          setMinimumInterarrival sets the minimum interarrival time to a new value, independent on the impact this will have on the feasibility of the system.
 void setMitViolationBehavior(java.lang.String behavior)
          setMitViolationBehavior sets the policy for dealing with minimum arrival time violations.
 
Methods inherited from class javax.realtime.AperiodicParameters
getArrivalTimeQueueOverflowBehavior, getInitialArrivalTimeQueueLength, setArrivalTimeQueueOverflowBehavior, setIfFeasible, setInitialArrivalTimeQueueLength
 
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

mitViolationExcept

public static final java.lang.String mitViolationExcept
The "EXCEPT" policy for dealing with minimum arrival time violations. Throws a MITViolationException on a call to fire() when the arrival time occurs earlier than the minimum interarrival time since the last release.

See Also:
Constant Field Values

mitViolationIgnore

public static final java.lang.String mitViolationIgnore
The "IGNORE" policy for dealing with minimum arrival time violations. If a call to fire() before the minimum interarrival time time occurs, then the new release is ignored.

See Also:
Constant Field Values

mitViolationReplace

public static final java.lang.String mitViolationReplace
The "REPLACE" policy for dealing with minimum arrival time violations. If a call to fire() before the minimum interarrival time time occurs, then the new release replaces a previous release.

See Also:
Constant Field Values

mitViolationSave

public static final java.lang.String mitViolationSave
The "SAVE" policy for dealing with minimum arrival time violations. When this policy is used, there will be no checks for correct minimum interarrival times for incoming releases.

See Also:
Constant Field Values
Constructor Detail

SporadicParameters

public SporadicParameters(RelativeTime interarrival)
Create a SporadicParameters object. This constructor is equivalent to: SporadicParameters(interarrival, null, null, null, null).


SporadicParameters

public SporadicParameters(RelativeTime interarrival,
                          RelativeTime cost,
                          RelativeTime deadline,
                          AsyncEventHandler overrunHandler,
                          AsyncEventHandler missHandler)
Constructor of SporadicParameters to be used as ReleaseParameters for AsyncEventHandler if the event handler will be scheduled aperiodically with a miminum interarrival time between each two releases.

Parameters:
interarrival - The minimum interarrival time for two successive releases of an associated schedulable object. This parameter will be copied, changes to its value will have no effect on this SporadicParameters once the SporadicParameters object has been created.
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 the interarrival is null or negative or zero, if cost is negative or deadline is negative or zero.
Method Detail

setIfFeasible

public boolean setIfFeasible(RelativeTime interarrival,
                             RelativeTime cost,
                             RelativeTime deadline)
setIfFeasible performs a feasibility analysis using the new period, 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.

Parameters:
interarrival - The minimum interarrival time for two successive releases of an associated schedulable object. This parameter will be copied, changes to its value will have no effect on this SporadicParameters once the SporadicParameters object has been created.
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 the interarrival is null or negative or zero, if cost is negative or deadline is negative or zero.

getMinimumInterarrival

public RelativeTime getMinimumInterarrival()
getMinimumInterarrival returns the minimum interarrival time.

Returns:
the minimum interarrival time. Never null, always greater than zero.

setMinimumInterarrival

public void setMinimumInterarrival(RelativeTime interarrival)
setMinimumInterarrival sets the minimum interarrival time to a new value, independent on the impact this will have on the feasibility of the system.

Parameters:
interarrival - The minimum interarrival time for two successive releases of an associated schedulable object. This parameter will be copied, changes to its value will have no effect on this SporadicParameters once the SporadicParameters object has been created.
Throws:
java.lang.IllegalArgumentException - if the interarrival is null or negative or zero.

getMitViolationBehavior

public java.lang.String getMitViolationBehavior()
getMitViolationBehavior returns the current setting of the policy for dealing with minimum arrival time violations.

Returns:
the current policy for dealing with minimum arrival time violations. result is one of mitViolationExcept, mitViolationIgnore, mitViolationReplace, or mitViolationSave.

setMitViolationBehavior

public void setMitViolationBehavior(java.lang.String behavior)
setMitViolationBehavior sets the policy for dealing with minimum arrival time violations.

Parameters:
behavior - one of mitViolationExcept, mitViolationIgnore, mitViolationReplace, or mitViolationSave.
Throws:
java.lang.IllegalArgumentException - if behavior is not one of the constants arrivalTimeQueueOverflowExcept, arrivalTimeQueueOverflowIgnore, arrivalTimeQueueOverflowReplace, arrivalTimeQueueOverflowSave.

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, deadline, and interarrival time attributes are deep-copied, whereas the missHandler, overrunHandler, overflow, and mit-violation behavior attributes are only shallow-copied.

Overrides:
clone in class AperiodicParameters
Returns:
a new instance of ReleaseParameters with equal cost, deadline and interarrival time attributes and copied references of the overrunHandler, missHandler, overflow, and mit-violation 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.