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.
StaticThrowable.Hidden
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, getSingleton, happened, isEnabled, propagate
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, init, init, init, init, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, writeReplace
public Timed(HighResolutionTime<?> time) throws StaticIllegalArgumentException
Constructor to create a new instance of Timed with the given time out.
StaticIllegalArgumentException
- 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
StaticIllegalArgumentException
- 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-2019 aicas GmbH. All Rights Reserved.