Top Description Methods
org.apache.hc.client5.http.classic

public Interface ExecChainHandler

Known Direct Implementers
org.apache.hc.client5.http.impl.classic.BackoffStrategyExec, org.apache.hc.client5.http.impl.classic.ConnectExec, org.apache.hc.client5.http.impl.classic.ContentCompressionExec, org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec, org.apache.hc.client5.http.impl.classic.MainClientExec, org.apache.hc.client5.http.impl.classic.ProtocolExec, org.apache.hc.client5.http.impl.classic.RedirectExec
Annotations
@Contract
threading:STATELESS
Imports
java.io.IOException, org.apache.hc.client5.http.impl.ChainElement, org.apache.hc.client5.http.impl.classic.HttpClientBuilder, .HttpRequestRetryExec, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .HttpException

Abstract request execution handler in a classic client side request execution chain. Handlers can either be a decorator around another element that implements a cross cutting aspect or a self-contained executor capable of producing a response for the given request.

Important Note

please note it is required for decorators that implement post execution aspects or response post-processing of any sort to release resources associated with the response by calling ClassicHttpResponse#close() methods in case of an I/O, protocol or runtime exception, or in case the response is not propagated to the caller.

For information regarding the handler chain behaviour in case of a request re-execution, please refer to the HttpRequestRetryExec javadoc.

Well known request execution handlers could be referred to by name using one of the ChainElement enum values.

Since
4.3
See Also
ChainElement, HttpClientBuilder#addExecInterceptorFirst(String, ExecChainHandler), HttpClientBuilder#addExecInterceptorBefore(String, String, ExecChainHandler), HttpClientBuilder#addExecInterceptorAfter(String, String, ExecChainHandler), HttpClientBuilder#addExecInterceptorLast(String, ExecChainHandler)

Method Summary

Modifier and TypeMethod and Description
public ClassicHttpResponse
execute(ClassicHttpRequest
the actual request.
request
,
ExecChain.Scope
the execution scope .
scope
,
ExecChain
the next element in the request execution chain.
chain
)

Executes the actual HTTP request.

Method Detail

executeback to summary
public ClassicHttpResponse execute(ClassicHttpRequest request, ExecChain.Scope scope, ExecChain chain) throws IOException, HttpException

Executes the actual HTTP request. The handler can choose to return a response message or delegate request execution to the next element in the execution chain.

Parameters
request:ClassicHttpRequest

the actual request.

scope:ExecChain.Scope

the execution scope .

chain:ExecChain

the next element in the request execution chain.