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 entries
- V- 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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()intvoidvoidputIfAbsent(K key, V value) voidsetEvictionLimit(int cacheEvictionLimit) intsize()
- 
Constructor Details- 
OgnlCaffeineCachepublic OgnlCaffeineCache(int evictionLimit, int initialCapacity) 
 
- 
- 
Method Details- 
get
- 
put
- 
putIfAbsent- Specified by:
- putIfAbsentin interface- OgnlCache<K,- V> 
 
- 
sizepublic int size()
- 
clearpublic void clear()
- 
getEvictionLimitpublic int getEvictionLimit()- Specified by:
- getEvictionLimitin interface- OgnlCache<K,- V> 
 
- 
setEvictionLimitpublic void setEvictionLimit(int cacheEvictionLimit) - Specified by:
- setEvictionLimitin interface- OgnlCache<K,- V> 
 
 
-