
org.infinispan.eviction.EvictionManager Maven / Gradle / Ivy
package org.infinispan.eviction;
import java.util.Map;
import net.jcip.annotations.ThreadSafe;
import org.infinispan.container.entries.InternalCacheEntry;
import org.infinispan.factories.scopes.Scope;
import org.infinispan.factories.scopes.Scopes;
/**
* Central component that deals with eviction of cache entries.
*
* Typically, {@link #processEviction()} is called periodically by the eviction thread (which can be configured using
* {@link org.infinispan.config.FluentConfiguration.ExpirationConfig#wakeUpInterval(Long)} and {@link org.infinispan.config.GlobalConfiguration#setEvictionScheduledExecutorFactoryClass(String)}).
*
* If the eviction thread is disabled - by setting {@link org.infinispan.config.FluentConfiguration.ExpirationConfig#wakeUpInterval(Long)} to 0 -
* then this method could be called directly, perhaps by any other maintenance thread that runs periodically in the application.
*
* Note that this method is a no-op if the eviction strategy configured is {@link org.infinispan.eviction.EvictionStrategy#NONE}.
*
* @author Manik Surtani
* @since 4.0
*/
@ThreadSafe
@Scope(Scopes.NAMED_CACHE)
public interface EvictionManager {
/**
* Processes the eviction event queue.
*/
void processEviction();
/**
* @return true if eviction is enabled, false otherwise
*/
boolean isEnabled();
void onEntryEviction(Map extends K, InternalCacheEntry extends K, ? extends V>> evicted);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy