Package javax.cache.event
Interface CacheEntryListener<K,V>
-
- Type Parameters:
K- the type of keys maintained by the associated cacheV- the type of values maintained by the associated cache
- All Superinterfaces:
EventListener
- All Known Subinterfaces:
CacheEntryCreatedListener<K,V>,CacheEntryExpiredListener<K,V>,CacheEntryReadListener<K,V>,CacheEntryRemovedListener<K,V>,CacheEntryUpdatedListener<K,V>
- All Known Implementing Classes:
ClusterCacheInvalidationRequestSender
public interface CacheEntryListener<K,V> extends EventListener
Tagging interface for cache entry listeners. Sub-interfaces exist for the various cache events allowing a listener to be created which implements only those listeners it is interested in. The motivation for this design is to allow efficient implementation of network based listeners. Listeners should be implemented with care. In particular it is important to consider the impact on performance and latency. A listener is a user supplied object instance and therefore can only be registered programmatically. The listeners are fired:- in order in which they were registered
- after the entry is mutated in the cache
- the calling thread blocks until the listener returns if the listener was registered as synchronous
- asynchronous listeners iterating through multiple events have undefined ordering
- Since:
- 1.0
- Author:
- Yannis Cosmadopoulos, Greg Luck
- See Also:
CacheEntryCreatedListener,CacheEntryUpdatedListener,CacheEntryReadListener,CacheEntryRemovedListener,CacheEntryExpiredListener