org.apache.cocoon.components.store.impl
Class EHDefaultStore
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.store.impl.EHDefaultStore
- All Implemented Interfaces:
- Component, Contextualizable, Disposable, Initializable, LogEnabled, Parameterizable, Serviceable, Store, ThreadSafe
- public class EHDefaultStore
- extends AbstractLogEnabled
- implements Store, Contextualizable, Serviceable, Parameterizable, Initializable, Disposable, ThreadSafe
Store implementation based on EHCache.
(http://ehcache.sourceforge.net/)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EHDefaultStore
public EHDefaultStore()
contextualize
public void contextualize(Context context)
throws ContextException
- Specified by:
contextualize in interface Contextualizable
- Throws:
ContextException
service
public void service(ServiceManager aManager)
throws ServiceException
- Specified by:
service in interface Serviceable
- Throws:
ServiceException
parameterize
public void parameterize(Parameters parameters)
throws ParameterException
- Configure the store. The following options can be used:
maxobjects (10000) - The maximum number of in-memory objects.
overflow-to-disk (true) - Whether to spool elements to disk after
maxobjects has been exceeded.
use-cache-directory (false) - If true the cache-directory
context entry will be used as the location of the disk store.
Within the servlet environment this is set in web.xml.
use-work-directory (false) - If true the work-directory
context entry will be used as the location of the disk store.
Within the servlet environment this is set in web.xml.
directory - Specify an alternative location of the disk store.
- Specified by:
parameterize in interface Parameterizable
- Throws:
ParameterException
initialize
public void initialize()
throws Exception
- Initialize the CacheManager and created the Cache.
- Specified by:
initialize in interface Initializable
- Throws:
Exception
dispose
public void dispose()
- Shutdown the CacheManager.
- Specified by:
dispose in interface Disposable
get
public Object get(Object key)
- Specified by:
get in interface Store
store
public void store(Object key,
Object value)
throws IOException
- Specified by:
store in interface Store
- Throws:
IOException
free
public void free()
- Specified by:
free in interface Store
remove
public void remove(Object key)
- Specified by:
remove in interface Store
clear
public void clear()
- Specified by:
clear in interface Store
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Store
keys
public Enumeration keys()
- Specified by:
keys in interface Store
size
public int size()
- Specified by:
size in interface Store
Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.