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 |
|---|
ContextListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent event) |
void |
contextInitialized(javax.servlet.ServletContextEvent event) |
protected String |
getAllowedOrigin() |
protected TimeUnit |
getDurationUnit() |
protected String |
getJsonpCallbackParameter()
Returns the name of the parameter used to specify the jsonp callback, if any.
|
protected com.codahale.metrics.MetricFilter |
getMetricFilter()
Returns the
MetricFilter that shall be used to filter metrics, or MetricFilter.ALL if
the default should be used. |
protected abstract com.codahale.metrics.MetricRegistry |
getMetricRegistry() |
protected TimeUnit |
getRateUnit() |
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.protected String getJsonpCallbackParameter()
protected com.codahale.metrics.MetricFilter getMetricFilter()
MetricFilter that shall be used to filter metrics, or MetricFilter.ALL if
the default should be used.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 © 2019. All Rights Reserved.