Package org.openhab.core.util
Class SameThreadExecutorService.ImpostorScheduledFuture<T>
java.lang.Object
org.openhab.core.util.SameThreadExecutorService.ImpostorScheduledFuture<T>
- Type Parameters:
T- the return type.
- All Implemented Interfaces:
Comparable<Delayed>,Delayed,Future<T>,ScheduledFuture<T>
- Enclosing class:
SameThreadExecutorService
protected static class SameThreadExecutorService.ImpostorScheduledFuture<T>
extends Object
implements ScheduledFuture<T>
A
ScheduledFuture that wraps a Future and always reports zero delay.- Author:
- Ravi Nadahar - Initial contribution
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionImpostorScheduledFuture(Future<T> future) Creates a new instance that wraps the specifiedFuture. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
delegate
The wrappedFuture
-
-
Constructor Details
-
Method Details
-
getDelay
-
compareTo
- Specified by:
compareToin interfaceComparable<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
public boolean isDone() -
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, @Nullable TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-