Class RouteExecutor

java.lang.Object
io.micronaut.http.server.RouteExecutor

@Singleton public final class RouteExecutor extends Object
A class responsible for executing routes.
Since:
3.0.0
Author:
James Kleeh
  • Constructor Details

    • RouteExecutor

      public RouteExecutor(Router router, BeanContext beanContext, RequestArgumentSatisfier requestArgumentSatisfier, HttpServerConfiguration serverConfiguration, ErrorResponseProcessor<?> errorResponseProcessor, ExecutorSelector executorSelector)
      Default constructor.
      Parameters:
      router - The router
      beanContext - The bean context
      requestArgumentSatisfier - The request argument satisfier
      serverConfiguration - The server configuration
      errorResponseProcessor - The error response processor
      executorSelector - The executor selector
  • Method Details

    • getRouter

      @NonNull public @NonNull Router getRouter()
      Returns:
      The router
    • getRequestArgumentSatisfier

      @Internal @NonNull public @NonNull RequestArgumentSatisfier getRequestArgumentSatisfier()
      Returns:
      The request argument satisfier
    • getErrorResponseProcessor

      @NonNull public @NonNull ErrorResponseProcessor<?> getErrorResponseProcessor()
      Returns:
      The error response processor
    • getExecutorSelector

      @NonNull public @NonNull ExecutorSelector getExecutorSelector()
      Returns:
      The executor selector
    • getCoroutineHelper

      public Optional<CoroutineHelper> 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 exception
      cause - The exception that occurred
      Returns:
      A response to represent the exception
    • resolveDefaultResponseContentType

      public MediaType resolveDefaultResponseContentType(HttpRequest<?> request, RouteInfo<?> finalRoute)
      Parameters:
      request - The request
      finalRoute - The route
      Returns:
      The default content type declared on the route