Class MonitoringEventListener
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.MonitoringEventListener
- All Implemented Interfaces:
ApplicationEventListener
@Priority(1100)
public final class MonitoringEventListener
extends Object
implements ApplicationEventListener
application event listener that listens to application
and request events and supplies data to MonitoringStatisticsProcessor which
produces monitoring statistics.
The MonitoringStatisticsProcessor is started by this class after the first application event
comes.
This event listener must be registered as a standard provider when monitoring statistics are required in the runtime.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classMethod statistics.private class(package private) static classRequest statistics.(package private) static classTime statistics. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final Queue<RequestEvent> private InjectionManagerprivate static final Loggerprivate MonitoringStatisticsProcessorprivate final Queue<MonitoringEventListener.RequestStats> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Queue<RequestEvent> Get the exception mapper event queue.(package private) Queue<MonitoringEventListener.RequestStats> Get the request event queue.Get the queue with response status codes.voidonEvent(ApplicationEvent event) Process the applicationevent.onRequest(RequestEvent requestEvent) Process a new request and return arequest event listenerif listening torequest eventsis required.
-
Field Details
-
LOGGER
-
EVENT_QUEUE_SIZE
private static final int EVENT_QUEUE_SIZE- See Also:
-
injectionManager
-
requestQueuedItems
-
responseStatuses
-
exceptionMapperEvents
-
monitoringStatisticsProcessor
-
-
Constructor Details
-
MonitoringEventListener
public MonitoringEventListener()
-
-
Method Details
-
onRequest
Description copied from interface:ApplicationEventListenerProcess a new request and return arequest event listenerif listening torequest eventsis required. The method is called once for each new incoming request. If listening to the request is required then request event must be returned from the method. Such a request event listener will receive all request events that one request. If listening to request event for the request is not required thennullmust be returned from the method (do not return empty mock listener in these cases as it will have negative performance impact).- Specified by:
onRequestin interfaceApplicationEventListener- Parameters:
requestEvent- Event of typeRequestEvent.Type.START.- Returns:
- Request event listener that will monitor the events of the request
connected with
requestEvent; null otherwise.
-
onEvent
Description copied from interface:ApplicationEventListenerProcess the applicationevent. This method is called when new event occurs.- Specified by:
onEventin interfaceApplicationEventListener- Parameters:
event- Application event.
-
getExceptionMapperEvents
Queue<RequestEvent> getExceptionMapperEvents()Get the exception mapper event queue.- Returns:
- Exception mapper event queue.
-
getRequestQueuedItems
Queue<MonitoringEventListener.RequestStats> getRequestQueuedItems()Get the request event queue.- Returns:
- Request event queue.
-
getResponseStatuses
Get the queue with response status codes.- Returns:
- response status queue.
-