javax.realtime
Class ProcessingGroupParameters

java.lang.Object
  |
  +--javax.realtime.ProcessingGroupParameters

public class ProcessingGroupParameters
extends java.lang.Object

This is associated with one or more schedulable objects for which the system guarantees that the associated objects will not be given more time per period than indicated by cost. For all threads with a reference to an instance of ProcessingGroupParameters p and a reference to an instance of AperiodicParameters no more than p.cost will be allocated to the execution of these threads in each interval of time given by p.period after the time indicated by p.start. When a reference to a ProcessingGroupParameters object is given as a parameter to a constructor the ProcessingGroupParameters object becomes bound to the object being created. Changes to the values in the ProcessingGroupParameters object affect the constructed object. If given to more than one constructor, then changes to the values in the ProcessingGroupParameters 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 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.


Constructor Summary
ProcessingGroupParameters(HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Create a ProcessingGroupParameters object.
 
Method Summary
 RelativeTime getCost()
          Get the cost value.
 AsyncEventHandler getCostOverrunHandler()
          Get the cost overrun handler.
 RelativeTime getDeadline()
          Get the deadline value.
 AsyncEventHandler getDeadlineMissHandler()
          Get the deadline missed handler.
 RelativeTime getPeriod()
          Get the period.
 HighResolutionTime getStart()
          Get the start time.
 void setCost(RelativeTime cost)
          Set the cost value.
 void setCostOverrunHandler(AsyncEventHandler handler)
          Set the cost overrun handler.
 void setDeadline(RelativeTime deadline)
          Set the deadline value.
 void setDeadlineMissHandler(AsyncEventHandler handler)
          Set the deadline miss handler.
 boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline)
          Returns true if, after considering the values of the parameters, the task set would still be feasible.
 void setPeriod(RelativeTime period)
          Set the period.
 void setStart(HighResolutionTime start)
          Set the start time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessingGroupParameters

public ProcessingGroupParameters(HighResolutionTime start,
                                 RelativeTime period,
                                 RelativeTime cost,
                                 RelativeTime deadline,
                                 AsyncEventHandler overrunHandler,
                                 AsyncEventHandler missHandler)
Create a ProcessingGroupParameters object.
Parameters:
start - Time at which the first period begins.
period - The period is the interval between successive unblocks of waitForNextPeriod().
cost - Processing time per period.
deadline - The latest permissible completion time measured from the start of the current period. Changing the deadline might not take effect after the expiration of the current deadline.
overrunHandler - This handler is invoked if the run() method of the schedulable object of the previous period is still executing at the start of the current period.
missHandler - This handler is invoked if the run() method of the schedulable object is still executing after the deadline has passed.
Method Detail

setIfFeasible

public boolean setIfFeasible(RelativeTime period,
                             RelativeTime cost,
                             RelativeTime deadline)
Returns true if, after considering the values of the parameters, the task set would still be feasible. In this case the values of the parameters are changed. Returns false if, after considering the values of the parameters, the task set would not be feasible. In this case the values of the parameters are not changed.

getCost

public RelativeTime getCost()
Get the cost value.

getCostOverrunHandler

public AsyncEventHandler getCostOverrunHandler()
Get the cost overrun handler.
Returns:
An AsyncEventHandler object that is cost overrun handler of this.

getDeadline

public RelativeTime getDeadline()
Get the deadline value.
Returns:
A RelativeTime object that represents the deadline of this.

getDeadlineMissHandler

public AsyncEventHandler getDeadlineMissHandler()
Get the deadline missed handler.
Returns:
An AsyncEventHandler object that is deadline miss handler of this.

getPeriod

public RelativeTime getPeriod()
Get the period.
Returns:
A RelativeTime object that represents the period of time of this.

getStart

public HighResolutionTime getStart()
Get the start time.
Returns:
A HighResolutionTime object that represents the start time of this.

setCost

public void setCost(RelativeTime cost)
Set the cost value.
Parameters:
cost - The schedulable objects with a reference to this receive cumulatively no more than cost time per period on implementations that can collect execution time per thread.

setCostOverrunHandler

public void setCostOverrunHandler(AsyncEventHandler handler)
Set the cost overrun handler.
Parameters:
handler - This handler is invoked if the run() method of the schedulable object of the previous period is still executing at the start of the current period.

setDeadline

public void setDeadline(RelativeTime deadline)
Set the deadline value.
Parameters:
deadline - The latest permissible completion time measured from the start of the current period. Not used in a minimum implementation. Other implementations may use this parameter to compute execution eligibility. The default value is the same as period.

setDeadlineMissHandler

public void setDeadlineMissHandler(AsyncEventHandler handler)
Set 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.

setPeriod

public void setPeriod(RelativeTime period)
Set the period.
Parameters:
period - Interval used to enforce allocation of processing resources to the associated schedulable objects. Also used in the feasibility analysis and admission control algorithms.

setStart

public void setStart(HighResolutionTime start)
Set the start time.
Parameters:
start - Time at which the first period begins.