@Provider public class InstrumentedResourceMethodApplicationListener extends Object implements org.glassfish.jersey.server.monitoring.ApplicationEventListener, org.glassfish.jersey.server.model.ModelProcessor
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.
|
| 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)
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 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 © 2019. All Rights Reserved.