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
public Timed(HighResolutionTime time) throws java.lang.IllegalArgumentException
Constructor to create a new instance of Timed with the given time out.
time
- the timeout when the execution the Interruptible
logic should be stopped.java.lang.IllegalArgumentException
- if time is null.public boolean doInterruptible(Interruptible logic)
doInterruptible
in class AsynchronouslyInterruptedException
logic
- Contains the run() method that specifies the logic
to be executed in an interruptible way.java.lang.IllegalArgumentException
- iff the provided logic parameter
is null.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-2017 aicas GmbH. All Rights Reserved.