public class LatchedFuture<V> extends Object implements Future<V>
| Modifier and Type | Field and Description |
|---|---|
private CountDownLatch |
latch
.
|
private FutureListener<V> |
listener
The optional listener.
|
private Lock |
lock
.
|
private V |
value
.
|
| Constructor and Description |
|---|
LatchedFuture() |
LatchedFuture(V value) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(FutureListener<V> listener) |
boolean |
cancel(boolean b) |
V |
get() |
V |
get(long l,
TimeUnit timeUnit) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
set(V value) |
private final CountDownLatch latch
private FutureListener<V> listener
public LatchedFuture()
public LatchedFuture(V value)
public boolean isCancelled()
isCancelled in interface Future<V>public V get() throws InterruptedException, ExecutionException
get in interface Future<V>InterruptedExceptionExecutionExceptionpublic V get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<V>InterruptedExceptionExecutionExceptionTimeoutExceptionpublic void addListener(FutureListener<V> listener)
Copyright © 2013 eXo Platform SAS. All Rights Reserved.