Class Async.AsyncRemovalListener<K,V>

java.lang.Object
com.github.benmanes.caffeine.cache.Async.AsyncRemovalListener<K,V>
All Implemented Interfaces:
RemovalListener<K,CompletableFuture<V>>, Serializable
Enclosing class:
Async

static final class Async.AsyncRemovalListener<K,V> extends Object implements RemovalListener<K,CompletableFuture<V>>, Serializable
A removal listener that asynchronously forwards the value stored in a CompletableFuture if successful to the user-supplied removal listener.
  • Field Details

  • Constructor Details

  • Method Details

    • onRemoval

      public void onRemoval(@Nullable K key, @Nullable CompletableFuture<V> future, RemovalCause cause)
      Description copied from interface: RemovalListener
      Notifies the listener that a removal occurred at some point in the past.

      This does not always signify that the key is now absent from the cache, as it may have already been re-added.

      Specified by:
      onRemoval in interface RemovalListener<K,V>
      Parameters:
      key - the key represented by this entry, or null if collected
      future - the value represented by this entry, or null if collected
      cause - the reason for which the entry was removed
    • writeReplace

      Object writeReplace()