Class MonitoringStatisticsProcessor
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.MonitoringStatisticsProcessor
-
final class MonitoringStatisticsProcessor extends java.lang.ObjectProcess events of application and request processing intomonitoring statistics. TheMonitoringStatisticsProcessorstarts 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 classMonitoringStatisticsProcessor.FloodingLoggerUpon 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 intDEFAULT_INTERVALprivate intintervalprivate static java.util.logging.LoggerLOGGERprivate MonitoringEventListenermonitoringEventListenerprivate java.util.concurrent.ScheduledExecutorServiceschedulerprivate static intSHUTDOWN_TIMEOUTprivate MonitoringStatisticsImpl.BuilderstatisticsBuilderprivate 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 voidprocessExceptionMapperEvents()private voidprocessRequestItems()private voidprocessResponseCodeEvents()(package private) voidshutDown()Stops processing of any further execution of this processor.voidstartMonitoringWorker()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.InterruptedExceptionStops 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.
-
-