|
||||||||||
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.lru.LHMLRUMemoryCache
public class LHMLRUMemoryCache
This is a test memory manager using the jdk1.4 LinkedHashMap.
Nested Class Summary | |
---|---|
class |
LHMLRUMemoryCache.LHMSpooler
Implementation of removeEldestEntry in LinkedHashMap |
Field Summary | |
---|---|
protected int |
hitCnt
number of hits |
protected int |
missCnt
number of misses |
protected int |
putCnt
number of puts |
Fields inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache |
---|
cache, cacheAttributes, cacheName, chunkSize, elementAttributes, map, status |
Constructor Summary | |
---|---|
LHMLRUMemoryCache()
|
Method Summary | |
---|---|
Map |
createMap()
Returns a synchronized LHMSpooler |
void |
dumpCacheEntries()
Dump the cache entries from first to last for debugging. |
void |
dumpMap()
Dump the cache map for debugging. |
int |
freeElements(int numberToFree)
This can't be implemented. |
ICacheElement |
get(Serializable key)
Get an item from the cache |
Object[] |
getKeyArray()
Get an Array of the keys for all elements in the memory cache |
ICacheElement |
getQuiet(Serializable key)
Get an item from the cache without affecting its last access time or position. |
IStats |
getStatistics()
This returns semi-structured information on the memory cache, such as the size, put count, hit count, and miss count. |
void |
initialize(CompositeCache hub)
For post reflection creation initialization |
boolean |
remove(Serializable key)
Removes an item from the cache. |
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, getMultiple, getSize, getStatus, removeAll, setCacheAttributes, waterfal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int hitCnt
protected int missCnt
protected int putCnt
Constructor Detail |
---|
public LHMLRUMemoryCache()
Method Detail |
---|
public void initialize(CompositeCache hub)
initialize
in interface IMemoryCache
initialize
in class AbstractMemoryCache
hub
- public Map createMap()
createMap
in class AbstractMemoryCache
public void update(ICacheElement ce) throws IOException
update
in interface IMemoryCache
update
in class AbstractMemoryCache
ce
- Description of the Parameter
IOException
public ICacheElement getQuiet(Serializable key) throws IOException
getQuiet
in interface IMemoryCache
getQuiet
in class AbstractMemoryCache
key
- Identifies item to find
IOException
public ICacheElement get(Serializable key) throws IOException
get
in interface IMemoryCache
get
in class AbstractMemoryCache
key
- Identifies item to find
IOException
public boolean remove(Serializable key) throws IOException
remove
in interface IMemoryCache
remove
in class AbstractMemoryCache
key
-
IOException
public Object[] getKeyArray()
getKeyArray
in interface IMemoryCache
getKeyArray
in class AbstractMemoryCache
public IStats getStatistics()
getStatistics
in interface IMemoryCache
getStatistics
in class AbstractMemoryCache
public void dumpMap()
public void dumpCacheEntries()
public int freeElements(int numberToFree) throws IOException
numberToFree
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |