Package com.codahale.metrics.servlets
Class HealthCheckServlet.ContextListener
- java.lang.Object
-
- com.codahale.metrics.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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
contextDestroyed(javax.servlet.ServletContextEvent event)
void
contextInitialized(javax.servlet.ServletContextEvent event)
protected ExecutorService
getExecutorService()
protected com.codahale.metrics.health.HealthCheckFilter
getHealthCheckFilter()
protected abstract com.codahale.metrics.health.HealthCheckRegistry
getHealthCheckRegistry()
protected com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
-
-
-
Method Detail
-
getHealthCheckRegistry
protected abstract com.codahale.metrics.health.HealthCheckRegistry getHealthCheckRegistry()
- Returns:
- the
HealthCheckRegistry
to inject into the servlet context.
-
getExecutorService
protected ExecutorService getExecutorService()
- Returns:
- the
ExecutorService
to inject into the servlet context, ornull
if the health checks should be run in the servlet worker thread.
-
getHealthCheckFilter
protected com.codahale.metrics.health.HealthCheckFilter getHealthCheckFilter()
- Returns:
- the
HealthCheckFilter
that shall be used to filter health checks, orHealthCheckFilter.ALL
if the default should be used.
-
getObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
- Returns:
- the
ObjectMapper
that shall be used to render health checks, ornull
if the default object mapper should be used.
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitialized
in interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyed
in interfacejavax.servlet.ServletContextListener
-
-