Class MRUMemoryCache<K,V>
java.lang.Object
org.apache.commons.jcs3.engine.memory.AbstractMemoryCache<K,V>
org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache<K,V>
org.apache.commons.jcs3.engine.memory.mru.MRUMemoryCache<K,V>
- All Implemented Interfaces:
IMemoryCache<K,
V>
The most recently used items move to the front of the list and get spooled to disk if the cache
hub is configured to use a disk cache.
-
Field Summary
Fields inherited from class org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache
list
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Makes the item the last in the list.protected MemoryElementDescriptor<K,
V> Adds the item to the front of the list.Methods inherited from class org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache
addFirst, addLast, createMap, freeElements, get, getStatistics, initialize, lockedGetElement, lockedRemoveAll, lockedRemoveElement, update
Methods inherited from class org.apache.commons.jcs3.engine.memory.AbstractMemoryCache
dispose, dumpMap, getCacheAttributes, getCacheName, getCompositeCache, getKeySet, getMultiple, getQuiet, getSize, remove, removeAll, removeByGroup, removeByHierarchy, setCacheAttributes, waterfal
-
Constructor Details
-
MRUMemoryCache
public MRUMemoryCache()
-
-
Method Details
-
adjustListForUpdate
protected MemoryElementDescriptor<K,V> adjustListForUpdate(ICacheElement<K, V> ce) throws IOExceptionAdds the item to the front of the list. A put doesn't count as a usage.It's not clear if the put operation should be different. Perhaps this should remove the oldest if full, and then put.
- Specified by:
adjustListForUpdate
in classAbstractDoubleLinkedListMemoryCache<K,
V> - Parameters:
ce
-- Returns:
- MemoryElementDescriptor the new node
- Throws:
IOException
-
adjustListForGet
Makes the item the last in the list.- Specified by:
adjustListForGet
in classAbstractDoubleLinkedListMemoryCache<K,
V> - Parameters:
me
-
-