Class Overview
A Future that can be used to track when an asynchronous HTTP request has been fully processed.
Summary
[Expand]
Inherited Methods |
From class
com.ning.http.client.listenable.AbstractListenableFuture
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0)
|
final
void
|
wait(long arg0, int arg1)
|
|
From interface
com.ning.http.client.ListenableFuture
abstract
void
|
abort(Throwable t)
Abort the current processing, and propagate the Throwable to the AsyncHandler or Future
|
abstract
ListenableFuture<V>
|
addListener(Runnable listener, Executor exec)
Adds a listener and executor to the ListenableFuture.
|
abstract
void
|
content(V v)
Set the content that will be returned by this instance
|
abstract
void
|
done(Callable callable)
Execute a Callable and if there is no exception, mark this Future as done and release the internal lock.
|
abstract
boolean
|
getAndSetWriteBody(boolean writeBody)
|
abstract
boolean
|
getAndSetWriteHeaders(boolean writeHeader)
|
abstract
void
|
touch()
Touch the current instance to prevent external service to times out.
|
|
From interface
java.util.concurrent.Future
abstract
boolean
|
cancel(boolean arg0)
|
abstract
V
|
get()
|
abstract
V
|
get(long arg0, TimeUnit arg1)
|
abstract
boolean
|
isCancelled()
|
abstract
boolean
|
isDone()
|
|
Constants
public
static
final
String
MAX_RETRY
Constant Value:
"com.ning.http.client.providers.netty.maxRetry"
Public Constructors
public
NettyResponseFuture
(URI uri, Request request, AsyncHandler<V> asyncHandler, HttpRequest nettyRequest, int responseTimeoutInMs, int idleConnectionTimeoutInMs, NettyAsyncHttpProvider asyncHttpProvider)
Public Methods
public
final
void
abort
(Throwable t)
public
boolean
cancel
(boolean force)
public
boolean
cannotBeReplay
()
Return true if the 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.
Returns
- true if that Future cannot be recovered.
public
void
content
(V v)
public
final
void
done
(Callable callable)
public
V
get
()
Throws
InterruptedException
| |
ExecutionException
| |
public
V
get
(long l, TimeUnit tu)
Throws
InterruptedException
| |
TimeoutException
| |
ExecutionException
| |
public
boolean
getAndSetStatusReceived
(boolean sr)
public
boolean
getAndSetWriteBody
(boolean writeBody)
public
boolean
getAndSetWriteHeaders
(boolean writeHeaders)
public
final
HttpRequest
getNettyRequest
()
public
boolean
hasExpired
()
Is the Future still valid
Returns
true
if response has expired and should be terminated.
public
boolean
isCancelled
()
public
boolean
isConnectAllowed
()
public
void
setConnectAllowed
(boolean allowConnect)
public
void
setRequest
(Request request)
public
void
setReuseChannel
(boolean reuseChannel)
public
String
toString
()
Protected Methods
protected
void
attachChannel
(Channel channel)
protected
void
attachChannel
(Channel channel, boolean reuseChannel)
protected
boolean
canRetry
()
protected
Channel
channel
()
protected
boolean
getAndSetAuth
(boolean inDigestAuth)
protected
final
HttpResponse
getHttpResponse
()
protected
final
boolean
getKeepAlive
()
protected
final
Request
getRequest
()
protected
NettyResponseFuture.STATE
getState
()
protected
int
incrementAndGetCurrentRedirectCount
()
protected
boolean
isInAuth
()
protected
boolean
reuseChannel
()
protected
final
void
setHttpResponse
(HttpResponse httpResponse)
protected
final
void
setKeepAlive
(boolean keepAlive)
protected
final
void
setNettyRequest
(HttpRequest nettyRequest)
protected
void
setReaperFuture
(Future<?> reaperFuture)
protected
void
setState
(NettyResponseFuture.STATE state)
protected
void
setURI
(URI uri)