|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.engine.memory.MockMemoryCache<K,V>
public class MockMemoryCache<K extends Serializable,V extends Serializable>
Mock implementation of a memory cache for testing things like the memory shrinker.
| Field Summary | |
|---|---|
int |
lastNumberOfFreedElements
The number passed to the last call of free elements. |
int |
waterfallCallCount
The number of times waterfall was called. |
| Constructor Summary | |
|---|---|
MockMemoryCache()
|
|
| Method Summary | |
|---|---|
void |
dispose()
Destroy the memory cache |
int |
freeElements(int numberToFree)
|
ICacheElement<K,V> |
get(K key)
|
ICompositeCacheAttributes |
getCacheAttributes()
|
CompositeCache<K,V> |
getCompositeCache()
|
Set<K> |
getGroupKeys(String group)
|
Set<String> |
getGroupNames()
|
Iterator<Map.Entry<K,MemoryElementDescriptor<K,V>>> |
getIterator()
|
Set<K> |
getKeySet()
|
Map<K,ICacheElement<K,V>> |
getMultiple(Set<K> keys)
|
ICacheElement<K,V> |
getQuiet(K key)
|
int |
getSize()
|
IStats |
getStatistics()
|
void |
initialize(CompositeCache<K,V> cache)
Does nothing |
boolean |
remove(K key)
|
void |
removeAll()
|
void |
setCacheAttributes(ICompositeCacheAttributes cattr)
|
void |
update(ICacheElement<K,V> ce)
|
void |
waterfal(ICacheElement<K,V> ce)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int waterfallCallCount
public int lastNumberOfFreedElements
| Constructor Detail |
|---|
public MockMemoryCache()
| Method Detail |
|---|
public void initialize(CompositeCache<K,V> cache)
initialize in interface IMemoryCache<K extends Serializable,V extends Serializable>cache -
public void dispose()
throws IOException
dispose in interface IMemoryCache<K extends Serializable,V extends Serializable>IOExceptionpublic int getSize()
getSize in interface IMemoryCache<K extends Serializable,V extends Serializable>public IStats getStatistics()
getStatistics in interface IMemoryCache<K extends Serializable,V extends Serializable>public Iterator<Map.Entry<K,MemoryElementDescriptor<K,V>>> getIterator()
getIterator in interface IMemoryCache<K extends Serializable,V extends Serializable>public Set<K> getKeySet()
getKeySet in interface IMemoryCache<K extends Serializable,V extends Serializable>
public boolean remove(K key)
throws IOException
remove in interface IMemoryCache<K extends Serializable,V extends Serializable>key -
IOException
public void removeAll()
throws IOException
removeAll in interface IMemoryCache<K extends Serializable,V extends Serializable>IOException
public ICacheElement<K,V> get(K key)
throws IOException
get in interface IMemoryCache<K extends Serializable,V extends Serializable>key -
IOException
public Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
throws IOException
getMultiple in interface IMemoryCache<K extends Serializable,V extends Serializable>keys -
IOException
public ICacheElement<K,V> getQuiet(K key)
throws IOException
getQuiet in interface IMemoryCache<K extends Serializable,V extends Serializable>key -
IOException
public void waterfal(ICacheElement<K,V> ce)
throws IOException
waterfal in interface IMemoryCache<K extends Serializable,V extends Serializable>ce -
IOException
public void update(ICacheElement<K,V> ce)
throws IOException
update in interface IMemoryCache<K extends Serializable,V extends Serializable>ce -
IOExceptionpublic ICompositeCacheAttributes getCacheAttributes()
getCacheAttributes in interface IMemoryCache<K extends Serializable,V extends Serializable>public void setCacheAttributes(ICompositeCacheAttributes cattr)
setCacheAttributes in interface IMemoryCache<K extends Serializable,V extends Serializable>cattr - public CompositeCache<K,V> getCompositeCache()
getCompositeCache in interface IMemoryCache<K extends Serializable,V extends Serializable>public Set<K> getGroupKeys(String group)
getGroupKeys in interface IMemoryCache<K extends Serializable,V extends Serializable>group -
public Set<String> getGroupNames()
getGroupNames in interface IMemoryCache<K extends Serializable,V extends Serializable>
public int freeElements(int numberToFree)
throws IOException
freeElements in interface IMemoryCache<K extends Serializable,V extends Serializable>numberToFree -
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||