K
- the type of the keys from the cacheV
- the type of the values from the cachepublic abstract class CacheEventAdapter<K,V> extends java.lang.Object implements CacheEventListener<K,V>
Constructor and Description |
---|
CacheEventAdapter() |
Modifier and Type | Method and Description |
---|---|
protected void |
onCreation(K key,
V newValue)
Invoked when a
CacheEvent for a creation is received. |
void |
onEvent(CacheEvent<? extends K,? extends V> event)
Invoked on
CacheEvent firing. |
protected void |
onEviction(K key,
V evictedValue)
Invoked when a
CacheEvent for an eviction is received. |
protected void |
onExpiry(K key,
V expiredValue)
Invoked when a
CacheEvent for an expiration is received. |
protected void |
onRemoval(K key,
V removedValue)
Invoked when a
CacheEvent for a removal is received. |
protected void |
onUpdate(K key,
V oldValue,
V newValue)
Invoked when a
CacheEvent for an update is received. |
public final void onEvent(CacheEvent<? extends K,? extends V> event)
CacheEvent
firing.
This method is invoked according to the EventOrdering
, EventFiring
and
EventType
requirements provided at listener registration time.
Any exception thrown from this listener will be swallowed and logged but will not prevent other listeners to run.
onEvent
in interface CacheEventListener<K,V>
event
- the actual CacheEvent
protected void onEviction(K key, V evictedValue)
CacheEvent
for an eviction
is received.key
- the evicted keyevictedValue
- the evicted valueprotected void onExpiry(K key, V expiredValue)
CacheEvent
for an expiration
is received.key
- the expired keyexpiredValue
- the expired valueprotected void onRemoval(K key, V removedValue)
CacheEvent
for a removal
is received.key
- the removed keyremovedValue
- the removed valueprotected void onUpdate(K key, V oldValue, V newValue)
CacheEvent
for an update
is received.key
- the updated keyoldValue
- the previous valuenewValue
- the updated valueprotected void onCreation(K key, V newValue)
CacheEvent
for a creation
is received.key
- the created keynewValue
- the created value