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 Summary
FieldsModifier and TypeFieldDescription(package private) final RemovalListener
<K, V> (package private) final Executor
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onRemoval
(@Nullable K key, @Nullable CompletableFuture<V> future, RemovalCause cause) Notifies the listener that a removal occurred at some point in the past.(package private) Object
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
executor
-
-
Constructor Details
-
AsyncRemovalListener
AsyncRemovalListener(RemovalListener<K, V> delegate, Executor executor)
-
-
Method Details
-
onRemoval
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 interfaceRemovalListener<K,
V> - Parameters:
key
- the key represented by this entry, ornull
if collectedfuture
- the value represented by this entry, ornull
if collectedcause
- the reason for which the entry was removed
-
writeReplace
Object writeReplace()
-