public class EntryEvictionConfiguration extends HashMap<String,Object>
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);
Modifier and Type | Class and Description |
---|---|
static class |
EntryEvictionConfiguration.Algorithm
The ordering/storing algorithm used by the cache.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
static String |
CONFIGURATIONID
The key use to access eviction configuration in the
CacheConfiguration . |
static String |
TIMETOLIVE_ID |
Constructor and Description |
---|
EntryEvictionConfiguration() |
Modifier and Type | Method and Description |
---|---|
EntryEvictionConfiguration.Algorithm |
getAlgorithm() |
int |
getTimeToLive() |
void |
setAlgorithm(EntryEvictionConfiguration.Algorithm mode) |
void |
setTimeToLive(int timeToLive) |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public static final String CONFIGURATIONID
CacheConfiguration
.public static final String TIMETOLIVE_ID
getTimeToLive()
,
Constant Field Valuespublic void setAlgorithm(EntryEvictionConfiguration.Algorithm mode)
mode
- the ordering/storing algorithm used by the cache.public EntryEvictionConfiguration.Algorithm getAlgorithm()
public void setTimeToLive(int timeToLive)
timeToLive
- see getTimeToLive()
public int getTimeToLive()
Copyright © 2004–2022 XWiki. All rights reserved.