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.
-
-
Constructor Summary
Constructors Constructor Description JCacheEvictionListener(EventDispatcher<K,V> dispatcher, JCacheStatisticsMXBean statistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonRemoval(K key, @Nullable Expirable<V> expirable, RemovalCause cause)voidsetCache(Cache<K,V> cache)Sets the cache instance that was created with this listener.
-
-
-
Constructor Detail
-
JCacheEvictionListener
public JCacheEvictionListener(EventDispatcher<K,V> dispatcher, JCacheStatisticsMXBean statistics)
-
-
Method Detail
-
setCache
public void setCache(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)
- Specified by:
onRemovalin interfaceRemovalListener<K,V>
-
-