javax.realtime
Class ReleaseParameters

java.lang.Object
  extended byjavax.realtime.ReleaseParameters
Direct Known Subclasses:
AperiodicParameters, PeriodicParameters

public class ReleaseParameters
extends java.lang.Object

The top-level class for release characteristics of schedulable objects. When a reference to a ReleaseParameters object is given as a parameter to a constructor, the ReleaseParameters object becomes bound to the object being created. Changes to the values in the ReleaseParameters object affect the constructed object. If given to more than one constructor, then changes to the values in the ReleaseParameters object affect all of the associated objects. Note that this is a one-to-many relationship and not a many-to-many. Only changes to an ReleaseParameters> object caused by methods on that object cause the change to propagate to all schedulable objects using the object. For instance, invoking setDeadline on a ReleaseParameters instance will make the change, and then notify that the scheduler that the object has been changed. At that point the object is reconsidered for every SO that uses it. Invoking a method on the RelativeTime object that is the deadline for this object may change the time value but it does not pass the new time value to the scheduler at that time. Even though the changed time value is referenced by ReleaseParameters objects, it will not change the behavior of the SOs that use the parameter object until a setter method on the ReleaseParameters object is invoked, or the parameter object is used in setReleaseParameters() or a constructor for an SO.

Release parameters use HighResolutionTime values for cost, and deadline. Since the times are expressed as a HighResolutionTime values, these values use accurate timers with nanosecond granularity. The actual resolution available and even the quantity the timers measure depend on the clock associated with each time value.

The implementation must use modified copy semantics for each HighResolutionTime parameter value. The value of each time object should be treated as if it were copied at the time it is passed to the parameter object, but the object reference must also be retained. For instance, the value returned by getCost() must be the same object passed in by setCost(), but any changes made to the time value of the cost must not take effect in the associated ReleaseParameters instance unless they are passed to the parameter object again, e.g. with a new invocation of setCost.

Attribute
Default Value
cost new RelativeTime(0,0)
deadline no default
overrunHandler None
missHandler None

Caution: This class is explicitly unsafe in multithreaded situations when it is being changed. No synchronization is done. It is assumed that users of this class who are mutating instances will be doing their own synchronization at a higher level.

Caution: The cost parameter time should be considered to be measured against the target platform.

Note: Cost measurement and enforcement is an optional facility for implementations of the RTSJ.


Field Summary
protected  RelativeTime cost
          The cost of this object
protected  RelativeTime deadline
          The deadline of this object
protected  AsyncEventHandler missHandler
          The miss handler of this object
protected  AsyncEventHandler overrunHandler
          The overrun handler of this object
 
Constructor Summary
protected ReleaseParameters()
          Void constructor.
  ReleaseParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Constructor.
 
Method Summary
 RelativeTime getCost()
          Return the cost of this object.
 AsyncEventHandler getCostOverrunHandler()
          Return the cost overrun handler of this object.
 RelativeTime getDeadline()
          Return the deadline of this object.
 AsyncEventHandler getDeadlineMissHandler()
          Return the deadline miss handler of this object.
 void setCost(RelativeTime cost)
          Set the cost of this object
 void setCostOverrunHandler(AsyncEventHandler overrunHandler)
          Set the cost overrun handler of this object
 void setDeadline(RelativeTime deadline)
          Set the deadline of this object
 void setDeadlineMissHandler(AsyncEventHandler missHandler)
          Set the deadline miss handler for this object
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
          Set the cost and deadline of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cost

protected RelativeTime cost
The cost of this object


deadline

protected RelativeTime deadline
The deadline of this object


overrunHandler

protected AsyncEventHandler overrunHandler
The overrun handler of this object


missHandler

protected AsyncEventHandler missHandler
The miss handler of this object

Constructor Detail

ReleaseParameters

protected ReleaseParameters()
Void constructor.


ReleaseParameters

public ReleaseParameters(RelativeTime cost,
                         RelativeTime deadline,
                         AsyncEventHandler overrunHandler,
                         AsyncEventHandler missHandler)
Constructor.

Parameters:
cost -
deadline -
overrunHandler -
missHandler -
Method Detail

getCost

public RelativeTime getCost()
Return the cost of this object.

Returns:
the cost of this object.

getCostOverrunHandler

public AsyncEventHandler getCostOverrunHandler()
Return the cost overrun handler of this object.

Returns:
the cost overrun handler of this object.

getDeadline

public RelativeTime getDeadline()
Return the deadline of this object.

Returns:
the deadline of this object.

getDeadlineMissHandler

public AsyncEventHandler getDeadlineMissHandler()
Return the deadline miss handler of this object.

Returns:
the deadline miss handler of this object.

setCost

public void setCost(RelativeTime cost)
Set the cost of this object

Parameters:
cost - the cost to be set

setCostOverrunHandler

public void setCostOverrunHandler(AsyncEventHandler overrunHandler)
Set the cost overrun handler of this object

Parameters:
overrunHandler - the new cost overrun handler

setDeadline

public void setDeadline(RelativeTime deadline)
Set the deadline of this object

Parameters:
deadline - the new deadline

setDeadlineMissHandler

public void setDeadlineMissHandler(AsyncEventHandler missHandler)
Set the deadline miss handler for this object

Parameters:
missHandler - the new deadline miss handler

setIfFeasible

public boolean setIfFeasible(RelativeTime cost,
                             RelativeTime deadline)
Set the cost and deadline of this object

Parameters:
cost -
deadline -
Returns:
true if the resulting system is feasible

Not currently implemented