public class Timed extends AsynchronouslyInterruptedException
Jamaica Real-Time Specification for Java class Timed.
Timed is a subclass of AsynchronouslyInterruptedException that permit the execution of code provided in an instance of Interruptible with a given time out. After the time out is reached, the code will be interrupted by throwing this instance of AsynchronouslyInterruptedException.
No memory allocation will be performed after the creation of this Timed instance, several invocation of doInterruptible may hence be performed without additional memory allocation.
Constructor and Description |
---|
Timed(HighResolutionTime time)
Constructor to create a new instance of Timed with the given time
out.
|
Modifier and Type | Method and Description |
---|---|
boolean |
doInterruptible(Interruptible logic)
doInterruptible executes the run() method of the provided
Interruptible logic with the time-out provided to the constructor
of this Timed or set via resetTime.
|
void |
resetTime(HighResolutionTime time)
resetTime sets the time out for the next invocation of
doInterruptible to a new value.
|
clear, disable, enable, fire, getGeneric, happened, isEnabled, propagate
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public Timed(HighResolutionTime time) throws IllegalArgumentException
Constructor to create a new instance of Timed with the given time out.
IllegalArgumentException
- if time is null.time
- the timeout when the execution the Interruptible
logic should be stopped.public boolean doInterruptible(Interruptible logic)
doInterruptible
in class AsynchronouslyInterruptedException
IllegalArgumentException
- iff the provided logic parameter
is null.logic
- Contains the run() method that specifies the logic
to be executed in an interruptible way.public void resetTime(HighResolutionTime time)
time
- the new time out. It may be null to keep the time out
unchanged.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2016 aicas GmbH. All Rights Reserved.