Interface ClusteredCacheEntryListener<K,V>
- Type Parameters:
K
- Type of the key of the cacheV
- Type of the value of the cache
- All Known Implementing Classes:
ReverseLookupComputingCacheEntryListener
,ReverseLookupUpdatingCacheEntryListener
public interface ClusteredCacheEntryListener<K,V>
An event listener for changes made to entries of a clustered cache.
Generally speaking, event listener invocation will always include the key value. For performance optimizations,
the value can be omitted. The behavior is configured when registering the listener with a cache.
An instance can be registered with a cache using
Cache.addClusteredCacheEntryListener(ClusteredCacheEntryListener, boolean, boolean)
Listeners are invoked in an asynchronous fashion. It is possible that invocations occur in a different order than in
which the cache was modified.-
Method Summary
Modifier and TypeMethodDescriptionvoid
entryAdded
(K key, V newValue, NodeID nodeID) An entry was added to the cache.void
entryEvicted
(K key, V oldValue, NodeID nodeID) An entry was evicted from the cache.void
entryRemoved
(K key, V oldValue, NodeID nodeID) An entry was removed from the cache.void
entryUpdated
(K key, V oldValue, V newValue, NodeID nodeID) An entry was updated in the cache.void
mapCleared
(NodeID nodeID) The cache was cleared.void
mapEvicted
(NodeID nodeID) The cache was evicted.
-
Method Details
-
entryAdded
An entry was added to the cache.- Parameters:
key
- The key of the entry that was added.newValue
- The (optional) value of the entry that was added.nodeID
- identifier of the node on which the cache modification occurred.
-
entryRemoved
An entry was removed from the cache.- Parameters:
key
- The key of the entry that was removed.oldValue
- The (optional) value of the entry that was removed.nodeID
- identifier of the node on which the cache modification occurred.
-
entryUpdated
void entryUpdated(@Nonnull K key, @Nullable V oldValue, @Nullable V newValue, @Nonnull NodeID nodeID) An entry was updated in the cache.- Parameters:
key
- The key of the entry that was changed.oldValue
- The (optional) value of the entry prior to the update.newValue
- The (optional) value of the entry after to the update.nodeID
- identifier of the node on which the cache modification occurred.
-
entryEvicted
An entry was evicted from the cache.- Parameters:
key
- The key of the entry that was evicted.oldValue
- The (optional) value of the entry that was removed.nodeID
- identifier of the node on which the cache modification occurred.
-
mapCleared
The cache was cleared.- Parameters:
nodeID
- identifier of the node on which the cache modification occurred.
-
mapEvicted
The cache was evicted.- Parameters:
nodeID
- identifier of the node on which the cache modification occurred.
-