Package org.apache.struts2.ognl
Class OgnlLRUCache<K,V> 
java.lang.Object
org.apache.struts2.ognl.OgnlLRUCache<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> 
A basic OGNL LRU cache implementation.
The implementation utilizes a Collections.synchronizedMap(java.util.Map)
 backed by a LinkedHashMap.  May be replaced by a more efficient implementation in the future.
Setting too low an eviction limit will produce more overhead than value.
Setting too high an eviction limit may also produce more overhead than value.
An appropriate eviction limit will need to be determined on an individual application basis.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()intvoidvoidputIfAbsent(K key, V value) voidsetEvictionLimit(int cacheEvictionLimit) intsize()
- 
Constructor Details- 
OgnlLRUCachepublic OgnlLRUCache(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> 
 
 
-