Package org.axonframework.common.caching
Interface Cache.EntryListener
- All Known Implementing Classes:
Cache.EntryListenerAdapter
- Enclosing interface:
Cache
public static interface Cache.EntryListener
Interface describing callback methods, which are invoked when changes are made in the underlying cache.
-
Method Summary
Modifier and TypeMethodDescriptionclone()Clone operation used by some Cache implementations.voidonEntryCreated(Object key, Object value) Invoked when a new item has been added to the cachevoidonEntryExpired(Object key) Invoked when an entry has expired.voidonEntryRead(Object key, Object value) Invoked when an item was retrieved from the CachevoidonEntryRemoved(Object key) Invoked when an item was removed from the cache, either following an expiry, or by explicitly callingCache.remove(Object).voidonEntryUpdated(Object key, Object value) Invoked when an item has been updated.
-
Method Details
-
onEntryExpired
Invoked when an entry has expired.- Parameters:
key- The key of the entry that expired
-
onEntryRemoved
Invoked when an item was removed from the cache, either following an expiry, or by explicitly callingCache.remove(Object).- Parameters:
key- The key of the entry that was removed
-
onEntryUpdated
Invoked when an item has been updated.- Parameters:
key- The key of the entry that was updatedvalue- The new value of the entry
-
onEntryCreated
Invoked when a new item has been added to the cache- Parameters:
key- The key of the entry that was addedvalue- The value of the entry
-
onEntryRead
Invoked when an item was retrieved from the Cache- Parameters:
key- The key of the entry that was readvalue- The value of the entry read
-
clone
Clone operation used by some Cache implementations. An implementation must implementCloneableto indicate it supports cloning.- Returns:
- a copy of this instance
- Throws:
CloneNotSupportedException- if cloning is not supported- See Also:
-