|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.engine.memory.AbstractMemoryCache<K,V>
org.apache.jcs.engine.memory.lru.LHMLRUMemoryCache<K,V>
public class LHMLRUMemoryCache<K extends Serializable,V extends Serializable>
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 static org.apache.commons.logging.Log |
log
The Logger. |
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<K,MemoryElementDescriptor<K,V>> |
createMap()
Returns a synchronized LHMSpooler |
void |
dumpCacheEntries()
Dump the cache entries from first to last for debugging. |
int |
freeElements(int numberToFree)
This can't be implemented. |
ICacheElement<K,V> |
get(K key)
Get an item from the cache |
Set<K> |
getKeySet()
Get an Array of the keys for all elements in the memory cache |
ICacheElement<K,V> |
getQuiet(K 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<K,V> hub)
For post reflection creation initialization |
boolean |
remove(K key)
Removes an item from the cache. |
void |
update(ICacheElement<K,V> ce)
Puts an item to the cache. |
| Methods inherited from class org.apache.jcs.engine.memory.AbstractMemoryCache |
|---|
dispose, dumpMap, getCacheAttributes, getCacheName, getCompositeCache, getGroupKeys, getGroupNames, getIterator, getMultiple, getSize, getStatus, removeAll, setCacheAttributes, setScheduledExecutorService, waterfal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log log
protected int hitCnt
protected int missCnt
protected int putCnt
| Constructor Detail |
|---|
public LHMLRUMemoryCache()
| Method Detail |
|---|
public void initialize(CompositeCache<K,V> hub)
initialize in interface IMemoryCache<K extends Serializable,V extends Serializable>initialize in class AbstractMemoryCache<K extends Serializable,V extends Serializable>hub - public Map<K,MemoryElementDescriptor<K,V>> createMap()
createMap in class AbstractMemoryCache<K extends Serializable,V extends Serializable>
public void update(ICacheElement<K,V> ce)
throws IOException
update in interface IMemoryCache<K extends Serializable,V extends Serializable>update in class AbstractMemoryCache<K extends Serializable,V extends Serializable>ce - Description of the Parameter
IOException
public ICacheElement<K,V> getQuiet(K key)
throws IOException
getQuiet in interface IMemoryCache<K extends Serializable,V extends Serializable>getQuiet in class AbstractMemoryCache<K extends Serializable,V extends Serializable>key - Identifies item to find
IOException
public ICacheElement<K,V> get(K key)
throws IOException
get in interface IMemoryCache<K extends Serializable,V extends Serializable>get in class AbstractMemoryCache<K extends Serializable,V extends Serializable>key - Identifies item to find
IOException
public boolean remove(K key)
throws IOException
remove in interface IMemoryCache<K extends Serializable,V extends Serializable>remove in class AbstractMemoryCache<K extends Serializable,V extends Serializable>key -
IOExceptionpublic Set<K> getKeySet()
getKeySet in interface IMemoryCache<K extends Serializable,V extends Serializable>getKeySet in class AbstractMemoryCache<K extends Serializable,V extends Serializable>public IStats getStatistics()
getStatistics in interface IMemoryCache<K extends Serializable,V extends Serializable>getStatistics in class AbstractMemoryCache<K extends Serializable,V extends Serializable>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 | |||||||||