Class Filters

java.lang.Object
io.helidon.webserver.http.Filters
All Implemented Interfaces:
ServerLifecycle

public final class Filters extends Object implements ServerLifecycle
Handler of HTTP filters.
  • Method Details

    • create

      public static Filters create(ErrorHandlers errorHandlers, List<Filter> filters)
      Create filters.
      Parameters:
      errorHandlers - error handlers to handle thrown exceptions
      filters - list of filters to use
      Returns:
      filters
    • beforeStart

      public void beforeStart()
      Description copied from interface: ServerLifecycle
      Before server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.
      Specified by:
      beforeStart in interface ServerLifecycle
    • afterStart

      public void afterStart(WebServer webServer)
      Description copied from interface: ServerLifecycle
      After server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.
      Specified by:
      afterStart in interface ServerLifecycle
      Parameters:
      webServer - the WebServer that was started
    • afterStop

      public void afterStop()
      Description copied from interface: ServerLifecycle
      After server stop. Exceptions thrown by this method fail WebServer.stop() after listener cleanup has been attempted. If this method is invoked during startup cleanup, exceptions may fail WebServer.start(). If this method is invoked during suspend or resume failure cleanup, exceptions may be suppressed on the original suspend or resume failure.
      Specified by:
      afterStop in interface ServerLifecycle
    • filter

      public void filter(ConnectionContext ctx, RoutingRequest request, RoutingResponse response, Callable<Void> routingExecutor)
      Filter request.
      Parameters:
      ctx - connection context
      request - request
      response - response
      routingExecutor - this handler is called after all filters finish processing (unless a filter does not invoke the chain)