Interface ExecChainHandler

All Known Implementing Classes:
BackoffStrategyExec, CachingExec, ConnectExec, ContentCompressionExec, HttpRequestRetryExec, MainClientExec, ProtocolExec, RedirectExec

@Contract(threading=STATELESS) public interface ExecChainHandler
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: 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 Closeable.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:
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hc.core5.http.ClassicHttpResponse
    execute(org.apache.hc.core5.http.ClassicHttpRequest request, ExecChain.Scope scope, ExecChain chain)
    Executes the actual HTTP request.
  • Method Details

    • execute

      org.apache.hc.core5.http.ClassicHttpResponse execute(org.apache.hc.core5.http.ClassicHttpRequest request, ExecChain.Scope scope, ExecChain chain) throws IOException, org.apache.hc.core5.http.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 - the actual request.
      scope - the execution scope .
      chain - the next element in the request execution chain.
      Throws:
      IOException
      org.apache.hc.core5.http.HttpException