|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.engine.memory.AbstractMemoryCache
org.apache.jcs.engine.memory.mru.MRUMemoryCache
public class MRUMemoryCache
A SLOW reference management system. 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.
This class is mainly for testing the hub. It also shows that use of the Collection LinkedList is far slower than JCS' own double linked list.
Field Summary |
---|
Fields inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache |
---|
attr, cache, cacheName, cattr, chunkSize, map, status |
Constructor Summary | |
---|---|
MRUMemoryCache()
|
Method Summary | |
---|---|
void |
dumpCacheEntries()
Dump the cache entries from first to list for debugging. |
void |
dumpMap()
Dump the cache map for debugging. |
int |
freeElements(int numberToFree)
This instructs the memory cache to remove the numberToFree according to its eviction policy. |
ICacheElement |
get(java.io.Serializable key)
Gets an item out of the map. |
java.lang.Object[] |
getKeyArray()
Get an Array of the keys for all elements in the memory cache |
ICacheElement |
getQuiet(java.io.Serializable key)
Get an item from the cache without affecting its last access time or position. |
IStats |
getStatistics()
Returns the historical and statistical data for a region's memory cache. |
void |
initialize(CompositeCache hub)
For post reflection creation initialization |
boolean |
remove(java.io.Serializable key)
Removes an item from the cache. |
protected ICacheElement |
spoolLastElement()
This removes the last elemement in the list. |
void |
update(ICacheElement ce)
Puts an item to the cache. |
Methods inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache |
---|
dispose, getCacheAttributes, getCacheName, getCompositeCache, getGroupKeys, getIterator, getSize, getStatus, removeAll, setCacheAttributes, waterfal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MRUMemoryCache()
Method Detail |
---|
public void initialize(CompositeCache hub)
initialize
in interface IMemoryCache
initialize
in class AbstractMemoryCache
hub
- public void update(ICacheElement ce) throws java.io.IOException
update
in interface IMemoryCache
update
in class AbstractMemoryCache
ce
-
java.io.IOException
protected ICacheElement spoolLastElement()
public int freeElements(int numberToFree) throws java.io.IOException
numberToFree
-
java.io.IOException
public ICacheElement getQuiet(java.io.Serializable key) throws java.io.IOException
getQuiet
in interface IMemoryCache
getQuiet
in class AbstractMemoryCache
key
- Identifies item to find
java.io.IOException
public ICacheElement get(java.io.Serializable key) throws java.io.IOException
get
in interface IMemoryCache
get
in class AbstractMemoryCache
key
-
java.io.IOException
public boolean remove(java.io.Serializable key) throws java.io.IOException
remove
in interface IMemoryCache
remove
in class AbstractMemoryCache
key
-
java.io.IOException
public java.lang.Object[] getKeyArray()
getKeyArray
in interface IMemoryCache
getKeyArray
in class AbstractMemoryCache
public void dumpMap()
public void dumpCacheEntries()
public IStats getStatistics()
IMemoryCache
getStatistics
in interface IMemoryCache
getStatistics
in class AbstractMemoryCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |