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 MetricFilter |
getMetricFilter()
Returns the
MetricFilter that shall be used to filter metrics, or MetricFilter.ALL if
the default should be used. |
protected abstract MetricRegistry |
getMetricRegistry() |
protected TimeUnit |
getRateUnit() |
protected abstract 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 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.ServletContextListener
public void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed
in interface javax.servlet.ServletContextListener
Copyright © 2014. All Rights Reserved.