Class JCacheEvictionListener<K,V>

java.lang.Object
com.github.benmanes.caffeine.jcache.event.JCacheEvictionListener<K,V>
All Implemented Interfaces:
RemovalListener<K,Expirable<V>>

public final class JCacheEvictionListener<K,V> extends Object implements RemovalListener<K,Expirable<V>>
A listener that provides an adapter to publish events in the order of the actions being performed on a key.
  • Field Details

  • Constructor Details

  • Method Details

    • setCache

      public void setCache(javax.cache.Cache<K,V> cache)
      Sets the cache instance that was created with this listener.
      Parameters:
      cache - the cache that uses this loader
    • onRemoval

      public void onRemoval(K key, @Nullable Expirable<V> expirable, RemovalCause cause)
      Description copied from interface: RemovalListener
      Notifies the listener that a removal occurred at some point in the past.

      This does not always signify that the key is now absent from the cache, as it may have already been re-added.

      Specified by:
      onRemoval in interface RemovalListener<K,V>
      Parameters:
      key - the key represented by this entry, or null if collected
      expirable - the value represented by this entry, or null if collected
      cause - the reason for which the entry was removed