Package javax.cache.event

This package contains event listener interfaces.

See:
          Description

Interface Summary
CacheEntryCreatedListener<K,V> Invoked if a cache entry is created, for example through a Cache.put(Object, Object) operation or the action of a CacheLoader.
CacheEntryExpiredListener<K,V> Invoked if a cache entry is evicted because of expiration.
CacheEntryListener<K,V> Tagging interface for cache entry listeners.
CacheEntryReadListener<K,V> Invoked if a cache entry is read, for example through a Cache.get(Object) call.
CacheEntryRemovedListener<K,V> Invoked if a cache entry is removed, for example through a Cache.remove(Object) call.
CacheEntryUpdatedListener<K,V> Invoked if an existing cache entry is updated, for example through a Cache.put(Object, Object) or a CacheLoader operation .
 

Class Summary
CacheEntryEvent<K,V> A Cache event base class
 

Exception Summary
CacheEntryListenerException An exception to indicate a problem has occurred with a listener.
 

Package javax.cache.event Description

This package contains event listener interfaces. These may be registered for callback notification of the cache events. The specific interface should be implemented for each event type a callback is desired on.

Event notifications occur synchronously in the line of execution of the calling thread. The calling thread blocks until the listener has completed execution or thrown a CacheEntryListenerException.

Listeners are invoked after the cache is updated. If the listener throws an CacheEntryListenerException this will propagate back to the caller but it does not affect the cache update as it already completed before the listener was called. If the cache is transactional, transactions must commit before listeners are called. If an exception is thrown by a listener this does not affect the transaction as the transaction has already completed.

Since:
1.0
Author:
Greg Luck, Yannis Cosmadopoulos


Copyright © 2012. All Rights Reserved.