- java.lang.Object
-
- apdu4j.core.CancellationWaitingFuture<V>
-
- Type Parameters:
V
-
- All Implemented Interfaces:
Runnable
,Future<V>
,RunnableFuture<V>
public class CancellationWaitingFuture<V> extends Object implements RunnableFuture<V>
Like FutureTask, but get() waits for the callable to complete/return from interrupt.CancelledException from callable is passed as-is from get(), InterruptedException turned into CancellationException and other exceptions are wrapped in ExecutionException
-
-
Constructor Summary
Constructors Constructor Description CancellationWaitingFuture(Callable<V> callable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel(boolean mayInterruptIfRunning)
V
get()
V
get(long l, TimeUnit timeUnit)
boolean
isCancelled()
boolean
isDone()
void
run()
-
-
-
Method Detail
-
run
public void run()
- Specified by:
run
in interfaceRunnable
- Specified by:
run
in interfaceRunnableFuture<V>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<V>
-
get
public V get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public V get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
-