javax.realtime
Class AperiodicParameters

java.lang.Object
  extended byjavax.realtime.ReleaseParameters
      extended byjavax.realtime.AperiodicParameters
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SporadicParameters

public class AperiodicParameters
extends ReleaseParameters

This release parameter object characterizes a Schedulable object that may become active at any time. When a reference to a AperiodicParameters object is given as a parameter to a constructor the AperiodicParameters object becomes bound to the object being created. Changes to the values in the AperiodicParameters object affect the constructed object. If given to more than one constructor then changes to the values in the AperiodicParameters object affect all of the associated objects. Note that this is a one-to-many relationship and not a many-to-many.

Author:
Angelo Corsaro, Morgan Deters

Field Summary
static String arrivalTimeQueueOverflowExcept
          If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the fire() method shall throw a ResourceLimitError .If thearrival time is a result of a happening to which the instance of AsyncEventHandler is bound then the arrival time is ignored.
static String arrivalTimeQueueOverflowIgnore
          If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the arrival time is ignored.
static String arrivalTimeQueueOverflowReplace
          If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the previous arrival time is overwritten by the new arrival time.
static String arrivalTimeQueueOverflowSave
          If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the queue is lengthened and the arrival time is saved.
 
Fields inherited from class javax.realtime.ReleaseParameters
cost, deadline, missHandler, overrunHandler
 
Constructor Summary
AperiodicParameters()
          Construct a new AperiodicParameters object.
AperiodicParameters(RelativeTime cost, RelativeTime deadline, AsyncEventHandler overrunHandler, AsyncEventHandler missHandler)
          Creates a new AperiodicParameters instance.
 
Method Summary
 String getArrivalTimeQueueOverflowBehavior()
          Get the behavior of the arrival time queue in the event of an overflow.
 int getInitialArrivalTimeQueueLength()
          Get the initial number of elements the arrival time queue can hold.
 void setArrivalTimeQueueOverflowBehavior(String behavior)
          Set the behavior of the arrival time queue in the case where the insertion of a new element would make the queue size greater than the initial size given in this.
 void setDeadline(RelativeTime deadline)
          Set the deadline for this AperiodicParameters.
 boolean setIfFeasible(RelativeTime cost, RelativeTime deadline)
          Attempt to change the cost and deadline.
 void setInitialArrivalTimeQueueLength(int initial)
          Set the initial number of elements the arrival time queue can hold without lengthening the queue.
 
Methods inherited from class javax.realtime.ReleaseParameters
clone, getCost, getCostOverrunHandler, getDeadline, getDeadlineMissHandler, setCost, setCostOverrunHandler, setDeadlineMissHandler
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrivalTimeQueueOverflowExcept

public static final String arrivalTimeQueueOverflowExcept
If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the fire() method shall throw a ResourceLimitError .If thearrival time is a result of a happening to which the instance of AsyncEventHandler is bound then the arrival time is ignored.

See Also:
Constant Field Values

arrivalTimeQueueOverflowIgnore

public static final String arrivalTimeQueueOverflowIgnore
If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the arrival time is ignored.

See Also:
Constant Field Values

arrivalTimeQueueOverflowReplace

public static final String arrivalTimeQueueOverflowReplace
If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the previous arrival time is overwritten by the new arrival time. However, the new time is adjusted so that the difference between it and the previous time is equal to the minimum interarrival time.

See Also:
Constant Field Values

arrivalTimeQueueOverflowSave

public static final String arrivalTimeQueueOverflowSave
If an arrival time occurs and should be queued but the queue already holds a number of times equal to the initial queue length defined by this then the queue is lengthened and the arrival time is saved.

See Also:
Constant Field Values
Constructor Detail

AperiodicParameters

public AperiodicParameters()
Construct a new AperiodicParameters object.

This constructor is equivalent to this(null, null, null, null).


AperiodicParameters

public AperiodicParameters(RelativeTime cost,
                           RelativeTime deadline,
                           AsyncEventHandler overrunHandler,
                           AsyncEventHandler missHandler)
Creates a new AperiodicParameters instance.

Parameters:
cost - Processing time per period. 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. 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. 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. For a minimum implementation for purposes of feasibility analysis, the deadline is equal to the period. Other implementations may use this parameter to compute execution eligibility. If null, deadline will equal the period.
overrunHandler - This handler is invoked if an invocation of the Schedulable object exceeds cost in the given period. Not required for minimum implementation. If null, nothing happens on the overrun condition.
missHandler - This handler is invoked if the Runnable.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

setIfFeasible

public boolean setIfFeasible(RelativeTime cost,
                             RelativeTime deadline)
Attempt to change the cost and deadline. The values will be changed if the resulting system is feasible. If the resulting system would not be feasible no changes are made.

Overrides:
setIfFeasible in class ReleaseParameters
Parameters:
cost - The proposed cost. If zero, no change is made.
deadline - The proposed deadline. If zero, no change is made.
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.
Throws:
IllegalArgumentException - if cost is less than zero, or if deadline is less than or equal to zero
IllegalAssignmentError - if one or more of the arguments cannot be referred to by this; in this case, no changes are made, even for those parameters that can be stored in this

getArrivalTimeQueueOverflowBehavior

public String getArrivalTimeQueueOverflowBehavior()
Get the behavior of the arrival time queue in the event of an overflow.

Returns:
a String representing the behaviour currently set.

setArrivalTimeQueueOverflowBehavior

public void setArrivalTimeQueueOverflowBehavior(String behavior)
Set the behavior of the arrival time queue in the case where the insertion of a new element would make the queue size greater than the initial size given in this.

Parameters:
behavior - a string representing the desired behavior.

getInitialArrivalTimeQueueLength

public int getInitialArrivalTimeQueueLength()
Get the initial number of elements the arrival time queue can hold.

Returns:
the initial number of elements the arrival time queue can hold.

setInitialArrivalTimeQueueLength

public void setInitialArrivalTimeQueueLength(int initial)
Set the initial number of elements the arrival time queue can hold without lengthening the queue.

Parameters:
initial - the initial length of the queue.
Throws:
IllegalArgumentException - if initial is less than zero

setDeadline

public void setDeadline(RelativeTime deadline)
Set the deadline for this AperiodicParameters.

Overrides:
setDeadline in class ReleaseParameters
Parameters:
deadline - the deadline


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2006 Angelo Corsaro and Morgan Deters.