Class EarlyHintsAsyncExec

  • All Implemented Interfaces:
    AsyncExecChainHandler

    public final class EarlyHintsAsyncExec
    extends java.lang.Object
    implements AsyncExecChainHandler
    Execution chain handler that delivers 103 Early Hints informational responses to a user-provided EarlyHintsListener without affecting processing of the final (non-1xx) response.

    This handler forwards each 103 informational response to the listener. All other responses (including the final response) are delegated unchanged.

    For security and interoperability, applications typically act only on headers considered safe in Early Hints (for example, Link with rel=preload or rel=preconnect).

    Since:
    5.6
    See Also:
    EarlyHintsListener, HttpStatus.SC_EARLY_HINTS, ResponseChannel.sendInformation(org.apache.hc.core5.http.HttpResponse, org.apache.hc.core5.http.protocol.HttpContext)
    • Constructor Detail

    • Method Detail

      • execute

        public void execute​(org.apache.hc.core5.http.HttpRequest request,
                            org.apache.hc.core5.http.nio.AsyncEntityProducer entityProducer,
                            AsyncExecChain.Scope scope,
                            AsyncExecChain chain,
                            AsyncExecCallback callback)
                     throws org.apache.hc.core5.http.HttpException,
                            java.io.IOException
        Description copied from interface: AsyncExecChainHandler
        Executes the actual HTTP request. The handler can choose to return a response message immediately inside the call or asynchronously at some later point or delegate request execution to the next element in the execution chain.
        Specified by:
        execute in interface AsyncExecChainHandler
        Parameters:
        request - the actual request.
        entityProducer - the request entity producer or null if the request does not enclose an entity.
        scope - the execution scope .
        chain - the next element in the request execution chain.
        callback - the execution callback.
        Throws:
        org.apache.hc.core5.http.HttpException - If a protocol error occurs.
        java.io.IOException - If an I/O error occurs.