Class EvictionNotifier
java.lang.Object
com.loomcache.server.cache.EvictionNotifier
Notifies listeners before and after eviction events.
Supports pre-eviction veto mechanism.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordEvent describing an eviction.static interfaceListener interface for eviction events.static enumReason for eviction. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(EvictionNotifier.EvictionListener listener) Register an eviction listener.intGet the number of registered listeners.voidNotify all listeners of a post-eviction event.booleanNotify all listeners of a pre-eviction event.voidUnregister an eviction listener.
-
Constructor Details
-
EvictionNotifier
public EvictionNotifier()
-
-
Method Details
-
addListener
Register an eviction listener. -
removeListener
Unregister an eviction listener. -
notifyPreEviction
Notify all listeners of a pre-eviction event. Returns false if any listener vetoes the eviction. -
notifyPostEviction
Notify all listeners of a post-eviction event. -
listenerCount
public int listenerCount()Get the number of registered listeners.
-