Class EvictionListener<K,​V>

  • All Implemented Interfaces:
    com.github.benmanes.caffeine.cache.RemovalListener<K,​org.infinispan.client.hotrod.MetadataValue<V>>, Consumer<com.github.benmanes.caffeine.cache.Cache<K,​org.infinispan.client.hotrod.MetadataValue<V>>>

    public class EvictionListener<K,​V>
    extends Object
    implements com.github.benmanes.caffeine.cache.RemovalListener<K,​org.infinispan.client.hotrod.MetadataValue<V>>, Consumer<com.github.benmanes.caffeine.cache.Cache<K,​org.infinispan.client.hotrod.MetadataValue<V>>>
    Removal listener that triggers the specified listener when the removal cause is RemovalCause.SIZE.
    Author:
    Paul Ferraro
    • Constructor Detail

      • EvictionListener

        public EvictionListener​(BiConsumer<K,​org.infinispan.client.hotrod.MetadataValue<V>> defaultListener,
                                BiConsumer<com.github.benmanes.caffeine.cache.Cache<Object,​org.infinispan.client.hotrod.MetadataValue<Object>>,​Map.Entry<Object,​Object>> listener)
    • Method Detail

      • accept

        public void accept​(com.github.benmanes.caffeine.cache.Cache<K,​org.infinispan.client.hotrod.MetadataValue<V>> cache)
        Specified by:
        accept in interface Consumer<K>
      • onRemoval

        public void onRemoval​(K key,
                              org.infinispan.client.hotrod.MetadataValue<V> value,
                              com.github.benmanes.caffeine.cache.RemovalCause cause)
        Specified by:
        onRemoval in interface com.github.benmanes.caffeine.cache.RemovalListener<K,​V>