|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.InterruptedException
javax.realtime.AsynchronouslyInterruptedException
javax.realtime.Timed
public class Timed
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 Summary | |
---|---|
Timed(HighResolutionTime time)
Constructor to create a new instance of Timed with the given time out. |
Method Summary | |
---|---|
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. |
Methods inherited from class javax.realtime.AsynchronouslyInterruptedException |
---|
clear, disable, enable, fire, getGeneric, happened, isEnabled, propagate |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Timed(HighResolutionTime time) throws 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.
IllegalArgumentException
- if time is null.Method Detail |
---|
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.
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.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |