Class PoolListener

java.lang.Object
host.anzo.commons.emergency.memory.watchers.PoolListener
All Implemented Interfaces:
EventListener, NotificationListener

public class PoolListener extends Object implements 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 Details

    • handleNotification

      public void handleNotification(@NotNull @NotNull Notification notification, Object handback)
      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:
      handleNotification in interface NotificationListener
      Parameters:
      notification - the notification received
      handback - an optional context object