aicas logoJamaica 3.2 release 62

javax.realtime
Class ReleaseParameters

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

public abstract class ReleaseParameters
extends Object
implements Cloneable

Jamaica Realtime 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 schudable object until the correspondig 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 simulataneously 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 ReleaseParamters.
 
Method Summary
 Object clone()
          clone create 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 overrund handler For JamaicaVM, cost overrun checking is enabled if CpuTime.CPU_TIME_SUPPORTED is true.
 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 the new cost and deadline parameters.
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          setIfFeasible performs a feasibility analysis using the 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 ReleaseParamters.

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 cost monitoring is an optional feature of the RTSJ and it is currently not supported by JamaicaVM.

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 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:
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 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 cost monitoring is an optional feature of the RTSJ and it is currently not supported by JamaicaVM.

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

Note that cost monitoring is an optional feature of the RTSJ and it is currently not supported by JamaicaVM.

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

Note that cost monitoring is an optional feature of the RTSJ and it is currently not supported by JamaicaVM.

Throws:
IllegalArgumentException - if cost is negative

setCostOverrunHandler

public void setCostOverrunHandler(AsyncEventHandler overrunHandler)
setCostOverrunHandler sets the cost overrund 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 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:
IllegalArgumentException - if deadline is negative or zero.

setDeadlineMissHandler

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

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

clone

public Object clone()
clone create a clone of this object with the same parameters but without association to any schedulable object

Overrides:
clone in class Object
Returns:
an new instance of ReleaseParameters with equal start, period, cost, deadline, overrunHandler and missHandler arguments.
Since:
RTSJ V1.0.1

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.