javax.realtime
Class ReleaseParameters

java.lang.Object
  |
  +--javax.realtime.ReleaseParameters
Direct Known Subclasses:
AperiodicParameters, PeriodicParameters

public class ReleaseParameters
extends java.lang.Object

The abstract top-level class for release characteristics of threads. When a reference to a ReleaseParameters 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.

Caution: This class is explicitly unsafe in multihtreaded situations when it is being changed. No synchronizations 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.


Field Summary
(package private)  javax.realtime.RelativeTime cost
           
(package private)  javax.realtime.RelativeTime deadline
           
(package private)  javax.realtime.AsyncEventHandler missHandler
           
(package private)  javax.realtime.AsyncEventHandler overrunHandler
           
(package private)  java.util.LinkedList schList
           
 
Constructor Summary
protected ReleaseParameters()
          Create a new instance of ReleaseParameters.
protected ReleaseParameters(javax.realtime.RelativeTime cost, javax.realtime.RelativeTime deadline, javax.realtime.AsyncEventHandler overrunHandler, javax.realtime.AsyncEventHandler missHandler)
          Create a new instance of ReleaseParameters with the given parameter values.
protected ReleaseParameters(javax.realtime.ReleaseParameters release)
          Makes a copy of the argument.
 
Method Summary
 boolean bindSchedulable(javax.realtime.Schedulable sch)
           
 javax.realtime.RelativeTime getCost()
          Gets the value of the cost field.
 javax.realtime.AsyncEventHandler getCostOverrunHandler()
          Gets a reference to the cost overrun handler.
 javax.realtime.RelativeTime getDeadline()
          Gets the value of the deadline field.
 javax.realtime.AsyncEventHandler getDeadlineMissHandler()
          Gets a reference to the deadline miss handler.
 void setCost(javax.realtime.RelativeTime cost)
          Sets the cost value.
 void setCostOverrunHandler(javax.realtime.AsyncEventHandler handler)
          Sets the cost overrun handler.
 void setDeadline(javax.realtime.RelativeTime deadline)
          Sets the deadline value.
 void setDeadlineMissHandler(javax.realtime.AsyncEventHandler handler)
          Sets the deadline miss handler.
 boolean setIfFeasible(javax.realtime.RelativeTime cost, javax.realtime.RelativeTime deadline)
          This method appears in many classes in the RTSJ and with various parameters.
 boolean unbindSchedulable(javax.realtime.Schedulable sch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cost

javax.realtime.RelativeTime cost

deadline

javax.realtime.RelativeTime deadline

overrunHandler

javax.realtime.AsyncEventHandler overrunHandler

missHandler

javax.realtime.AsyncEventHandler missHandler

schList

java.util.LinkedList schList
Constructor Detail

ReleaseParameters

protected ReleaseParameters()
Create a new instance of ReleaseParameters.


ReleaseParameters

protected ReleaseParameters(javax.realtime.ReleaseParameters release)
Makes a copy of the argument.


ReleaseParameters

protected ReleaseParameters(javax.realtime.RelativeTime cost,
                            javax.realtime.RelativeTime deadline,
                            javax.realtime.AsyncEventHandler overrunHandler,
                            javax.realtime.AsyncEventHandler missHandler)
Create a new instance of ReleaseParameters with the given parameter values.

Parameters:
cost - Processing time units per interval. On implementations which can measure the amount of time a schedulable object is executed, this value is the maximum amount of time a schedulable object receives per interval. On implementations which cannot measure execution time, this value is used as a hint to the feasibility algorithm. On such systems it is not possible to determine when any particular object exceeds cost. Equivalent to RelativeTime(0, 0) if null.
deadline - The latest permissible completion time measured from the release time of the associated invocation of the schedulable object. Changing the deadline might not take effect after the expiration of the current deadline. More detail provided in the subclasses.
overrunHandler - This handler is invoked if an invocation of the schedulable object exceeds cost. Not required for minimum implementation. If null, nothing happens on the overrun condition, and waitForNextPeriod() returns false immediately and updates the start time for the next period.
missHandler - This handler is invoked if the run() method of the schedulable object is still executing after the deadline has passed. Although minimum implementations do not consider deadlines in feasibility calculations, they must recognize variable deadlines and invoke the miss handler as appropriate. If null, nothing happens on the miss deadline condition.
Method Detail

getCost

public javax.realtime.RelativeTime getCost()
Gets the value of the cost field.

Returns:
The value of cost.

getCostOverrunHandler

public javax.realtime.AsyncEventHandler getCostOverrunHandler()
Gets a reference to the cost overrun handler.

Returns:
A reference to the associated cost overrun handler.

getDeadline

public javax.realtime.RelativeTime getDeadline()
Gets the value of the deadline field.

Returns:
The value of the deadline.

getDeadlineMissHandler

public javax.realtime.AsyncEventHandler getDeadlineMissHandler()
Gets a reference to the deadline miss handler.

Returns:
A reference to the deadline miss handler.

setCost

public void setCost(javax.realtime.RelativeTime cost)
Sets the cost value.

Parameters:
cost - Processing time units per period or per minimum interarrival interval. On implementations which can measure the amount of time a schedulable object is executed, this value is the maximum amount of time a schedulable object receives per period or per minimum interarrival interval. On implementations which cannot measure execution time, this value is used as a hint to the feasibility algorithm. On such systems it is not possible to determine when any particular object exceeds or will exceed cost time units in a period or interval. Equivalent to RelativeTime(0, 0) if null.

setCostOverrunHandler

public void setCostOverrunHandler(javax.realtime.AsyncEventHandler handler)
Sets the cost overrun handler.

Parameters:
handler - This handler is invoked if an invocation of the schedulable object attempts to exceed cost time units in a period. Not required for minimum implementation. See comments in setCost().

setDeadline

public void setDeadline(javax.realtime.RelativeTime deadline)
Sets the deadline value.

Parameters:
deadline - The latest permissible completion time measured from the release time of the associated invocation of the schedulable object. For a minimum implementation for purposes of feasibility analysis, the deadline is equal to the period or minimum interarrival interval. Other implementations may use this parameter to compute execution eligibility.

setDeadlineMissHandler

public void setDeadlineMissHandler(javax.realtime.AsyncEventHandler handler)
Sets the deadline miss handler.

Parameters:
handler - This handler is invoked if the run() method of the schedulable object is still executing after the deadline has passed. Although minimum implementations do not consider deadlines in feasibility calculations, they must recognize variable deadlines and invoke the miss handler as appropriate.

setIfFeasible

public boolean setIfFeasible(javax.realtime.RelativeTime cost,
                             javax.realtime.RelativeTime deadline)
This method appears in many classes in the RTSJ and with various parameters. The parameters are either new scheduling characteristics for an instance Schedulable or an instance of Schedulable. The method first performs a feasibility analysis using the new scheduling characteristics as replacements for the matching scheduling characteristics of either this or the given instance of Schedulable. If the resulting system is feasible the method replaces the current scheduling characteristics, of either this or the given instance of Schedulable as appropriate, with the new scheduling characteristics.

Parameters:
cost - The poposed cost.
deadline - The proposed deadline.
Returns:
True, if the resulting system is feasible and the changes are made. False, if the resulting system is not feasible and no changes are made.

bindSchedulable

public boolean bindSchedulable(javax.realtime.Schedulable sch)

unbindSchedulable

public boolean unbindSchedulable(javax.realtime.Schedulable sch)