T
- Type of object returned from the getpublic class GetFuture<T> extends AbstractListenableFuture<T,GetCompletionListener> implements Future<T>
Constructor and Description |
---|
GetFuture(CountDownLatch l,
long opTimeout,
String key,
ExecutorService service) |
Modifier and Type | Method and Description |
---|---|
GetFuture<T> |
addListener(GetCompletionListener listener)
Add a listener to the future, which will be executed once the operation
completes.
|
boolean |
cancel(boolean ign) |
T |
get() |
T |
get(long duration,
TimeUnit units) |
OperationStatus |
getStatus() |
boolean |
isCancelled() |
boolean |
isDone() |
GetFuture<T> |
removeListener(GetCompletionListener listener)
Remove a previously added listener from the future.
|
void |
set(Future<T> d,
OperationStatus s) |
void |
setOperation(Operation to) |
void |
signalComplete()
Signals that this future is complete.
|
addToListeners, executor, notifyListener, notifyListeners, notifyListeners, removeFromListeners
public GetFuture(CountDownLatch l, long opTimeout, String key, ExecutorService service)
public T get() throws InterruptedException, ExecutionException
get
in interface Future<T>
InterruptedException
ExecutionException
public T get(long duration, TimeUnit units) throws InterruptedException, TimeoutException, ExecutionException
get
in interface Future<T>
InterruptedException
TimeoutException
ExecutionException
public OperationStatus getStatus()
public void set(Future<T> d, OperationStatus s)
public void setOperation(Operation to)
public boolean isCancelled()
isCancelled
in interface Future<T>
public GetFuture<T> addListener(GetCompletionListener listener)
ListenableFuture
addListener
in interface ListenableFuture<T,GetCompletionListener>
listener
- the listener which will be executed.public GetFuture<T> removeListener(GetCompletionListener listener)
ListenableFuture
removeListener
in interface ListenableFuture<T,GetCompletionListener>
listener
- the previously added listener.public void signalComplete()
Copyright © 2015. All rights reserved.