Module io.jooby
Package io.jooby

Interface Route.Before

All Superinterfaces:
Route.Aware, Route.Filter
All Known Implementing Classes:
CsrfHandler, RateLimitHandler, SSLHandler
Enclosing class:
Route

public static interface Route.Before extends Route.Filter
Decorates a handler and run logic before handler is executed.
Since:
2.0.0
Author:
edgar
  • Method Details

    • apply

      @NonNull default Route.Handler apply(@NonNull Route.Handler next)
      Description copied from interface: Route.Filter
      Chain the filter within next handler.
      Specified by:
      apply in interface Route.Filter
      Parameters:
      next - Next handler.
      Returns:
      A new handler.
    • apply

      void apply(@NonNull Context ctx) throws Exception
      Execute application code before next handler.
      Parameters:
      ctx - Web context.
      Throws:
      Exception - If something goes wrong.
    • then

      @NonNull default Route.Before then(@NonNull Route.Before next)
      Chain this filter with next one and produces a new before filter.
      Parameters:
      next - Next decorator.
      Returns:
      A new decorator.
    • then

      @NonNull default Route.Handler then(@NonNull Route.Handler next)
      Chain this decorator with a handler and produces a new handler.
      Specified by:
      then in interface Route.Filter
      Parameters:
      next - Next handler.
      Returns:
      A new handler.