Interface WebRouteInterceptor<A extends ExchangeContext>
- Type Parameters:
A
- the exchange context type
- All Known Subinterfaces:
WebServer<A>
,WebServer.Intercepted<A>
Entry point for configuring the Web exchange interceptors to apply when creating Web routes in an intercepted Web server.
It is implemented by the WebServer
. Interceptors are defined using a WebRouteInterceptorManager
which allows to specify the criteria a Web route must match for the Web exchange
interceptor to be executed.
When defining an interceptor, the WebRouteInterceptorManager
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.
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 Web route interceptors in a Web server. -
Method Summary
Modifier and TypeMethodDescriptionconfigureInterceptors
(WebRouteInterceptor.Configurer<? super A> configurer) Configures multiple Web route interceptors.configureInterceptors
(List<WebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple Web route interceptors.WebRouteInterceptorManager
<A, ? extends WebRouteInterceptor<A>> Returns a new interceptor manager for defining a Web route interceptor.default WebRouteInterceptor
<A> intercept
(Function<WebRouteInterceptorManager<A, ? extends WebRouteInterceptor<A>>, ? extends WebRouteInterceptor<A>> configurer) Configures a Web route interceptor.
-
Method Details
-
intercept
WebRouteInterceptorManager<A,? extends WebRouteInterceptor<A>> intercept()Returns a new interceptor manager for defining a Web route interceptor.
- Returns:
- a new Web route interceptor manager
-
intercept
default WebRouteInterceptor<A> intercept(Function<WebRouteInterceptorManager<A, ? extends WebRouteInterceptor<A>>, ? extends WebRouteInterceptor<A>> configurer) Configures a Web route interceptor.
The result returned by the specified configurer function must be the 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 a Web route interceptor containing the configured interceptor.
- Parameters:
configurer
- a Web route interceptor configurer function- Returns:
- the Web route interceptor containing the configured interceptor
-
configureInterceptors
Configures multiple Web route interceptors.
- Parameters:
configurer
- a Web route interceptor configurer- Returns:
- the Web route interceptor containing the configured interceptors
-
configureInterceptors
WebRouteInterceptor<A> configureInterceptors(List<WebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple Web route interceptors.
- Parameters:
configurers
- a list of Web route interceptor configurers- Returns:
- the Web route interceptor containing the configured interceptors
-