net.spy.memcached.internal
Class OperationFuture<T>

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by net.spy.memcached.internal.OperationFuture<T>
Type Parameters:
T - Type of object returned from this future.
All Implemented Interfaces:
Future<T>

public class OperationFuture<T>
extends SpyObject
implements Future<T>

Managed future for operations. Not intended for general use.


Field Summary
protected  OperationStatus status
           
 
Constructor Summary
OperationFuture(String k, CountDownLatch l, AtomicReference<T> oref, long opTimeout)
           
OperationFuture(String k, CountDownLatch l, long opTimeout)
           
 
Method Summary
 boolean cancel(boolean ign)
           
 T get()
           
 T get(long duration, TimeUnit units)
           
 String getKey()
           
 OperationStatus getStatus()
           
 boolean isCancelled()
           
 boolean isDone()
           
 void set(T o, OperationStatus s)
           
 void setOperation(Operation to)
           
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

status

protected OperationStatus status
Constructor Detail

OperationFuture

public OperationFuture(String k,
                       CountDownLatch l,
                       long opTimeout)

OperationFuture

public OperationFuture(String k,
                       CountDownLatch l,
                       AtomicReference<T> oref,
                       long opTimeout)
Method Detail

cancel

public boolean cancel(boolean ign)
Specified by:
cancel in interface Future<T>

get

public T get()
      throws InterruptedException,
             ExecutionException
Specified by:
get in interface Future<T>
Throws:
InterruptedException
ExecutionException

get

public T get(long duration,
             TimeUnit units)
      throws InterruptedException,
             TimeoutException,
             ExecutionException
Specified by:
get in interface Future<T>
Throws:
InterruptedException
TimeoutException
ExecutionException

getKey

public String getKey()

getStatus

public OperationStatus getStatus()

set

public void set(T o,
                OperationStatus s)

setOperation

public void setOperation(Operation to)

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface Future<T>

isDone

public boolean isDone()
Specified by:
isDone in interface Future<T>