Class MonitoringStatisticsProcessor
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.MonitoringStatisticsProcessor
-
final class MonitoringStatisticsProcessor extends java.lang.Object
Process events of application and request processing intomonitoring statistics
. TheMonitoringStatisticsProcessor
starts a new thread which process events in regular intervals and for each new monitoring statistics it calls registeredmonitoring statistics event listeners
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MonitoringStatisticsProcessor.FloodingLogger
Upon calling ofMonitoringStatisticsProcessor.FloodingLogger.conditionallyLogFlooding()
, flooding logger conditionally checks for the size of the associated collection and if its size increases a warning about flooding is logged.
-
Field Summary
Fields Modifier and Type Field Description private static int
DEFAULT_INTERVAL
private int
interval
private static java.util.logging.Logger
LOGGER
private MonitoringEventListener
monitoringEventListener
private java.util.concurrent.ScheduledExecutorService
scheduler
private static int
SHUTDOWN_TIMEOUT
private MonitoringStatisticsImpl.Builder
statisticsBuilder
private java.util.List<MonitoringStatisticsListener>
statisticsCallbackList
-
Constructor Summary
Constructors Constructor Description MonitoringStatisticsProcessor(InjectionManager injectionManager, MonitoringEventListener monitoringEventListener)
Creates a new instance of processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
processExceptionMapperEvents()
private void
processRequestItems()
private void
processResponseCodeEvents()
(package private) void
shutDown()
Stops processing of any further execution of this processor.void
startMonitoringWorker()
Start the thread that will process the events intoMonitoringStatistics
.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
DEFAULT_INTERVAL
private static final int DEFAULT_INTERVAL
- See Also:
- Constant Field Values
-
SHUTDOWN_TIMEOUT
private static final int SHUTDOWN_TIMEOUT
- See Also:
- Constant Field Values
-
monitoringEventListener
private final MonitoringEventListener monitoringEventListener
-
statisticsBuilder
private final MonitoringStatisticsImpl.Builder statisticsBuilder
-
statisticsCallbackList
private final java.util.List<MonitoringStatisticsListener> statisticsCallbackList
-
scheduler
private final java.util.concurrent.ScheduledExecutorService scheduler
-
interval
private final int interval
-
-
Constructor Detail
-
MonitoringStatisticsProcessor
MonitoringStatisticsProcessor(InjectionManager injectionManager, MonitoringEventListener monitoringEventListener)
Creates a new instance of processor.- Parameters:
injectionManager
- injection manager.monitoringEventListener
- Monitoring event listener.
-
-
Method Detail
-
startMonitoringWorker
public void startMonitoringWorker()
Start the thread that will process the events intoMonitoringStatistics
.
-
processExceptionMapperEvents
private void processExceptionMapperEvents()
-
processRequestItems
private void processRequestItems()
-
processResponseCodeEvents
private void processResponseCodeEvents()
-
shutDown
void shutDown() throws java.lang.InterruptedException
Stops processing of any further execution of this processor. The internal thread will finish processing of actual events and will be not executed again. The method finishes after the internal thread finish its processing loop.- Throws:
java.lang.InterruptedException
- thrown when waiting for the thread to finish the work is interrupted. In this case internal listeners will be still shutdown.
-
-