org.ehcache.core.spi.cache.events
Interface StoreEventFilter<K,V>
public interface StoreEventFilter<K,V>
Interface used to create Store event filters
acceptEvent
boolean acceptEvent(EventType type,
K key,
V oldValue,
V newValue)
- Checks if an event is accepted.
Depending on the event type, oldValue or newValue may be null.
EventType.CREATED events do not have an
old value, EventType.UPDATED events have both while all other events only have an old value.
- Parameters:
type - the event typekey - the key of the mapping on which the event occursoldValue - the old value, for UPDATED, EXPIRED, EVICTED and REMOVED eventsnewValue - the new value, for UPDATED and CREATED events
- Returns:
true if the event is accepted, false otherwise