public class LRUEvictionConfiguration extends EntryEvictionConfiguration
EntryEvictionConfiguration.Algorithm.NONE
cache algorithm. Evicts the least recently used entry
when thresholds are hit.EntryEvictionConfiguration.Algorithm
AbstractMap.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, setTimeToLive
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 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
- see getMaxEntries()
public int getMaxEntries()
public void setMaxIdle(int maxIdle)
maxIdle
- see getMaxIdle()
public int getMaxIdle()
public void setLifespan(int lifespan)
lifespan
- see getLifespan()
public int getLifespan()
Copyright © 2004–2022 XWiki. All rights reserved.