Package net.spy.memcached.internal
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 java.util.concurrent.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.boolean
cancel
(boolean ign) get()
boolean
boolean
isDone()
removeListener
(GetCompletionListener listener) Remove a previously added listener from the future.void
set
(Future<T> d, OperationStatus s) void
void
Signals that this future is complete.Methods inherited from class net.spy.memcached.internal.AbstractListenableFuture
addToListeners, executor, notifyListener, notifyListeners, notifyListeners, removeFromListeners
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
-
rv
-
-
Constructor Details
-
GetFuture
-
-
Method Details
-
cancel
public boolean cancel(boolean ign) -
get
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long duration, TimeUnit units) throws InterruptedException, TimeoutException, ExecutionException - Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
TimeoutException
ExecutionException
-
getStatus
-
set
-
setOperation
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceFuture<T>
-
isDone
public boolean isDone() -
addListener
Description copied from interface:ListenableFuture
Add a listener to the future, which will be executed once the operation completes.- Specified by:
addListener
in 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:ListenableFuture
Remove a previously added listener from the future.- Specified by:
removeListener
in 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.
-