aicas logoJamaica 6.1 release 1

javax.realtime
Class ReleaseParameters

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

public abstract class ReleaseParameters
extends java.lang.Object
implements java.lang.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.


Constructor Summary
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.
 
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 getCost()
          getCost returns 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.
 void setCost(RelativeTime cost)
          setCost sets the cost for this ReleaseParameters.
 void setCostOverrunHandler(AsyncEventHandler overrunHandler)
          setCostOverrunHandler sets the cost overrun handler.
 void setDeadline(RelativeTime deadline)
          setDeadline sets the deadline.
 void 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.
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          setIfFeasible performs a feasibility analysis using the new period, cost and deadline parameters.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReleaseParameters

protected ReleaseParameters()
Constructor to construct release parameters with default values parameters. Equivalent to ReleaseParemeters(null,null,null,null);


ReleaseParameters

protected ReleaseParameters(RelativeTime cost,
                            RelativeTime deadline,
                            AsyncEventHandler overrunHandler,
                            AsyncEventHandler missHandler)
Constructor to create a new instance of 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 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.
Throws:
java.lang.IllegalArgumentException - if cost is negative or deadline is negative or zero.
Method Detail

setIfFeasible

public boolean setIfFeasible(RelativeTime cost,
                             RelativeTime deadline,
                             AsyncEventHandler overrunHandler,
                             AsyncEventHandler missHandler)
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:
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.

Note that this method is currently no part of the RTSJ(1.0.2).

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.
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.

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.

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.

getCost

public RelativeTime getCost()
getCost returns the current value of cost

Returns:
the current cost

getCostOverrunHandler

public AsyncEventHandler getCostOverrunHandler()
getCostOverrunHandler returns the current cost overrun handler.

Returns:
the current cost overrun handler.

getDeadline

public RelativeTime getDeadline()
getDeadline returns the current deadline.

Returns:
the current deadline.

getDeadlineMissHandler

public AsyncEventHandler getDeadlineMissHandler()
getDeadlineMissHandler the current deadline miss handler.

Returns:
the current deadline miss handler.

setCost

public void setCost(RelativeTime cost)
setCost sets the cost for this 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.

Throws:
java.lang.IllegalArgumentException - if cost is negative

setCostOverrunHandler

public void setCostOverrunHandler(AsyncEventHandler overrunHandler)
setCostOverrunHandler sets the cost overrun handler. 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.

Parameters:
overrunHandler - handler to be invoked in case of an overrun situation, i.e., if the handler does not finish execution before the next invocation.

setDeadline

public void setDeadline(RelativeTime deadline)
setDeadline sets the deadline.

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

setDeadlineMissHandler

public void setDeadlineMissHandler(AsyncEventHandler handler)
setDeadlineMissHandler sets the deadline miss handler

Parameters:
handler - handler to be invoked in case the deadline is missed, i.e., the execution took longer than the specified deadline.

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 and overrunHandler attributes are only shallow-copied.

Overrides:
clone in class java.lang.Object
Returns:
a new instance of ReleaseParameters with equal cost and deadline attributes and copied references of the overrunHandler and missHandler 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.