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>InterruptedExceptionExecutionExceptionpublic V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException, ExecutionException
get in interface Future<V>InterruptedExceptionTimeoutExceptionExecutionExceptionpublic final void done()
ListenableFuturedone in interface ListenableFuture<V>public final void abort(Throwable t)
ListenableFutureabort in interface ListenableFuture<V>t - the exceptionpublic void touch()
ListenableFuturetouch in interface ListenableFuture<V>public ListenableFuture<V> addListener(Runnable listener, Executor exec)
ListenableFutureFuture'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 © 2017. All Rights Reserved.