Class BasicServerExchangeHandler<T>
java.lang.Object
org.apache.hc.core5.http.nio.support.AbstractServerExchangeHandler<T>
org.apache.hc.core5.http.nio.support.BasicServerExchangeHandler<T>
- Type Parameters:
T- the type of request messages.
- 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 voidhandle(T requestMessage, AsyncServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context) Triggered to handles the request object produced by theAsyncRequestConsumerreturned 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 AbstractServerExchangeHandler
available, consume, failed, failedInternal, handleError, handleRequest, produce, releaseResources, streamEnd, updateCapacityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncDataExchangeHandler
outputAborted
-
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:AbstractServerExchangeHandlerTriggered to supply a request consumer to process the incoming request.- Specified by:
supplyConsumerin classAbstractServerExchangeHandler<T>- Parameters:
request- the request message.entityDetails- the request entity details.context- the actual execution context.- Returns:
- the request consumer.
- Throws:
HttpException- in case of an HTTP protocol violation.
-
handle
protected void handle(T requestMessage, AsyncServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context) throws HttpException, IOException Description copied from class:AbstractServerExchangeHandlerTriggered to handles the request object produced by theAsyncRequestConsumerreturned 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:
handlein classAbstractServerExchangeHandler<T>- Parameters:
requestMessage- the request message.responseTrigger- the response trigger.context- the actual execution context.- Throws:
HttpException- in case of an HTTP protocol violation.IOException- in case of an I/O error.
-