K
- The type for the cache key entriesV
- The type for the cache value entriespublic class OgnlLRUCache<K,V> extends Object implements OgnlCache<K,V>
A basic OGNL LRU cache implementation.
The implementation utilizes a Collections.synchronizedMap(java.util.Map)
backed by a LinkedHashMap
. May be replaced by a more efficient implementation in the future.
Setting too low an eviction limit will produce more overhead than value.
Setting too high an eviction limit may also produce more overhead than value.
An appropriate eviction limit will need to be determined on an individual application basis.
Constructor and Description |
---|
OgnlLRUCache(int evictionLimit,
int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
get(K key) |
int |
getEvictionLimit() |
void |
put(K key,
V value) |
void |
putIfAbsent(K key,
V value) |
void |
setEvictionLimit(int cacheEvictionLimit) |
int |
size() |
public OgnlLRUCache(int evictionLimit, int initialCapacity, float loadFactor)
public void putIfAbsent(K key, V value)
putIfAbsent
in interface OgnlCache<K,V>
public int getEvictionLimit()
getEvictionLimit
in interface OgnlCache<K,V>
public void setEvictionLimit(int cacheEvictionLimit)
setEvictionLimit
in interface OgnlCache<K,V>
Copyright © 2000–2024 Apache Software Foundation. All rights reserved.