org.ehcache.event
Interface CacheEvent<K,V>

Type Parameters:
K - the type of the keys used to access data within the cache
V - the type of the values held within the cache

public interface CacheEvent<K,V>

An event resulting from a mutative Cache operation.


Method Summary
 K getKey()
          The key of the mapping affected by the mutative event
 V getNewValue()
          The mapped value immediately after the mutative event occurred.
 V getOldValue()
          The mapped value immediately before the mutative event occurred.
 Cache<K,V> getSource()
          Deprecated. 
 EventType getType()
          The type of mutative event
 

Method Detail

getType

EventType getType()
The type of mutative event

Returns:
the @{link EventType}

getKey

K getKey()
The key of the mapping affected by the mutative event

Returns:
the mutated key

getNewValue

V getNewValue()
The mapped value immediately after the mutative event occurred.

If the mutative event removes the mapping then null is returned.

Returns:
the mapped value after the mutation

getOldValue

V getOldValue()
The mapped value immediately before the mutative event occurred.

If the mutative event created the mapping then null is returned.

Returns:
the mapped value before the mutation

getSource

@Deprecated
Cache<K,V> getSource()
Deprecated. 

The cache originating this event

Don't ever call back into this cache to perform any further operations!

Returns:
the cache you should only use to identify the source, not to use it!