Class BasicServerExchangeHandler<T>
- java.lang.Object
-
- org.apache.hc.core5.http.nio.support.AbstractServerExchangeHandler<T>
-
- org.apache.hc.core5.http.nio.support.BasicServerExchangeHandler<T>
-
- All Implemented Interfaces:
AsyncDataConsumer
,AsyncDataExchangeHandler
,AsyncDataProducer
,AsyncServerExchangeHandler
,ResourceHolder
public class BasicServerExchangeHandler<T> extends AbstractServerExchangeHandler<T>
BasicAbstractServerExchangeHandler
implementation that delegates request processing and response generation to aAsyncServerRequestHandler
.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private AsyncServerRequestHandler<T>
requestHandler
-
Constructor Summary
Constructors Constructor Description BasicServerExchangeHandler(AsyncServerRequestHandler<T> requestHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
handle(T requestMessage, AsyncServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context)
Triggered to handles the request object produced by theAsyncRequestConsumer
returned from theAbstractServerExchangeHandler.supplyConsumer(HttpRequest, EntityDetails, HttpContext)
method.protected AsyncRequestConsumer<T>
supplyConsumer(HttpRequest request, EntityDetails entityDetails, HttpContext context)
Triggered to supply a request consumer to process the incoming request.-
Methods inherited from class org.apache.hc.core5.http.nio.support.AbstractServerExchangeHandler
available, consume, failed, handleRequest, produce, releaseResources, streamEnd, updateCapacity
-
-
-
-
Field Detail
-
requestHandler
private final AsyncServerRequestHandler<T> requestHandler
-
-
Constructor Detail
-
BasicServerExchangeHandler
public BasicServerExchangeHandler(AsyncServerRequestHandler<T> requestHandler)
-
-
Method Detail
-
supplyConsumer
protected AsyncRequestConsumer<T> supplyConsumer(HttpRequest request, EntityDetails entityDetails, HttpContext context) throws HttpException
Description copied from class:AbstractServerExchangeHandler
Triggered to supply a request consumer to process the incoming request.- Specified by:
supplyConsumer
in classAbstractServerExchangeHandler<T>
- Parameters:
request
- the request message.entityDetails
- the request entity details.context
- the actual execution context.- Returns:
- the request consumer.
- Throws:
HttpException
-
handle
protected void handle(T requestMessage, AsyncServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context) throws HttpException, java.io.IOException
Description copied from class:AbstractServerExchangeHandler
Triggered to handles the request object produced by theAsyncRequestConsumer
returned from theAbstractServerExchangeHandler.supplyConsumer(HttpRequest, EntityDetails, HttpContext)
method. The handler can choose to send response messages immediately inside the call or asynchronously at some later point.- Specified by:
handle
in classAbstractServerExchangeHandler<T>
- Parameters:
requestMessage
- the request message.responseTrigger
- the response trigger.context
- the actual execution context.- Throws:
HttpException
java.io.IOException
-
-