Interface InterceptableRoute<A extends ExchangeContext,B extends Exchange<A>>
- Type Parameters:
A
- the type of the exchange contextB
- the type of exchange handled by the handler
- All Superinterfaces:
Route<A,
B>
- All Known Subinterfaces:
ErrorWebRoute<A>
,WebRoute<A>
,WebSocketRoute<A>
A route which has the ability to be intercepted using one or more ExchangeInterceptor
.
- Since:
- 1.3
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionList
<? extends ExchangeInterceptor<A, B>> Returns the list of exchange interceptors attached to the route.void
setInterceptors
(List<? extends ExchangeInterceptor<A, B>> interceptors) Sets the list of exchange interceptors to execute prior to the exchange handler when an exchange is processed by the route.Methods inherited from interface io.inverno.mod.web.server.spi.Route
disable, enable, getHandler, isDisabled, remove
-
Method Details
-
getInterceptors
List<? extends ExchangeInterceptor<A,B>> getInterceptors()Returns the list of exchange interceptors attached to the route.
Note that this method returns the raw interceptors that were specified on the route either by using an
InterceptorManager
or explicitly by invokingsetInterceptors(java.util.List)
. When specified with an interceptor manager and depending on the criteria that were specified at the time, a raw interceptor might be filtered to only intercept routes that are matching these criteria. For instance, an interceptor that intercepts GET exchanges will be defined on the default route (ie. defined with no criteria) but it will only be invoked on GET exchange.- Returns:
- a list of interceptors
-
setInterceptors
Sets the list of exchange interceptors to execute prior to the exchange handler when an exchange is processed by the route.
Interceptors are chained and therefore executed in the same order as the specified list.
This method is explicit and replaces the interceptors previously defined on the route. Unlike interceptors defined using an
InterceptorManager
, the specified interceptors won't be filtered and intercept all exchanges handled by the route.- Parameters:
interceptors
- a list of interceptors
-