|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.store.impl.EHDefaultStore
public class EHDefaultStore
Store implementation based on EHCache. (http://ehcache.sourceforge.net/)
Field Summary |
---|
Fields inherited from interface org.apache.excalibur.store.Store |
---|
PERSISTENT_STORE, ROLE, TRANSIENT_STORE |
Constructor Summary | |
---|---|
EHDefaultStore()
|
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
void |
contextualize(Context context)
|
void |
dispose()
Shutdown the CacheManager. |
void |
free()
|
Object |
get(Object key)
|
void |
initialize()
Initialize the CacheManager and created the Cache. |
Enumeration |
keys()
|
void |
parameterize(Parameters parameters)
Configure the store. |
void |
remove(Object key)
|
void |
service(ServiceManager aManager)
|
int |
size()
|
void |
store(Object key,
Object value)
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EHDefaultStore()
Method Detail |
---|
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager aManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void parameterize(Parameters parameters) throws ParameterException
maxobjects
(10000) - The maximum number of objects in memory.overflow-to-disk
(true) - Whether to spool elements to disk after
maxobjects has been exceeded.eternal
(true) - whether or not entries expire. When set to
false
the timeToLiveSeconds
and
timeToIdleSeconds
parameters are used to determine when an
item expires.timeToLiveSeconds
(0) - how long an entry may live in the cache
before it is removed. The entry will be removed no matter how frequently it is retrieved.timeToIdleSeconds
(0) - the maximum time between retrievals
of an entry. If the entry is not retrieved for this period, it is removed from the
cache.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.
Setting eternal
to false
but not setting
timeToLiveSeconds
and/or timeToIdleSeconds
, has the
same effect as setting eternal
to true
.
Here is an example to clarify the purpose of the timeToLiveSeconds
and
timeToIdleSeconds
parameters:
With these settings the entry will be removed from the cache after 24 hours. If within that 24-hour period the entry is not retrieved within 3 hours after the last retrieval, it will also be removed from the cache.
By setting timeToLiveSeconds
to 0
, an item can stay in
the cache as long as it is retrieved within timeToIdleSeconds
after the
last retrieval.
By setting timeToIdleSeconds
to 0
, an item will stay in
the cache for exactly timeToLiveSeconds
.
disk-persistent
Whether the disk store persists between restarts of
the Virtual Machine. The default value is true.
parameterize
in interface Parameterizable
ParameterException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void dispose()
dispose
in interface Disposable
public Object get(Object key)
get
in interface Store
public void store(Object key, Object value) throws IOException
store
in interface Store
IOException
public void free()
free
in interface Store
public void remove(Object key)
remove
in interface Store
public void clear()
clear
in interface Store
public boolean containsKey(Object key)
containsKey
in interface Store
public Enumeration keys()
keys
in interface Store
public int size()
size
in interface Store
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |