Class TerminalAsyncServerFilter
- java.lang.Object
-
- org.apache.hc.core5.http.nio.support.TerminalAsyncServerFilter
-
- All Implemented Interfaces:
AsyncFilterHandler
@Contract(threading=STATELESS) public final class TerminalAsyncServerFilter extends java.lang.Object implements AsyncFilterHandler
AsyncFilterHandler
implementation represents a terminal handler in an asynchronous request processing pipeline that makes use ofHandlerFactory
to dispatch the request to a particularAsyncServerExchangeHandler
.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private HandlerFactory<AsyncServerExchangeHandler>
handlerFactory
-
Constructor Summary
Constructors Constructor Description TerminalAsyncServerFilter(HandlerFactory<AsyncServerExchangeHandler> handlerFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncDataConsumer
handle(HttpRequest request, EntityDetails entityDetails, HttpContext context, AsyncFilterChain.ResponseTrigger responseTrigger, AsyncFilterChain chain)
Processes the incoming HTTP request and if processing has been completed submits a final response to the client.
-
-
-
Field Detail
-
handlerFactory
private final HandlerFactory<AsyncServerExchangeHandler> handlerFactory
-
-
Constructor Detail
-
TerminalAsyncServerFilter
public TerminalAsyncServerFilter(HandlerFactory<AsyncServerExchangeHandler> handlerFactory)
-
-
Method Detail
-
handle
public AsyncDataConsumer handle(HttpRequest request, EntityDetails entityDetails, HttpContext context, AsyncFilterChain.ResponseTrigger responseTrigger, AsyncFilterChain chain) throws HttpException, java.io.IOException
Description copied from interface:AsyncFilterHandler
Processes the incoming HTTP request and if processing has been completed submits a final response to the client. The handler can choose to send response messages immediately inside the call or asynchronously at some later point. The handler must not use the response trigger after passing control to the next filter with theAsyncFilterChain.proceed(HttpRequest, EntityDetails, HttpContext, AsyncFilterChain.ResponseTrigger)
method.- Specified by:
handle
in interfaceAsyncFilterHandler
- Parameters:
request
- the actual request head.entityDetails
- the request entity details ornull
if the request does not enclose an entity.context
- the actual execution context.responseTrigger
- the response trigger.chain
- the next element in the request processing chain.- Returns:
- the data consumer to be used to process incoming request data. It is
expected to be
null
if entityDetails parameter isnull
. - Throws:
HttpException
java.io.IOException
-
-