|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.client.listenable.AbstractListenableFuture<V> com.ning.http.client.providers.netty.NettyResponseFuture<V>
V
- public final class NettyResponseFuture<V>
A Future
that can be used to track when an asynchronous HTTP request has been fully processed.
Field Summary | |
---|---|
static String |
MAX_RETRY
|
Constructor Summary | |
---|---|
NettyResponseFuture(URI uri,
Request request,
AsyncHandler<V> asyncHandler,
org.jboss.netty.handler.codec.http.HttpRequest nettyRequest,
int responseTimeoutInMs,
NettyAsyncHttpProvider asyncHttpProvider)
|
Method Summary | |
---|---|
void |
abort(Throwable t)
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future |
protected void |
attachChannel(org.jboss.netty.channel.Channel channel)
|
protected void |
attachChannel(org.jboss.netty.channel.Channel channel,
boolean reuseChannel)
|
boolean |
cancel(boolean force)
|
boolean |
cannotBeReplay()
Return true if the Future cannot be recovered. |
protected boolean |
canRetry()
|
protected org.jboss.netty.channel.Channel |
channel()
|
void |
content(V v)
Set the content that will be returned by this instance |
void |
done(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 l,
TimeUnit tu)
|
protected boolean |
getAndSetAuth(boolean inDigestAuth)
|
boolean |
getAndSetStatusReceived(boolean sr)
|
boolean |
getAndSetWriteBody(boolean writeBody)
Write the Request body |
boolean |
getAndSetWriteHeaders(boolean writeHeaders)
Write the Request headers |
protected AsyncHandler<V> |
getAsyncHandler()
|
protected org.jboss.netty.handler.codec.http.HttpResponse |
getHttpResponse()
|
protected boolean |
getKeepAlive()
|
org.jboss.netty.handler.codec.http.HttpRequest |
getNettyRequest()
|
protected Request |
getRequest()
|
protected com.ning.http.client.providers.netty.NettyResponseFuture.STATE |
getState()
|
protected URI |
getURI()
|
boolean |
hasExpired()
Is the Future still valid |
protected int |
incrementAndGetCurrentRedirectCount()
|
boolean |
isCancelled()
|
boolean |
isDone()
|
protected boolean |
isInAuth()
|
protected NettyAsyncHttpProvider |
provider()
|
protected boolean |
reuseChannel()
|
protected void |
setHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse httpResponse)
|
protected void |
setKeepAlive(boolean keepAlive)
|
protected void |
setNettyRequest(org.jboss.netty.handler.codec.http.HttpRequest nettyRequest)
|
protected void |
setReaperFuture(Future<?> reaperFuture)
|
void |
setRequest(Request request)
|
protected void |
setState(com.ning.http.client.providers.netty.NettyResponseFuture.STATE state)
|
protected void |
setURI(URI uri)
|
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 |
Field Detail |
---|
public static final String MAX_RETRY
Constructor Detail |
---|
public NettyResponseFuture(URI uri, Request request, AsyncHandler<V> asyncHandler, org.jboss.netty.handler.codec.http.HttpRequest nettyRequest, int responseTimeoutInMs, NettyAsyncHttpProvider asyncHttpProvider)
Method Detail |
---|
protected URI getURI() throws MalformedURLException
MalformedURLException
protected void setURI(URI uri)
public boolean isDone()
public boolean isCancelled()
public boolean cancel(boolean force)
public boolean hasExpired()
true
if response has expired and should be terminated.public V get() throws InterruptedException, ExecutionException
InterruptedException
ExecutionException
public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException, ExecutionException
InterruptedException
TimeoutException
ExecutionException
public final void done(Callable callable)
ListenableFuture
Callable
and if there is no exception, mark this Future as done and release the internal lock.
public final void abort(Throwable t)
ListenableFuture
Throwable
to the AsyncHandler
or Future
public void content(V v)
ListenableFuture
v
- the content that will be returned by this instanceprotected final Request getRequest()
public final org.jboss.netty.handler.codec.http.HttpRequest getNettyRequest()
protected final void setNettyRequest(org.jboss.netty.handler.codec.http.HttpRequest nettyRequest)
protected final AsyncHandler<V> getAsyncHandler()
protected final boolean getKeepAlive()
protected final void setKeepAlive(boolean keepAlive)
protected final org.jboss.netty.handler.codec.http.HttpResponse getHttpResponse()
protected final void setHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse httpResponse)
protected int incrementAndGetCurrentRedirectCount()
protected void setReaperFuture(Future<?> reaperFuture)
protected boolean isInAuth()
protected boolean getAndSetAuth(boolean inDigestAuth)
protected com.ning.http.client.providers.netty.NettyResponseFuture.STATE getState()
protected void setState(com.ning.http.client.providers.netty.NettyResponseFuture.STATE state)
public boolean getAndSetStatusReceived(boolean sr)
public void touch()
public boolean getAndSetWriteHeaders(boolean writeHeaders)
Request
headers
public boolean getAndSetWriteBody(boolean writeBody)
Request
body
protected NettyAsyncHttpProvider provider()
protected void attachChannel(org.jboss.netty.channel.Channel channel)
protected void attachChannel(org.jboss.netty.channel.Channel channel, boolean reuseChannel)
protected org.jboss.netty.channel.Channel channel()
protected boolean reuseChannel()
protected boolean canRetry()
public void setRequest(Request request)
public boolean cannotBeReplay()
Future
cannot be recovered. There is some scenario where a connection can be
closed by an unexpected IOException, and in some situation we can recover from that exception.
Future
cannot be recovered.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |