public abstract static class MetricsServlet.ContextListener extends Object implements javax.servlet.ServletContextListener
ServletContextListener which allows you to programmatically inject the
MetricRegistry, rate and duration units, and allowed origin for
MetricsServlet.| Constructor and Description |
|---|
MetricsServlet.ContextListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event) |
void |
contextInitialized(javax.servlet.ServletContextEvent event) |
protected String |
getAllowedOrigin()
Returns the
Access-Control-Allow-Origin header value, if any. |
protected TimeUnit |
getDurationUnit()
Returns the
TimeUnit to which durations should be converted, or null if
the default should be used. |
protected abstract com.codahale.metrics.MetricRegistry |
getMetricRegistry()
Returns the
MetricRegistry to inject into the servlet context. |
protected TimeUnit |
getRateUnit()
Returns the
TimeUnit to which rates should be converted, or null if the
default should be used. |
protected abstract com.codahale.metrics.MetricRegistry getMetricRegistry()
MetricRegistry to inject into the servlet context.protected TimeUnit getRateUnit()
TimeUnit to which rates should be converted, or null if the
default should be used.protected TimeUnit getDurationUnit()
TimeUnit to which durations should be converted, or null if
the default should be used.protected String getAllowedOrigin()
Access-Control-Allow-Origin header value, if any.public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized in interface javax.servlet.ServletContextListenerpublic void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed in interface javax.servlet.ServletContextListenerCopyright © 2013. All Rights Reserved.