Package org.apache.struts2.ognl
Class OgnlCaffeineCache<K,V>
java.lang.Object
org.apache.struts2.ognl.OgnlCaffeineCache<K,V>
- Type Parameters:
K
- The type for the cache key entriesV
- The type for the cache value entries
- All Implemented Interfaces:
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:
- Quantity and complexity of actions
- Volume of requests
- Rate limits and attack potential/patterns
- Memory constraints
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
int
void
void
putIfAbsent
(K key, V value) void
setEvictionLimit
(int cacheEvictionLimit) int
size()
-
Constructor Details
-
OgnlCaffeineCache
public OgnlCaffeineCache(int evictionLimit, int initialCapacity)
-
-
Method Details
-
get
-
put
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceOgnlCache<K,
V>
-
size
public int size() -
clear
public void clear() -
getEvictionLimit
public int getEvictionLimit()- Specified by:
getEvictionLimit
in interfaceOgnlCache<K,
V>
-
setEvictionLimit
public void setEvictionLimit(int cacheEvictionLimit) - Specified by:
setEvictionLimit
in interfaceOgnlCache<K,
V>
-