Interface ResponseHandler
-
- All Known Implementing Classes:
CallableRequestDispatch
,FutureResponse
,NonWorkingResponseHandler
,RequestDispatch
public interface ResponseHandler
This interface defines a component that is capable of acting as a handler for a
Response
. An implementation of this interface is required to be passed alongside everyRequest
as part of the API (seeRequestHandler.handleRequest(Request, ResponseHandler)
andRequestHandler.handleRequest(Request, ResponseHandler)
).The jDISC API has intentionally been designed as not to provide a implicit reference from Response to corresponding Request, but rather leave that to the implementation of context-aware ResponseHandlers. By creating light-weight ResponseHandlers on a per-Request basis, any necessary reference can be embedded within.
- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ContentChannel
handleResponse(Response response)
This method will process the givenResponse
and return aContentChannel
into which the caller can write the Response's content.
-
-
-
Method Detail
-
handleResponse
ContentChannel handleResponse(Response response)
This method will process the given
Response
and return aContentChannel
into which the caller can write the Response's content.- Parameters:
response
- The Response to handle.- Returns:
- The ContentChannel to write the Response content to. Notice that the ContentChannel holds a Container reference, so failure to close this will prevent the Container from ever shutting down.
-
-