Interface EvictionListener<K,V>

All Known Implementing Classes:
SharedBoundedContainer, SharedBoundedLocalContainer

public interface EvictionListener<K,V>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEntryChosenForEviction(boolean pre, K key, InternalCacheEntry<K,V> value)
    Method invoked every time an entry is evicted from the cache along with its key.
  • Method Details

    • onEntryChosenForEviction

      void onEntryChosenForEviction(boolean pre, K key, InternalCacheEntry<K,V> value)
      Method invoked every time an entry is evicted from the cache along with its key. Note that when the pre value is true the entry is still in the cache and the lock is held for this entry. When invoked with pre being false is after the fact without the lock held. If any exception is thrown during this invocation it is not deterministic if it will stop the operation and may only be logged.
      Parameters:
      pre - Whether this is just before the eviction completes or not.
      key - The key tied the removed entry
      value - The entry that is removed due to eviction