|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jcs.engine.memory.shrinking.ShrinkerThread<K,V>
public class ShrinkerThread<K extends Serializable,V extends Serializable>
A background memory shrinker. Memory problems and concurrent modification exception caused by acting directly on an iterator of the underlying memory cache should have been solved.
| Constructor Summary | |
|---|---|
ShrinkerThread(IMemoryCache<K,V> cache)
Constructor for the ShrinkerThread object. |
|
| Method Summary | |
|---|---|
protected boolean |
checkForRemoval(ICacheElement<?,?> cacheElement,
long now)
Check if either lifetime or idletime has expired for the provided event, and remove it from the cache if so. |
void |
run()
Main processing method for the ShrinkerThread object |
protected void |
shrink()
This method is called when the thread wakes up. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShrinkerThread(IMemoryCache<K,V> cache)
cache - The MemoryCache which the new shrinker should watch.| Method Detail |
|---|
public void run()
run in interface Runnableprotected void shrink()
protected boolean checkForRemoval(ICacheElement<?,?> cacheElement,
long now)
throws IOException
cacheElement - Element to check for expirationnow - Time to consider expirations relative to. This makes it easier to test.
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||