Class GetFuture<T>
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.internal.AbstractListenableFuture<T, GetCompletionListener>
net.spy.memcached.internal.GetFuture<T>
- Type Parameters:
T- Type of object returned from the get
- All Implemented Interfaces:
Future<T>, ListenableFuture<T, GetCompletionListener>
public class GetFuture<T>
extends AbstractListenableFuture<T, GetCompletionListener>
implements Future<T>
Future returned for GET operations.
Not intended for general use.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Future
Future.State -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGetFuture(CountDownLatch l, long opTimeout, String key, ExecutorService service) -
Method Summary
Modifier and TypeMethodDescriptionaddListener(GetCompletionListener listener) Add a listener to the future, which will be executed once the operation completes.booleancancel(boolean ign) get()booleanbooleanisDone()removeListener(GetCompletionListener listener) Remove a previously added listener from the future.voidset(Future<T> d, OperationStatus s) voidvoidSignals that this future is complete.Methods inherited from class AbstractListenableFuture
addToListeners, executor, notifyListener, notifyListeners, notifyListeners, removeFromListenersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Future
exceptionNow, resultNow, state
-
Field Details
-
rv
-
-
Constructor Details
-
GetFuture
-
-
Method Details
-
cancel
-
get
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long duration, TimeUnit units) throws InterruptedException, TimeoutException, ExecutionException - Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionTimeoutExceptionExecutionException
-
getStatus
-
set
-
setOperation
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceFuture<T>
-
isDone
-
addListener
Description copied from interface:ListenableFutureAdd a listener to the future, which will be executed once the operation completes.- Specified by:
addListenerin interfaceListenableFuture<T, GetCompletionListener>- Parameters:
listener- the listener which will be executed.- Returns:
- the current future to allow for object-chaining.
-
removeListener
Description copied from interface:ListenableFutureRemove a previously added listener from the future.- Specified by:
removeListenerin interfaceListenableFuture<T, GetCompletionListener>- Parameters:
listener- the previously added listener.- Returns:
- the current future to allow for object-chaining.
-
signalComplete
public void signalComplete()Signals that this future is complete.
-