A tagging interface for cache entry listeners.
Sub-interfaces exist for the various cache events allowing a listener to be
created that implements only those listeners it is interested in.
Listeners should be implemented with care. In particular it is important to
consider their impact on performance and latency.
- are fired after the entry is mutated in the cache
- if synchronous are fired, for a given key, in the order that events
- block the calling thread until the listener returns,
where the listener was registered as synchronous
- that are asynchronous iterate through multiple events with an undefined
ordering, except that events on the same key are in the order that the
Listeners follow the observer pattern. An exception thrown by a
listener does not cause the cache operation to fail.
Listeners can only throw
implementations must catch any other
Exception from a listener, then
wrap and rethrow it as a
A listener that mutates a cache on the CacheManager may cause a deadlock.
Detection and response to deadlocks is implementation specific.