org.apache.jcs.engine.memory.mru
Class MRUMemoryCache

java.lang.Object
  extended by org.apache.jcs.engine.memory.AbstractMemoryCache
      extended by org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache
          extended by org.apache.jcs.engine.memory.mru.MRUMemoryCache
All Implemented Interfaces:
java.io.Serializable, IMemoryCache, MemoryCache

public class MRUMemoryCache
extends AbstractDoulbeLinkedListMemoryCache

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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache
AbstractDoulbeLinkedListMemoryCache.IteratorWrapper, AbstractDoulbeLinkedListMemoryCache.MapEntryWrapper
 
Field Summary
 
Fields inherited from class org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache
hitCnt, list, missCnt
 
Fields inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache
attr, cache, cacheName, cattr, chunkSize, map, status
 
Constructor Summary
MRUMemoryCache()
           
 
Method Summary
protected  void adjustListForGet(MemoryElementDescriptor me)
          Makes the item the last in the list.
protected  MemoryElementDescriptor adjustListForUpdate(ICacheElement ce)
          Adds the item to the front of the list.
 
Methods inherited from class org.apache.jcs.engine.memory.AbstractDoulbeLinkedListMemoryCache
addFirst, addLast, createMap, dumpCacheEntries, dumpCacheSize, dumpMap, freeElements, get, getIterator, getKeyArray, getStatistics, initialize, remove, removeAll, spoolLastElement, update, verifyCache
 
Methods inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache
dispose, getCacheAttributes, getCacheName, getCompositeCache, getGroupKeys, getMultiple, getQuiet, getSize, getStatus, setCacheAttributes, waterfal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRUMemoryCache

public MRUMemoryCache()
Method Detail

adjustListForUpdate

protected MemoryElementDescriptor adjustListForUpdate(ICacheElement ce)
                                               throws java.io.IOException
Adds the item to the front of the list. A put doesn't count as a usage.

It's not clear if the put operation sould be different. Perhaps this should remove the oldest if full, and then put.

Specified by:
adjustListForUpdate in class AbstractDoulbeLinkedListMemoryCache
Parameters:
ce -
Returns:
MemoryElementDescriptor the new node
Throws:
java.io.IOException

adjustListForGet

protected void adjustListForGet(MemoryElementDescriptor me)
Makes the item the last in the list.

Specified by:
adjustListForGet in class AbstractDoulbeLinkedListMemoryCache
Parameters:
me -


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.