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
The key used to access time to live duration in the
EntryEvictionConfiguration. |
| 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, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCode, toStringpublic static final String CONFIGURATIONID
CacheConfiguration.public static final String TIMETOLIVE_ID
EntryEvictionConfiguration.public void setAlgorithm(EntryEvictionConfiguration.Algorithm mode)
mode - the ordering/storing algorithm used by the cache.public EntryEvictionConfiguration.Algorithm getAlgorithm()
public void setTimeToLive(int timeToLive)
timeToLive - the maximum time to live in seconds of a cache entry.public int getTimeToLive()
Copyright © 2004–2014 XWiki. All rights reserved.