final class MonitoringStatisticsProcessor
extends java.lang.Object
monitoring statistics
.
The MonitoringStatisticsProcessor
starts a new thread which process events in regular intervals
and for each new monitoring statistics it calls registered
monitoring statistics event listeners
.Modifier and Type | Class and Description |
---|---|
private static class |
MonitoringStatisticsProcessor.FloodingLogger
Upon calling of
MonitoringStatisticsProcessor.FloodingLogger.conditionallyLogFlooding() , flooding logger conditionally checks for the size of the associated
collection and if its size increases a warning about flooding is logged. |
Modifier and Type | Field and 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 and Description |
---|
MonitoringStatisticsProcessor(org.glassfish.hk2.api.ServiceLocator serviceLocator,
MonitoringEventListener monitoringEventListener)
Creates a new instance of processor.
|
Modifier and Type | Method and 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
into
MonitoringStatistics . |
private static final java.util.logging.Logger LOGGER
private static final int DEFAULT_INTERVAL
private static final int SHUTDOWN_TIMEOUT
private final MonitoringEventListener monitoringEventListener
private final MonitoringStatisticsImpl.Builder statisticsBuilder
private final java.util.List<MonitoringStatisticsListener> statisticsCallbackList
private final java.util.concurrent.ScheduledExecutorService scheduler
private final int interval
MonitoringStatisticsProcessor(org.glassfish.hk2.api.ServiceLocator serviceLocator, MonitoringEventListener monitoringEventListener)
serviceLocator
- Service locator.monitoringEventListener
- Monitoring event listener.public void startMonitoringWorker()
MonitoringStatistics
.private void processExceptionMapperEvents()
private void processRequestItems()
private void processResponseCodeEvents()
void shutDown() throws java.lang.InterruptedException
java.lang.InterruptedException
- thrown when waiting for the thread to finish the work is interrupted. In this
case internal listeners will be still shutdown.