K
- The type for the cache key entriesV
- The type for the cache value entriespublic class OgnlCaffeineCache<K,V> extends Object implements OgnlCache<K,V>
This OGNL Cache implementation is backed by Caffeine
which uses the Window TinyLfu algorithm.
An appropriate eviction limit should be chosen for your specific application based on factors and requirements such as:
Constructor and Description |
---|
OgnlCaffeineCache(int evictionLimit,
int initialCapacity) |
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 OgnlCaffeineCache(int evictionLimit, int initialCapacity)
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.