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 Summary
FieldsModifier and TypeFieldDescriptionprivate final EventDispatcher
<K, V> private final JCacheStatisticsMXBean
-
Constructor Summary
ConstructorsConstructorDescriptionJCacheEvictionListener
(EventDispatcher<K, V> dispatcher, JCacheStatisticsMXBean statistics) -
Method Summary
-
Field Details
-
statistics
-
dispatcher
-
cache
-
-
Constructor Details
-
JCacheEvictionListener
-
-
Method Details
-
setCache
Sets the cache instance that was created with this listener.- Parameters:
cache
- the cache that uses this loader
-
onRemoval
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 interfaceRemovalListener<K,
V> - Parameters:
key
- the key represented by this entry, ornull
if collectedexpirable
- the value represented by this entry, ornull
if collectedcause
- the reason for which the entry was removed
-