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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()intvoidvoidputIfAbsent(K key, V value) voidsetEvictionLimit(int cacheEvictionLimit) intsize()
-
Constructor Details
-
OgnlCaffeineCache
public OgnlCaffeineCache(int evictionLimit, int initialCapacity)
-
-
Method Details
-
get
-
put
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceOgnlCache<K,V>
-
size
public int size() -
clear
public void clear() -
getEvictionLimit
public int getEvictionLimit()- Specified by:
getEvictionLimitin interfaceOgnlCache<K,V>
-
setEvictionLimit
public void setEvictionLimit(int cacheEvictionLimit) - Specified by:
setEvictionLimitin interfaceOgnlCache<K,V>
-