@Provider public class InstrumentedResourceMethodApplicationListener extends Object implements org.glassfish.jersey.server.monitoring.ApplicationEventListener, org.glassfish.jersey.server.model.ModelProcessor
Finally, it listens for method start events, and returns a RequestEventListener
that updates the relevant metric for suitably annotated methods when it gets the
request events indicating that the method is about to be invoked, or just got done
being invoked.
| Constructor and Description |
|---|
InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics)
Construct an application event listener using the given metrics registry.
|
InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics,
com.codahale.metrics.Clock clock,
boolean trackFilters)
Constructs a custom application listener.
|
InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics,
com.codahale.metrics.Clock clock,
boolean trackFilters,
Supplier<com.codahale.metrics.Reservoir> reservoirSupplier)
Constructs a custom application listener.
|
| Modifier and Type | Method and Description |
|---|---|
protected static String |
chooseName(String explicitName,
boolean absolute,
org.glassfish.jersey.server.model.ResourceMethod method,
String... suffixes) |
void |
onEvent(org.glassfish.jersey.server.monitoring.ApplicationEvent event) |
org.glassfish.jersey.server.monitoring.RequestEventListener |
onRequest(org.glassfish.jersey.server.monitoring.RequestEvent event) |
org.glassfish.jersey.server.model.ResourceModel |
processResourceModel(org.glassfish.jersey.server.model.ResourceModel resourceModel,
javax.ws.rs.core.Configuration configuration) |
org.glassfish.jersey.server.model.ResourceModel |
processSubResource(org.glassfish.jersey.server.model.ResourceModel subResourceModel,
javax.ws.rs.core.Configuration configuration) |
public InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics)
When using this constructor, the InstrumentedResourceMethodApplicationListener
should be added to a Jersey ResourceConfig as a singleton.
metrics - a MetricRegistrypublic InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics,
com.codahale.metrics.Clock clock,
boolean trackFilters)
metrics - the metrics registry where the metrics will be storedclock - the Clock to track time (used mostly in testing) in timerstrackFilters - whether the processing time for request and response filters should be trackedpublic InstrumentedResourceMethodApplicationListener(com.codahale.metrics.MetricRegistry metrics,
com.codahale.metrics.Clock clock,
boolean trackFilters,
Supplier<com.codahale.metrics.Reservoir> reservoirSupplier)
metrics - the metrics registry where the metrics will be storedclock - the Clock to track time (used mostly in testing) in timerstrackFilters - whether the processing time for request and response filters should be trackedreservoirSupplier - Supplier for creating the Reservoir for timers.public void onEvent(org.glassfish.jersey.server.monitoring.ApplicationEvent event)
onEvent in interface org.glassfish.jersey.server.monitoring.ApplicationEventListenerpublic org.glassfish.jersey.server.model.ResourceModel processResourceModel(org.glassfish.jersey.server.model.ResourceModel resourceModel,
javax.ws.rs.core.Configuration configuration)
processResourceModel in interface org.glassfish.jersey.server.model.ModelProcessorpublic org.glassfish.jersey.server.model.ResourceModel processSubResource(org.glassfish.jersey.server.model.ResourceModel subResourceModel,
javax.ws.rs.core.Configuration configuration)
processSubResource in interface org.glassfish.jersey.server.model.ModelProcessorpublic org.glassfish.jersey.server.monitoring.RequestEventListener onRequest(org.glassfish.jersey.server.monitoring.RequestEvent event)
onRequest in interface org.glassfish.jersey.server.monitoring.ApplicationEventListenerCopyright © 2011. All rights reserved.