Interface ClusteredCacheEntryListener<K,​V>

  • Type Parameters:
    K - Type of the key of the cache
    V - 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 Detail

      • entryAdded

        void entryAdded​(@Nonnull
                        K key,
                        @Nullable
                        V newValue,
                        @Nonnull
                        NodeID nodeID)
        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

        void entryRemoved​(@Nonnull
                          K key,
                          @Nullable
                          V oldValue,
                          @Nonnull
                          NodeID nodeID)
        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

        void entryEvicted​(@Nonnull
                          K key,
                          @Nullable
                          V oldValue,
                          @Nonnull
                          NodeID nodeID)
        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

        void mapCleared​(@Nonnull
                        NodeID nodeID)
        The cache was cleared.
        Parameters:
        nodeID - identifier of the node on which the cache modification occurred.
      • mapEvicted

        void mapEvicted​(@Nonnull
                        NodeID nodeID)
        The cache was evicted.
        Parameters:
        nodeID - identifier of the node on which the cache modification occurred.