com.google.common.collect
Interface MapEvictionListener<K,V>

Type Parameters:
K - the type of keys being evicted
V - the type of values being evicted

@Beta
public interface MapEvictionListener<K,V>

An object that can receive a notification when an entry is evicted from a map.

An instance may be called concurrently by multiple threads to process different entries. Implementations of this interface should avoid performing blocking calls or synchronizing on shared resources.

Since:
7
Author:
Ben Manes

Method Summary
 void onEviction(K key, V value)
          Notifies the listener that an eviction has occurred.
 

Method Detail

onEviction

void onEviction(@Nullable
                K key,
                @Nullable
                V value)
Notifies the listener that an eviction has occurred. Eviction may be for reasons such as timed expiration, exceeding a maximum size, or due to garbage collection. Eviction notification does not occur due to manual removal.

Parameters:
key - the key of the entry that has already been evicted, or null if its reference was collected
value - the value of the entry that has already been evicted, or null if its reference was collected