T
- Type of object returned from the getpublic class GetFuture<T> extends AbstractListenableFuture<T,GetCompletionListener> implements java.util.concurrent.Future<T>
Constructor and Description |
---|
GetFuture(java.util.concurrent.CountDownLatch l,
long opTimeout,
java.lang.String key,
java.util.concurrent.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,
java.util.concurrent.TimeUnit units) |
OperationStatus |
getStatus() |
boolean |
isCancelled() |
boolean |
isDone() |
GetFuture<T> |
removeListener(GetCompletionListener listener)
Remove a previously added listener from the future.
|
void |
set(java.util.concurrent.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(java.util.concurrent.CountDownLatch l, long opTimeout, java.lang.String key, java.util.concurrent.ExecutorService service)
public boolean cancel(boolean ign)
cancel
in interface java.util.concurrent.Future<T>
public T get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public T get(long duration, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<T>
java.lang.InterruptedException
java.util.concurrent.TimeoutException
java.util.concurrent.ExecutionException
public OperationStatus getStatus()
public void set(java.util.concurrent.Future<T> d, OperationStatus s)
public void setOperation(Operation to)
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.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 © 2006-2009 Dustin Sallings, 2009-2013 Couchbase, Inc.