public class LRUEvictionConfiguration extends EntryEvictionConfiguration
EntryEvictionConfiguration.Algorithm.NONE cache algorithm. Evicts the least recently used entry
when thresholds are hit.EntryEvictionConfiguration.AlgorithmAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static String |
LIFESPAN_ID |
static String |
MAXENTRIES_ID
The key to access the maximum entries the cache can contain.
|
CONFIGURATIONID, TIMETOLIVE_ID| Constructor and Description |
|---|
LRUEvictionConfiguration()
Create a new EntryEvictionConfiguration based on LRU algorithm.
|
LRUEvictionConfiguration(int maxEntries)
Create a new EntryEvictionConfiguration with given capacity, eviction will be based on LRU algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLifespan() |
int |
getMaxEntries() |
int |
getMaxIdle() |
void |
setLifespan(int lifespan) |
void |
setMaxEntries(int maxEntries) |
void |
setMaxIdle(int maxIdle) |
getAlgorithm, getTimeToLive, setAlgorithm, setTimeToLiveclear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, valuesequals, hashCode, toStringpublic static final String MAXENTRIES_ID
public static final String LIFESPAN_ID
getLifespan(),
Constant Field Valuespublic LRUEvictionConfiguration()
public LRUEvictionConfiguration(int maxEntries)
maxEntries - the maximum entries the cache can contain.public void setMaxEntries(int maxEntries)
maxEntries - the maximum entries the cache can contain.public int getMaxEntries()
public void setMaxIdle(int maxIdle)
maxIdle - the maximum time to live since the last time the value was used. In seconds.public int getMaxIdle()
public void setLifespan(int lifespan)
lifespan - the maximum time to live since the value has been cached. In seconds.public int getLifespan()
Copyright © 2004–2017 XWiki. All rights reserved.