Package io.micronaut.http.server
Class RouteExecutor
java.lang.Object
io.micronaut.http.server.RouteExecutor
A class responsible for executing routes.
- Since:
- 3.0.0
- Author:
- James Kleeh
-
Constructor Summary
ConstructorDescriptionRouteExecutor
(Router router, BeanContext beanContext, RequestArgumentSatisfier requestArgumentSatisfier, HttpServerConfiguration serverConfiguration, ErrorResponseProcessor<?> errorResponseProcessor, ExecutorSelector executorSelector) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateDefaultErrorResponse
(HttpRequest<?> httpRequest, Throwable cause) Creates a default error response.resolveDefaultResponseContentType
(HttpRequest<?> request, RouteInfo<?> finalRoute)
-
Constructor Details
-
RouteExecutor
public RouteExecutor(Router router, BeanContext beanContext, RequestArgumentSatisfier requestArgumentSatisfier, HttpServerConfiguration serverConfiguration, ErrorResponseProcessor<?> errorResponseProcessor, ExecutorSelector executorSelector) Default constructor.- Parameters:
router
- The routerbeanContext
- The bean contextrequestArgumentSatisfier
- The request argument satisfierserverConfiguration
- The server configurationerrorResponseProcessor
- The error response processorexecutorSelector
- The executor selector
-
-
Method Details
-
getRouter
- Returns:
- The router
-
getRequestArgumentSatisfier
- Returns:
- The request argument satisfier
-
getErrorResponseProcessor
- Returns:
- The error response processor
-
getExecutorSelector
- Returns:
- The executor selector
-
getCoroutineHelper
- Returns:
- The kotlin coroutine helper
-
createDefaultErrorResponse
public MutableHttpResponse<?> createDefaultErrorResponse(HttpRequest<?> httpRequest, Throwable cause) Creates a default error response. Should be used when a response could not be retrieved from any other method.- Parameters:
httpRequest
- The request that case the exceptioncause
- The exception that occurred- Returns:
- A response to represent the exception
-
resolveDefaultResponseContentType
- Parameters:
request
- The requestfinalRoute
- The route- Returns:
- The default content type declared on the route
-