Class EvictionNotifier

java.lang.Object
com.loomcache.server.cache.EvictionNotifier

public class EvictionNotifier extends Object
Notifies listeners before and after eviction events. Supports pre-eviction veto mechanism.
  • Constructor Details

    • EvictionNotifier

      public EvictionNotifier()
  • Method Details

    • addListener

      public void addListener(EvictionNotifier.EvictionListener listener)
      Register an eviction listener.
    • removeListener

      public void removeListener(EvictionNotifier.EvictionListener listener)
      Unregister an eviction listener.
    • notifyPreEviction

      public boolean notifyPreEviction(EvictionNotifier.EvictionEvent event)
      Notify all listeners of a pre-eviction event. Returns false if any listener vetoes the eviction.
    • notifyPostEviction

      public void notifyPostEviction(EvictionNotifier.EvictionEvent event)
      Notify all listeners of a post-eviction event.
    • listenerCount

      public int listenerCount()
      Get the number of registered listeners.