| |
|
| java.lang.Object java.lang.Thread com.jcorporate.expresso.core.registry.ExpressoThread com.jcorporate.expresso.core.cache.CacheCleaner
CacheCleaner | public class CacheCleaner extends ExpressoThread (Code) | | This thread is initialized by CacheManager and slowly iterates through the
Caches clearing out expired items. It often is given a lower thread priority
so it doesn't take away from the app server during high use times.
By using this thread, we save significant memory by removing expired items before
they are accessed again.
Typical Usage:
CacheCleaner cacheCleaner = new CacheCleaner();
cacheCleaner.registerCacheSystem(defaultContextCacheSystem);
cacheCleaner.start();
.....
.....
//To shut down. May take a while.
cacheCleaner.interrupt();
cacheCleaner.join();
author: Michael Rimov |
Method Summary | |
public void | interrupt() | public void | registerCacheSystem(CacheSystem newCache) Register a cache system for iteration. | public void | run() The cache cleaner run method iterates through all the cache systems installed
in the system and forces the removal of any items that have expired. |
CacheCleaner | protected CacheCleaner()(Code) | | |
interrupt | public void interrupt()(Code) | | |
registerCacheSystem | public void registerCacheSystem(CacheSystem newCache)(Code) | | Register a cache system for iteration. During a pass of the cache,
the CacheCleaner will iterate all registered CacheSystems
Parameters: newCache - the CacheSystem instance to be cleaning. |
run | public void run()(Code) | | The cache cleaner run method iterates through all the cache systems installed
in the system and forces the removal of any items that have expired. It
automatically runs every 30 seconds.
|
|
|
|