org.xwiki.cache.eviction
Class EntryEvictionConfiguration
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.xwiki.cache.eviction.EntryEvictionConfiguration
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,Object>
- Direct Known Subclasses:
- LRUEvictionConfiguration
public class EntryEvictionConfiguration
- extends HashMap<String,Object>
This configuration class is used to add constraints in the configuration of the cache to create.
CacheFactory factory = (CacheFactory) getComponentManager().lookup(CacheFactory.class, this.roleHint);
CacheConfiguration conf = new CacheConfiguration();
LRUEvictionConfiguration lec = new LRUEvictionConfiguration();
lec.setMaxEntries(1);
conf.put(LRUEvictionConfiguration.CONFIGURATIONID, lec);
- See Also:
- Serialized Form
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
CONFIGURATIONID
public static final String CONFIGURATIONID
- The key use to access eviction configuration in the
CacheConfiguration
.
- See Also:
- Constant Field Values
TIMETOLIVE_ID
public static final String TIMETOLIVE_ID
- The key used to access time to live duration in the
EntryEvictionConfiguration
.
- See Also:
- Constant Field Values
EntryEvictionConfiguration
public EntryEvictionConfiguration()
setAlgorithm
public void setAlgorithm(EntryEvictionConfiguration.Algorithm mode)
- Parameters:
mode
- the ordering/storing algorithm used by the cache.
getAlgorithm
public EntryEvictionConfiguration.Algorithm getAlgorithm()
- Returns:
- the ordering/storing algorithm used by the cache.
setTimeToLive
public void setTimeToLive(int timeToLive)
- Parameters:
timeToLive
- the maximum time to live in seconds of a cache entry.
getTimeToLive
public int getTimeToLive()
- Returns:
- the maximum time to live in seconds of a cache entry.