Package io.dropwizard.metrics5.servlets
Class HealthCheckServlet.ContextListener
java.lang.Object
io.dropwizard.metrics5.servlets.HealthCheckServlet.ContextListener
- All Implemented Interfaces:
EventListener,javax.servlet.ServletContextListener
- Enclosing class:
- HealthCheckServlet
public abstract static class HealthCheckServlet.ContextListener extends Object implements javax.servlet.ServletContextListener
-
Constructor Summary
Constructors Constructor Description ContextListener() -
Method Summary
Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent event)voidcontextInitialized(javax.servlet.ServletContextEvent event)protected ExecutorServicegetExecutorService()protected io.dropwizard.metrics5.health.HealthCheckFiltergetHealthCheckFilter()protected abstract io.dropwizard.metrics5.health.HealthCheckRegistrygetHealthCheckRegistry()
-
Constructor Details
-
ContextListener
public ContextListener()
-
-
Method Details
-
getHealthCheckRegistry
protected abstract io.dropwizard.metrics5.health.HealthCheckRegistry getHealthCheckRegistry()- Returns:
- the
HealthCheckRegistryto inject into the servlet context.
-
getExecutorService
- Returns:
- the
ExecutorServiceto inject into the servlet context, ornullif the health checks should be run in the servlet worker thread.
-
getHealthCheckFilter
protected io.dropwizard.metrics5.health.HealthCheckFilter getHealthCheckFilter()- Returns:
- the
HealthCheckFilterthat shall be used to filter health checks, orHealthCheckFilter.ALLif the default should be used.
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-