org.ehcache.impl.events
Class CacheEventAdapter<K,V>

java.lang.Object
  extended by org.ehcache.impl.events.CacheEventAdapter<K,V>
Type Parameters:
K - the type of the keys from the cache
V - the type of the values from the cache
All Implemented Interfaces:
CacheEventListener<K,V>

public abstract class CacheEventAdapter<K,V>
extends java.lang.Object
implements CacheEventListener<K,V>

Adapter for cache event listener implementation that splits the event based on its type to specific methods. This class by default provides only empty methods.


Constructor Summary
CacheEventAdapter()
           
 
Method Summary
protected  void onCreation(K key, V newValue)
           
 void onEvent(CacheEvent<K,V> event)
          Invoked on any CacheEvent matching the EventType constrain used when the listener was registered.
protected  void onEviction(K key, V evictedValue)
           
protected  void onExpiry(K key, V expiredValue)
           
protected  void onRemoval(K key, V removedValue)
           
protected  void onUpdate(K key, V oldValue, V newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheEventAdapter

public CacheEventAdapter()
Method Detail

onEvent

public final void onEvent(CacheEvent<K,V> event)
Description copied from interface: CacheEventListener
Invoked on any CacheEvent matching the EventType constrain used when the listener was registered. This method is invoked according to the EventOrdering and EventFiring requirement desired at registration time.

Specified by:
onEvent in interface CacheEventListener<K,V>
Parameters:
event - the actual CacheEvent

onEviction

protected void onEviction(K key,
                          V evictedValue)

onExpiry

protected void onExpiry(K key,
                        V expiredValue)

onRemoval

protected void onRemoval(K key,
                         V removedValue)

onUpdate

protected void onUpdate(K key,
                        V oldValue,
                        V newValue)

onCreation

protected void onCreation(K key,
                          V newValue)