Class PoolListener
java.lang.Object
host.anzo.commons.emergency.memory.watchers.PoolListener
- All Implemented Interfaces:
EventListener,NotificationListener
The PoolListener class implements the NotificationListener interface and is responsible
for handling memory usage notifications for a specific MemoryPoolMXBean. It listens for
threshold exceeded notifications and logs critical memory usage information.
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleNotification(@NotNull Notification notification, Object handback) Handles notifications related to memory usage thresholds.
-
Method Details
-
handleNotification
Handles notifications related to memory usage thresholds. It checks if the notification type indicates that a memory threshold has been exceeded. If so, it logs the current memory usage percentage and triggers the MemoryLeakDetector if the usage exceeds a predefined limit.- Specified by:
handleNotificationin interfaceNotificationListener- Parameters:
notification- the notification receivedhandback- an optional context object
-