Class CancellableFuture<V>
java.lang.Object
com.hierynomus.protocol.commons.concurrent.AFuture<V>
com.hierynomus.protocol.commons.concurrent.CancellableFuture<V>
- All Implemented Interfaces:
Future<V>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.hierynomus.protocol.commons.concurrent.AFuture
AFuture.Function<A,
B> Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CancellableFuture.CancelCallback
private final AtomicBoolean
private final ReentrantReadWriteLock
-
Constructor Summary
ConstructorsConstructorDescriptionCancellableFuture
(AFuture<V> wrappedFuture, CancellableFuture.CancelCallback cc) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
wrappedFuture
-
callback
-
cancelled
-
lock
-
-
Constructor Details
-
CancellableFuture
-
-
Method Details
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) -
isCancelled
public boolean isCancelled() -
isDone
public boolean isDone() -
get
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
-