- All Superinterfaces:
Route.Aware
- All Known Subinterfaces:
Route.Before
,Route.Decorator
- All Known Implementing Classes:
AccessLogHandler
,CorsHandler
,CsrfHandler
,HeadHandler
,RateLimitHandler
,SSLHandler
,TraceHandler
,WebVariables
- Enclosing class:
- Route
Decorates a route handler by running logic before and after route handler.
{
use(next -> ctx -> {
long start = System.currentTimeMillis();
Object result = next.apply(ctx);
long end = System.currentTimeMillis();
System.out.println("Took: " + (end - start));
return result;
});
}
- Since:
- 2.0.0
- Author:
- edgar
-
Method Summary
Modifier and TypeMethodDescriptionapply
(Route.Handler next) Chain the filter within next handler.default Route.Filter
then
(Route.Filter next) Chain this filter with another and produces a new decorator.default Route.Handler
then
(Route.Handler next) Chain this filter with a handler and produces a new handler.Methods inherited from interface io.jooby.Route.Aware
setRoute
-
Method Details
-
apply
Chain the filter within next handler.- Parameters:
next
- Next handler.- Returns:
- A new handler.
-
then
Chain this filter with another and produces a new decorator.- Parameters:
next
- Next decorator.- Returns:
- A new decorator.
-
then
Chain this filter with a handler and produces a new handler.- Parameters:
next
- Next handler.- Returns:
- A new handler.
-