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:17:18 UTC

svn commit: r416557 - in /cocoon/branches/BRANCH_2_1_X: src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java status.xml

Author: antonio
Date: Thu Jun 22 21:17:17 2006
New Revision: 416557

URL: http://svn.apache.org/viewvc?rev=416557&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/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?rev=416557&r1=416556&r2=416557&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Thu Jun 22 21:17:17 2006
@@ -51,6 +51,7 @@
 /**
  * Store implementation based on EHCache.
  * (http://ehcache.sourceforge.net/)
+ * @version $Id$
  */
 public class EHDefaultStore extends AbstractLogEnabled 
 implements Store, Contextualizable, Serviceable, Parameterizable, Initializable, Disposable, ThreadSafe {
@@ -71,6 +72,7 @@
     // configuration options
     private int maxObjects;
     private boolean overflowToDisk;
+    private boolean diskPersistent;
     private boolean eternal;
     private long timeToLiveSeconds;
     private long timeToIdleSeconds;
@@ -162,11 +164,17 @@
      * 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.
+     * </p>
      */
     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 +272,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");

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/status.xml?rev=416557&r1=416556&r2=416557&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Jun 22 21:17:17 2006
@@ -182,6 +182,11 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.10" date="TBD">
+    <action dev="AG" type="add" due-to="Ard Schrijvers" due-to-emal="a.schrijvers@hippo.nl">
+      EHDefaultStore: Allow users to configure disk-persistent parameter. In earlier cocoon
+      versions this ehcache parameter was always true. It defines whether or not the disk
+      store persists between restarts of the Virtual Machine. The default value is true.
+    </action>
     <action dev="CZ" type="fix">
       The predefined variables "parameters" and "cocoon.parameters" now both point to the
       parameters object in JXTemplateGenerator and the template block. (cocoon.parameters did