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
Basic
AbstractServerExchangeHandler
implementation that delegates
request processing and response generation to a AsyncServerRequestHandler
.- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 Details
-
requestHandler
-
-
Constructor Details
-
BasicServerExchangeHandler
-
-
Method Details
-
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, 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
IOException
-