Package org.apache.struts2.ognl
Class OgnlDefaultCache<K,V> 
java.lang.Object
org.apache.struts2.ognl.OgnlDefaultCache<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> 
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()intvoidvoidputIfAbsent(K key, V value) voidsetEvictionLimit(int cacheEvictionLimit) intsize()
- 
Constructor Details- 
OgnlDefaultCachepublic OgnlDefaultCache(int evictionLimit, int initialCapacity, float loadFactor) 
 
- 
- 
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> 
 
 
-