Package org.infinispan.eviction
Enum EvictionStrategy
- java.lang.Object
-
- java.lang.Enum<EvictionStrategy>
-
- org.infinispan.eviction.EvictionStrategy
-
- All Implemented Interfaces:
Serializable
,Comparable<EvictionStrategy>
public enum EvictionStrategy extends Enum<EvictionStrategy>
Supported eviction strategies- Since:
- 4.0
- Author:
- Manik Surtani
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXCEPTION
Strategy where the cache will block new entries from being written if they would exceed the configured sizeMANUAL
Strategy where the cache does nothing but the user is assumed to manually invoke evict methodNONE
Eviction Strategy where nothing is done by the cache and the user is probably not going to use eviction manuallyREMOVE
Strategy where the cache will remove entries to make room for new ones while staying under the configured size
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEnabled()
Whether or not the cache will do something due to the strategyboolean
isExceptionBased()
The cache will throw exceptions to prevent memory growthboolean
isRemovalBased()
The cache will remove other entries to make room to limit memory growthstatic EvictionStrategy
valueOf(String name)
Returns the enum constant of this type with the specified name.static EvictionStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final EvictionStrategy NONE
Eviction Strategy where nothing is done by the cache and the user is probably not going to use eviction manually
-
MANUAL
public static final EvictionStrategy MANUAL
Strategy where the cache does nothing but the user is assumed to manually invoke evict method
-
REMOVE
public static final EvictionStrategy REMOVE
Strategy where the cache will remove entries to make room for new ones while staying under the configured size
-
EXCEPTION
public static final EvictionStrategy EXCEPTION
Strategy where the cache will block new entries from being written if they would exceed the configured size
-
-
Method Detail
-
values
public static EvictionStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EvictionStrategy c : EvictionStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EvictionStrategy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isEnabled
public boolean isEnabled()
Whether or not the cache will do something due to the strategy- Returns:
-
isExceptionBased
public boolean isExceptionBased()
The cache will throw exceptions to prevent memory growth- Returns:
-
isRemovalBased
public boolean isRemovalBased()
The cache will remove other entries to make room to limit memory growth- Returns:
-
-