V - public final class NettyResponseFuture<V> extends AbstractListenableFuture<V>
Future that can be used to track when an asynchronous HTTP request has been fully processed.| Constructor and Description |
|---|
NettyResponseFuture(UriComponents uri,
Request request,
AsyncHandler<V> asyncHandler,
org.jboss.netty.handler.codec.http.HttpRequest nettyRequest,
int maxRetry,
ConnectionPoolKeyStrategy connectionPoolKeyStrategy,
ProxyServer proxyServer) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Throwable t)
|
protected void |
attachChannel(org.jboss.netty.channel.Channel channel) |
protected void |
attachChannel(org.jboss.netty.channel.Channel channel,
boolean reuseChannel) |
boolean |
canBeReplay()
Return true if the
Future cannot be recovered. |
boolean |
cancel(boolean force) |
void |
cancelTimeouts() |
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()
Terminate 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() |
SocketAddress |
getChannelRemoteAddress() |
ConnectionPoolKeyStrategy |
getConnectionPoolKeyStrategy() |
protected org.jboss.netty.handler.codec.http.HttpResponse |
getHttpResponse() |
long |
getLastTouch() |
org.jboss.netty.handler.codec.http.HttpRequest |
getNettyRequest() |
ProxyServer |
getProxyServer() |
protected Request |
getRequest() |
long |
getStart() |
protected com.ning.http.client.providers.netty.NettyResponseFuture.STATE |
getState() |
protected UriComponents |
getURI() |
protected int |
incrementAndGetCurrentRedirectCount() |
boolean |
isCancelled() |
boolean |
isConnectAllowed() |
boolean |
isDone() |
protected boolean |
isInAuth() |
protected boolean |
isKeepAlive() |
protected boolean |
reuseChannel() |
void |
setConnectAllowed(boolean allowConnect) |
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) |
void |
setRequest(Request request) |
void |
setReuseChannel(boolean reuseChannel) |
protected void |
setState(com.ning.http.client.providers.netty.NettyResponseFuture.STATE state) |
void |
setTimeoutsHolder(TimeoutsHolder timeoutsHolder) |
protected void |
setURI(UriComponents uri) |
String |
toString() |
void |
touch()
Touch the current instance to prevent external service to times out.
|
addListener, runListenerspublic NettyResponseFuture(UriComponents uri, Request request, AsyncHandler<V> asyncHandler, org.jboss.netty.handler.codec.http.HttpRequest nettyRequest, int maxRetry, ConnectionPoolKeyStrategy connectionPoolKeyStrategy, ProxyServer proxyServer)
public boolean isDone()
public boolean isCancelled()
public boolean cancel(boolean force)
public V get() throws InterruptedException, ExecutionException
public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException, ExecutionException
public final void done()
ListenableFuturepublic final void abort(Throwable t)
ListenableFuturepublic void content(V v)
ListenableFuturev - the content that will be returned by this instancepublic void touch()
public long getLastTouch()
public boolean getAndSetWriteHeaders(boolean writeHeaders)
Request headerspublic boolean getAndSetWriteBody(boolean writeBody)
Request bodyprotected UriComponents getURI()
protected void setURI(UriComponents uri)
public ConnectionPoolKeyStrategy getConnectionPoolKeyStrategy()
public ProxyServer getProxyServer()
public void setTimeoutsHolder(TimeoutsHolder timeoutsHolder)
public void cancelTimeouts()
protected 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 isKeepAlive()
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 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)
protected void attachChannel(org.jboss.netty.channel.Channel channel)
public void setReuseChannel(boolean reuseChannel)
public boolean isConnectAllowed()
public void setConnectAllowed(boolean allowConnect)
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 SocketAddress getChannelRemoteAddress()
public void setRequest(Request request)
public boolean canBeReplay()
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 long getStart()
Copyright © 2014. All Rights Reserved.