class QueueBufferFuture<Req extends AmazonWebServiceRequest,Res>
extends java.lang.Object
implements java.util.concurrent.Future<Res>
Modifier and Type | Field and Description |
---|---|
private QueueBufferCallback<Req,Res> |
callback
callback we should call after the future is done.
|
private boolean |
done |
private java.lang.Exception |
e |
private QueueBuffer |
issuingBuffer
every future should hold a reference to the buffer that issued it.
|
private Res |
result |
Constructor and Description |
---|
QueueBufferFuture() |
QueueBufferFuture(QueueBufferCallback<Req,Res> cb) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean arg0) |
Res |
get() |
Res |
get(long timeout,
java.util.concurrent.TimeUnit tu) |
boolean |
isCancelled() |
boolean |
isDone() |
void |
setBuffer(QueueBuffer paramBuffer) |
void |
setFailure(java.lang.Exception paramE)
Report that the task this future represents has failed.
|
void |
setSuccess(Res paramResult)
Report that the task this future represents has succeeded.
|
private Res result
private java.lang.Exception e
private boolean done
private final QueueBufferCallback<Req extends AmazonWebServiceRequest,Res> callback
private QueueBuffer issuingBuffer
public QueueBufferFuture()
public QueueBufferFuture(QueueBufferCallback<Req,Res> cb)
public void setSuccess(Res paramResult)
public void setFailure(java.lang.Exception paramE)
public boolean cancel(boolean arg0)
cancel
in interface java.util.concurrent.Future<Res>
public void setBuffer(QueueBuffer paramBuffer)
public Res get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
get
in interface java.util.concurrent.Future<Res>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public Res get(long timeout, java.util.concurrent.TimeUnit tu) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
get
in interface java.util.concurrent.Future<Res>
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<Res>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<Res>