|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 ContextualizableContextException
public void service(ServiceManager aManager)
throws ServiceException
service in interface ServiceableServiceException
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 ParameterizableParameterException
public void initialize()
throws Exception
initialize in interface InitializableExceptionpublic void dispose()
dispose in interface Disposablepublic Object get(Object key)
get in interface Store
public void store(Object key,
Object value)
throws IOException
store in interface StoreIOExceptionpublic void free()
free in interface Storepublic void remove(Object key)
remove in interface Storepublic void clear()
clear in interface Storepublic boolean containsKey(Object key)
containsKey in interface Storepublic Enumeration keys()
keys in interface Storepublic int size()
size in interface Store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||