aicas logoJamaica 6.4 release 1

javax.realtime
Class ProcessingGroupParameters

java.lang.Object
  extended by javax.realtime.ProcessingGroupParameters
All Implemented Interfaces:
Cloneable

public class ProcessingGroupParameters
extends Object
implements Cloneable

Jamaica Real-Time Specification for Java class ProcessingGroupParameters

In a system that supports cost monitoring, the CPU time of a group of schedulable objects that are members of a processing group is limited to the amount specified by the cost parameter per period.

In a system that does not support cost monitoring, the information from the processing group parameters may be used by the feasibility analysis. This is particularly important if schedulable objects with aperiodic release parameters are involved since they would otherwise make feasibility analysis impossible.

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.


Nested Class Summary
static interface ProcessingGroupParameters.Visitor
          An interface for visiting threads and schedulable objects.
 
Constructor Summary
ProcessingGroupParameters(HighResolutionTime start, RelativeTime period, RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Constructor to create a new instance of ProcessingGroupParameters.
 
Method Summary
 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 for 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.
 RelativeTime getPeriod()
          getPeriod returns the current period.
 HighResolutionTime getStart()
          getStart returns the current start time
 void setCost(RelativeTime cost)
          setCost sets the cost value.
 void setCostOverrunHandler(AsyncEventHandler handler)
          setCostOverrunHandler set the cost overrun handler.
 void setDeadline(RelativeTime deadline)
          setDeadline set the deadline to a new value.
 void setDeadlineMissHandler(AsyncEventHandler handler)
          setDeadlineMissHandler sets the deadline miss handler.
 boolean setIfFeasible(RelativeTime period, RelativeTime cost, RelativeTime deadline)
          setIfFeasible performs a feasibility analysis using the new period, cost, and deadline parameters.
 void setPeriod(RelativeTime period)
          setPeriod sets the period to a new value.
 void setStart(HighResolutionTime start)
          setStart sets the start time to a new value.
 
Methods inherited from class java.lang.Object
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)
Constructor to create a new instance of ProcessingGroupParameters.

Parameters:
start - The start time of the first period described by this object. A start time of class RelativeTime will be relative to the time this constructor is called. A start time of class AbsoluteTime will result in a start at that time or immediately after the execution of this constructor, whichever comes later. If null, the default value will be new RelativeTime(0, 0).
period - The time for which the cost budget is allocated. This argument must not be null or a time <=0.
cost - The CPU time budget for each period. This must not be null.
deadline - The deadline for the completion of all members of this group, relative to the release time of each period. If null, the default value is a new instance of RelativeTime(period).
overrunHandler - This handler will be invoked if the cost of of all schedulable objects in this group exceeds the cost parameter. If null, there will be no overrunHandler.
missHandler - This handler will be invoked if a schedulable object in this group still executes after the deadline has passed. If null, there will be no deadline miss handler.
Throws:
IllegalArgumentException - if start is a negative RelativeTime, if the period is null or negative or zero, if cost is null or negative or deadline is negative or zero.
Method Detail

setIfFeasible

public boolean setIfFeasible(RelativeTime period,
                             RelativeTime cost,
                             RelativeTime deadline)
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:
period - The new time for which the cost budget is allocated. This argument must not be null or a time <=0.
cost - The new CPU time budget for each period. This must not be null.
deadline - The new deadline for the completion of all members of this group, relative to the release time of each period. If null, the default value is a new instance of RealtiveTime(period).
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 the period is null or negative or zero, if cost is null or negative or deadline is negative or zero.

getCost

public RelativeTime getCost()
getCost returns the current value for 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.

getPeriod

public RelativeTime getPeriod()
getPeriod returns the current period.

Returns:
the current period.

getStart

public HighResolutionTime getStart()
getStart returns the current start time

Returns:
the current start time.

setCost

public void setCost(RelativeTime cost)
setCost sets the cost value.

Parameters:
cost - The new CPU time budget for each period. This must not be null.
Throws:
IllegalArgumentException - if cost is null or negative.

setCostOverrunHandler

public void setCostOverrunHandler(AsyncEventHandler handler)
setCostOverrunHandler set the cost overrun handler.

Parameters:
handler - This handler will be invoked if the cost of of all schedulable objects in this group exceeds the cost parameter. If null, there will be no overrunHandler.

setDeadline

public void setDeadline(RelativeTime deadline)
setDeadline set the deadline to a new value.

Parameters:
deadline - The new deadline for the completion of all members of this group, relative to the release time of each period. If null, the default value is a new instance of RealtiveTime(period).
Throws:
IllegalArgumentException - if deadline is negative or zero.

setDeadlineMissHandler

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

Parameters:
handler - This handler will be invoked if a schedulable object in this group still executes after the deadline has passed. If null, there will be no deadline miss handler.

setPeriod

public void setPeriod(RelativeTime period)
setPeriod sets the period to a new value.

Parameters:
period - The new time for which the cost budget is allocated. This argument must not be null or a time <=0.
Throws:
IllegalArgumentException - if period is null or negative or zero.

setStart

public void setStart(HighResolutionTime start)
setStart sets the start time to a new value.

Parameters:
start - The new start time of the first period described by this object. A start time of class RelativeTime will be relative to the time this constructor is called. A start time of class AbsoluteTime will result in a start at that time or immediately after the execution of this constructor, whichever comes earlier. If null, the default value will be new RelativeTime(0, 0).
Throws:
IllegalArgumentException - if start is a negative RelativeTime.

clone

public 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, event handlers are only shallow-copied.

Overrides:
clone in class Object
Returns:
a new instance of ProcessingGroupParameters.
Since:
RTSJ V1.0.1

aicas logoJamaica 6.4 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2015 aicas GmbH. All Rights Reserved.