Interface EvictionFilter<K,​V>

  • All Superinterfaces:
    Serializable

    public interface EvictionFilter<K,​V>
    extends Serializable
    Eviction filter to specify which entries should not be evicted. Not applicable when calling explicit evict via EvictableEntry.evict(). If evictAllowed(Cache.Entry) method returns false then eviction policy will not be notified and entry will never be evicted.

    Eviction filter can be configured via CacheConfiguration.getEvictionFilter() configuration property. Default value is null which means that all cache entries will be tracked by eviction policy.

    • Method Detail

      • evictAllowed

        boolean evictAllowed​(javax.cache.Cache.Entry<K,​V> entry)
        Checks if entry may be evicted from cache.
        Parameters:
        entry - Cache entry.
        Returns:
        True if it is allowed to evict this entry.