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>

public class OgnlLRUCache<K,V> extends Object implements 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 Details

    • OgnlLRUCache

      public OgnlLRUCache(int evictionLimit, int initialCapacity, float loadFactor)
  • Method Details