Class Filters
java.lang.Object
io.helidon.webserver.http.Filters
- All Implemented Interfaces:
ServerLifecycle
Handler of HTTP filters.
-
Method Summary
Modifier and TypeMethodDescriptionvoidafterStart(WebServer webServer) After server start.voidAfter server stop.voidBefore server start.static Filterscreate(ErrorHandlers errorHandlers, List<Filter> filters) Create filters.voidfilter(ConnectionContext ctx, RoutingRequest request, RoutingResponse response, Callable<Void> routingExecutor) Filter request.
-
Method Details
-
create
Create filters.- Parameters:
errorHandlers- error handlers to handle thrown exceptionsfilters- list of filters to use- Returns:
- filters
-
beforeStart
public void beforeStart()Description copied from interface:ServerLifecycleBefore server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.- Specified by:
beforeStartin interfaceServerLifecycle
-
afterStart
Description copied from interface:ServerLifecycleAfter server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.- Specified by:
afterStartin interfaceServerLifecycle- Parameters:
webServer- theWebServerthat was started
-
afterStop
public void afterStop()Description copied from interface:ServerLifecycleAfter server stop. Exceptions thrown by this method failWebServer.stop()after listener cleanup has been attempted. If this method is invoked during startup cleanup, exceptions may failWebServer.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:
afterStopin interfaceServerLifecycle
-
filter
public void filter(ConnectionContext ctx, RoutingRequest request, RoutingResponse response, Callable<Void> routingExecutor) Filter request.- Parameters:
ctx- connection contextrequest- requestresponse- responseroutingExecutor- this handler is called after all filters finish processing (unless a filter does not invoke the chain)
-