| org.apache.cocoon.components.store.StoreJanitorImpl
StoreJanitorImpl | public class StoreJanitorImpl extends AbstractLogEnabled implements StoreJanitor,Configurable,ThreadSafe,Runnable,Startable(Code) | | This class is a implentation of a StoreJanitor. Store classes
can register to the StoreJanitor. When memory is too low,
the StoreJanitor frees the registered caches until memory is normal.
author: Christian Schmitt author: Gerhard Froehlich author: Peter Royal version: CVS $Id: StoreJanitorImpl.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public void | configure(Configuration conf) Initialize the StoreJanitorImpl.
A few options can be used :
- freememory = how many bytes shall be always free in the jvm
- heapsize = max.
| public Iterator | iterator() This method return a java.util.Iterator of every registered stores
The iterators returned is fail-fast: if list is structurally
modified at any time after the iterator is created, in any way, the
iterator will throw a ConcurrentModificationException. | public void | register(Store store) | public void | run() The "checker" thread checks if memory is running low in the jvm. | public void | start() | public void | stop() | public void | unregister(Store store) |
configure | public void configure(Configuration conf) throws ConfigurationException(Code) | | Initialize the StoreJanitorImpl.
A few options can be used :
- freememory = how many bytes shall be always free in the jvm
- heapsize = max. size of jvm memory consumption
- cleanupthreadinterval = how often (sec) shall run the cleanup thread
- threadpriority = priority of the thread (1-10). (Default: 10)
Parameters: conf - the Configuration of the application exception: ConfigurationException - |
iterator | public Iterator iterator()(Code) | | This method return a java.util.Iterator of every registered stores
The iterators returned is fail-fast: if list is structurally
modified at any time after the iterator is created, in any way, the
iterator will throw a ConcurrentModificationException. Thus, in the
face of concurrent modification, the iterator fails quickly and
cleanly, rather than risking arbitrary, non-deterministic behavior at
an undetermined time in the future.
a java.util.Iterator |
register | public void register(Store store)(Code) | | This method register the stores
Parameters: store - the store to be registered |
run | public void run()(Code) | | The "checker" thread checks if memory is running low in the jvm.
|
start | public void start()(Code) | | |
unregister | public void unregister(Store store)(Code) | | This method unregister the stores
Parameters: store - the store to be unregistered |
|
|