Interface ErrorWebRouteInterceptor<A extends ExchangeContext>
- Type Parameters:
A
- the exchange context type
- All Known Subinterfaces:
WebServer<A>
,WebServer.Intercepted<A>
Entry point for configuring the error Web exchange interceptors to apply when creating error Web routes in an intercepted Web server.
It is implemented by the WebServer
. Interceptors are defined using an ErrorWebRouteInterceptorManager
which allows to specify the criteria an error Web route must match for the
error Web exchange interceptor to be executed.
When defining an interceptor, the ErrorWebRouteInterceptorManager
shall return a new intercepted Web server instance containing the interceptor definition. It can then be used to define
more interceptors resulting in the creation of hierarchies of Web servers with different interceptor definitions.
Error Web routes that are expected to be intercepted must then be defined after defining interceptors on the resulting intercepted Web server.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A configurer used to configure error Web route interceptors in a Web server. -
Method Summary
Modifier and TypeMethodDescriptionconfigureErrorInterceptors
(ErrorWebRouteInterceptor.Configurer<? super A> configurer) Configures multiple error Web route interceptors.configureErrorInterceptors
(List<ErrorWebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple error Web route interceptors.ErrorWebRouteInterceptorManager
<A, ? extends ErrorWebRouteInterceptor<A>> Returns a new interceptor manager for defining an error Web route interceptor.default ErrorWebRouteInterceptor
<A> interceptError
(Function<ErrorWebRouteInterceptorManager<A, ? extends ErrorWebRouteInterceptor<A>>, ? extends ErrorWebRouteInterceptor<A>> configurer) Configures an error Web route interceptor.
-
Method Details
-
interceptError
ErrorWebRouteInterceptorManager<A,? extends ErrorWebRouteInterceptor<A>> interceptError()Returns a new interceptor manager for defining an error Web route interceptor.
- Returns:
- a new error Web route interceptor manager
-
interceptError
default ErrorWebRouteInterceptor<A> interceptError(Function<ErrorWebRouteInterceptorManager<A, ? extends ErrorWebRouteInterceptor<A>>, ? extends ErrorWebRouteInterceptor<A>> configurer) Configures an error Web route interceptor.
The result returned by the specified configurer function must be the error Web route interceptor returned by the input interceptor manager after defining the interceptor and which contains the configured interceptor. If that requirement is not met, invoking this method will most likely result in a no-op operation since no route could be defined on an error Web route interceptor containing the configured interceptor.
- Parameters:
configurer
- an error Web route interceptor configurer function- Returns:
- the error Web route interceptor containing the configured interceptor
-
configureErrorInterceptors
ErrorWebRouteInterceptor<A> configureErrorInterceptors(ErrorWebRouteInterceptor.Configurer<? super A> configurer) Configures multiple error Web route interceptors.
- Parameters:
configurer
- an error Web route interceptor configurer- Returns:
- the error Web route interceptor containing the configured interceptors
-
configureErrorInterceptors
ErrorWebRouteInterceptor<A> configureErrorInterceptors(List<ErrorWebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple error Web route interceptors.
- Parameters:
configurers
- a list of error Web route interceptor configurers- Returns:
- the error Web route interceptor containing the configured interceptors
-