|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ning.http.client.listenable.AbstractListenableFuture<V>
com.ning.http.client.providers.apache.ApacheResponseFuture<V>
public class ApacheResponseFuture<V>
| Constructor Summary | |
|---|---|
ApacheResponseFuture(AsyncHandler<V> asyncHandler,
int responseTimeoutInMs,
Request request,
org.apache.commons.httpclient.HttpMethodBase method)
|
|
| Method Summary | |
|---|---|
void |
abort(java.lang.Throwable t)
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future |
boolean |
cancel(boolean mayInterruptIfRunning)
|
void |
content(V v)
TODO. |
void |
done(java.util.concurrent.Callable callable)
Execute a Callable and if there is no exception, mark this Future as done and release the internal lock. |
V |
get()
|
V |
get(long timeout,
java.util.concurrent.TimeUnit unit)
|
boolean |
getAndSetWriteBody(boolean writeBody)
Write the Request body |
boolean |
getAndSetWriteHeaders(boolean writeHeaders)
Write the Request headers |
Request |
getRequest()
|
boolean |
hasExpired()
Is the Future still valid |
boolean |
isCancelled()
|
boolean |
isDone()
|
protected void |
setInnerFuture(java.util.concurrent.Future<V> innerFuture)
|
protected void |
setReaperFuture(java.util.concurrent.Future<?> reaperFuture)
|
java.lang.String |
toString()
|
void |
touch()
Touch the current instance to prevent external service to times out. |
| Methods inherited from class com.ning.http.client.listenable.AbstractListenableFuture |
|---|
addListener, done |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ApacheResponseFuture(AsyncHandler<V> asyncHandler,
int responseTimeoutInMs,
Request request,
org.apache.commons.httpclient.HttpMethodBase method)
| Method Detail |
|---|
protected void setInnerFuture(java.util.concurrent.Future<V> innerFuture)
public void done(java.util.concurrent.Callable callable)
ListenableFutureCallable and if there is no exception, mark this Future as done and release the internal lock.
public void content(V v)
v - The new contentprotected void setReaperFuture(java.util.concurrent.Future<?> reaperFuture)
public java.lang.String toString()
toString in class java.lang.Objectpublic void abort(java.lang.Throwable t)
ListenableFutureThrowable to the AsyncHandler or Future
public boolean cancel(boolean mayInterruptIfRunning)
public boolean isCancelled()
public boolean isDone()
public V get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public V get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutExceptionpublic boolean hasExpired()
true if response has expired and should be terminated.public void touch()
ListenableFuture
public Request getRequest()
public boolean getAndSetWriteHeaders(boolean writeHeaders)
Request headers
public boolean getAndSetWriteBody(boolean writeBody)
Request body
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||