You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2006/06/23 06:23:22 UTC
svn commit: r416558 -
/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Author: antonio
Date: Thu Jun 22 21:23:21 2006
New Revision: 416558
URL: http://svn.apache.org/viewvc?rev=416558&view=rev
Log:
EHDefaultStore: Allow users to configure disk-persistent parameter. Provided as an additional patch in COCOON-1868. The issue COCOON-1868 have been already fixed by upgrading ehcache to 1.2. Thanks to Ard Schrijvers (a.schrijvers@hippo.nl).
Modified:
cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?rev=416558&r1=416557&r2=416558&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java (original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Thu Jun 22 21:23:21 2006
@@ -79,6 +79,7 @@
// configuration options
private int maxObjects;
private boolean overflowToDisk;
+ private boolean diskPersistent;
private boolean eternal;
private long timeToLiveSeconds;
private long timeToIdleSeconds;
@@ -165,15 +166,21 @@
* the cache as long as it is retrieved within <code>timeToIdleSeconds</code> after the
* last retrieval.
* </p>
- *
+ *
* <p>
* By setting <code>timeToIdleSeconds</code> to <code>0</code>, an item will stay in
* the cache for exactly <code>timeToLiveSeconds</code>.
* </p>
+ *
+ * <p>
+ * <code>disk-persistent</code> Whether the disk store persists between restarts of
+ * the Virtual Machine. The default value is true.
+ *
*/
public void parameterize(Parameters parameters) throws ParameterException {
this.maxObjects = parameters.getParameterAsInteger("maxobjects", 10000);
this.overflowToDisk = parameters.getParameterAsBoolean("overflow-to-disk", true);
+ this.diskPersistent = parameters.getParameterAsBoolean("disk-persistent", true);
this.eternal = parameters.getParameterAsBoolean("eternal", true);
if (!this.eternal) {
@@ -264,7 +271,7 @@
URL configFileURL = Thread.currentThread().getContextClassLoader().getResource(CONFIG_FILE);
this.cacheManager = CacheManager.create(configFileURL);
this.cache = new Cache(this.cacheName, this.maxObjects, this.overflowToDisk, this.eternal,
- this.timeToLiveSeconds, this.timeToIdleSeconds, true, 120);
+ this.timeToLiveSeconds, this.timeToIdleSeconds, this.diskPersistent, 120);
this.cacheManager.addCache(this.cache);
this.storeJanitor.register(this);
getLogger().info("EHCache cache \"" + this.cacheName + "\" initialized");