V
- the result typepublic final class NettyResponseFuture<V> extends Object implements ListenableFuture<V>
Future
that can be used to track when an asynchronous HTTP request has been fully processed.ListenableFuture.CompletedFailure<T>
Modifier and Type | Field and Description |
---|---|
Throwable |
pendingException |
Constructor and Description |
---|
NettyResponseFuture(Request originalRequest,
AsyncHandler<V> asyncHandler,
NettyRequest nettyRequest,
int maxRetry,
ChannelPoolPartitioning connectionPoolPartitioning,
ProxyServer proxyServer) |
public Throwable pendingException
public NettyResponseFuture(Request originalRequest, AsyncHandler<V> asyncHandler, NettyRequest nettyRequest, int maxRetry, ChannelPoolPartitioning connectionPoolPartitioning, ProxyServer proxyServer)
public boolean isCancelled()
isCancelled
in interface Future<V>
public V get() throws InterruptedException, ExecutionException
get
in interface Future<V>
InterruptedException
ExecutionException
public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException, ExecutionException
get
in interface Future<V>
InterruptedException
TimeoutException
ExecutionException
public final void done()
ListenableFuture
done
in interface ListenableFuture<V>
public final void abort(Throwable t)
ListenableFuture
abort
in interface ListenableFuture<V>
t
- the exceptionpublic void touch()
ListenableFuture
touch
in interface ListenableFuture<V>
public ListenableFuture<V> addListener(Runnable listener, Executor exec)
ListenableFuture
Future
's computation is
complete.
null
, in that case executor will be executed
in the thread where completion happens.
addListener
in interface ListenableFuture<V>
listener
- the listener to run when the computation is complete.exec
- the executor to run the listener in.public CompletableFuture<V> toCompletableFuture()
toCompletableFuture
in interface ListenableFuture<V>
public Uri getUri()
public ChannelPoolPartitioning getConnectionPoolPartitioning()
public ProxyServer getProxyServer()
public void setAsyncHandler(AsyncHandler<V> asyncHandler)
public void cancelTimeouts()
public final Request getTargetRequest()
public final Request getCurrentRequest()
public final NettyRequest getNettyRequest()
public final void setNettyRequest(NettyRequest nettyRequest)
public final AsyncHandler<V> getAsyncHandler()
public final boolean isKeepAlive()
public final void setKeepAlive(boolean keepAlive)
public int incrementAndGetCurrentRedirectCount()
public void setTimeoutsHolder(TimeoutsHolder timeoutsHolder)
public TimeoutsHolder getTimeoutsHolder()
public boolean isInAuth()
public void setInAuth(boolean inAuth)
public boolean isAndSetInAuth(boolean set)
public boolean isInProxyAuth()
public void setInProxyAuth(boolean inProxyAuth)
public boolean isAndSetInProxyAuth(boolean inProxyAuth)
public ChannelState getChannelState()
public void setChannelState(ChannelState channelState)
public boolean isAndSetStatusReceived(boolean sr)
public boolean isStreamConsumed()
public void setStreamConsumed(boolean streamConsumed)
public long getLastTouch()
public void setHeadersAlreadyWrittenOnContinue(boolean headersAlreadyWrittenOnContinue)
public boolean isHeadersAlreadyWrittenOnContinue()
public void setDontWriteBodyBecauseExpectContinue(boolean dontWriteBodyBecauseExpectContinue)
public boolean isDontWriteBodyBecauseExpectContinue()
public void setReuseChannel(boolean reuseChannel)
public boolean isConnectAllowed()
public void setConnectAllowed(boolean allowConnect)
public void attachChannel(Channel channel, boolean reuseChannel)
public Channel channel()
public boolean isReuseChannel()
public boolean incrementRetryAndCheck()
public void setTargetRequest(Request targetRequest)
public void setCurrentRequest(Request currentRequest)
public boolean isReplayPossible()
Future
can 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()
public Object getPartitionKey()
public Realm getRealm()
public void setRealm(Realm realm)
public Realm getProxyRealm()
public void setProxyRealm(Realm proxyRealm)
Copyright © 2016. All Rights Reserved.