K
- The type for the cache key entriesV
- The type for the cache value entriespublic class OgnlDefaultCache<K,V> extends Object implements OgnlCache<K,V>
Basic OGNL cache implementation.
This implementation is backed by a ConcurrentHashMap
that is cleared whenever the eviction limit is
surpassed.
Setting a very high eviction limit simulates an unlimited cache.
Setting too low an eviction limit will make the cache ineffective.
Constructor and Description |
---|
OgnlDefaultCache(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 OgnlDefaultCache(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.