@Singleton public final class RouteExecutor extends Object
Constructor and Description |
---|
RouteExecutor(Router router,
BeanContext beanContext,
RequestArgumentSatisfier requestArgumentSatisfier,
HttpServerConfiguration serverConfiguration,
ErrorResponseProcessor<?> errorResponseProcessor,
ExecutorSelector executorSelector)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
MutableHttpResponse<?> |
createDefaultErrorResponse(HttpRequest<?> httpRequest,
Throwable cause)
Creates a default error response.
|
reactor.core.publisher.Flux<MutableHttpResponse<?>> |
executeRoute(HttpRequest<?> request,
boolean executeFilters,
reactor.core.publisher.Flux<RouteMatch<?>> routePublisher)
Executes a route.
|
Publisher<MutableHttpResponse<?>> |
filterPublisher(AtomicReference<HttpRequest<?>> requestReference,
Publisher<MutableHttpResponse<?>> upstreamResponsePublisher)
Applies server filters to a request/response.
|
Optional<CoroutineHelper> |
getCoroutineHelper() |
ErrorResponseProcessor<?> |
getErrorResponseProcessor() |
ExecutorSelector |
getExecutorSelector() |
RequestArgumentSatisfier |
getRequestArgumentSatisfier() |
Router |
getRouter() |
reactor.core.publisher.Flux<MutableHttpResponse<?>> |
onError(Throwable t,
HttpRequest<?> httpRequest)
Creates a response publisher to represent the response after being handled
by any available error route or exception handler.
|
MediaType |
resolveDefaultResponseContentType(HttpRequest<?> request,
RouteInfo<?> finalRoute) |
public RouteExecutor(Router router, BeanContext beanContext, RequestArgumentSatisfier requestArgumentSatisfier, HttpServerConfiguration serverConfiguration, ErrorResponseProcessor<?> errorResponseProcessor, ExecutorSelector executorSelector)
router
- The routerbeanContext
- The bean contextrequestArgumentSatisfier
- The request argument satisfierserverConfiguration
- The server configurationerrorResponseProcessor
- The error response processorexecutorSelector
- The executor selector@Internal @NonNull public RequestArgumentSatisfier getRequestArgumentSatisfier()
@NonNull public ErrorResponseProcessor<?> getErrorResponseProcessor()
@NonNull public ExecutorSelector getExecutorSelector()
public Optional<CoroutineHelper> getCoroutineHelper()
public reactor.core.publisher.Flux<MutableHttpResponse<?>> onError(Throwable t, HttpRequest<?> httpRequest)
t
- The exception that occurredhttpRequest
- The request that caused the exceptionpublic MutableHttpResponse<?> createDefaultErrorResponse(HttpRequest<?> httpRequest, Throwable cause)
httpRequest
- The request that case the exceptioncause
- The exception that occurredpublic MediaType resolveDefaultResponseContentType(HttpRequest<?> request, RouteInfo<?> finalRoute)
request
- The requestfinalRoute
- The routepublic reactor.core.publisher.Flux<MutableHttpResponse<?>> executeRoute(HttpRequest<?> request, boolean executeFilters, reactor.core.publisher.Flux<RouteMatch<?>> routePublisher)
request
- The request that matched to the routeexecuteFilters
- Whether or not to execute server filtersroutePublisher
- The route match publisherpublic Publisher<MutableHttpResponse<?>> filterPublisher(AtomicReference<HttpRequest<?>> requestReference, Publisher<MutableHttpResponse<?>> upstreamResponsePublisher)
requestReference
- The request referenceupstreamResponsePublisher
- The original response publisher