You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2007/04/05 10:31:18 UTC

svn commit: r525757 - in /cocoon/trunk/core/cocoon-store/cocoon-store-impl/src: changes/ main/java/org/apache/cocoon/components/store/impl/ main/resources/META-INF/cocoon/properties/ main/resources/META-INF/cocoon/spring/

Author: reinhard
Date: Thu Apr  5 01:31:14 2007
New Revision: 525757

URL: http://svn.apache.org/viewvc?view=rev&rev=525757
Log:
      <action dev="reinhard" type="fix">
        Move all Spring configuration files into the "cocoon-store-impl" namespace.
      </action>       
      <action dev="reinhard" type="fix">
        MRUMemoryStore registers at StoreJanitor only in that case, if StoreJanitor
        is set as dependency. Assuming that in many cases the MRUMemoryStore is
        used for often requested resources like compiled XSLTTemplates or i18n resource bundles,
        it doesn't make sense to remove them as most probably they will be added
        within one of the next requests hiting Cocoon. Find more information
        at http://marc.info/?t=117563247800004&amp;r=1&amp;w=2.
      </action>       
      <action dev="reinhard" type="add">
        Expose all configuration properties that EHCache provides via setter methods.
        Using them, EHDefaultStore can be completly configured in the Spring bean
        definition. This allows setting maxElementsInMemory, memoryStoreEvictionPolicy, 
        overflowToDisk, diskStorePath, eternal, timeToLiveSeconds, timeToIdleSeconds, 
        diskPersistent, diskExpiryThreadIntervalSeconds, registeredEventListeners, 
        bootstrapCacheLoader, maxElementsOnDisk. See the 1.2.4 constructor at 
        http://ehcache.sourceforge.net/javadoc/net/sf/ehcache/Cache.html for
        details.
      </action>        
      <action dev="reinhard" type="fix">
        EHDefaultStore doesn't register at StoreJanitor anymore. The usage of
        StoreJanitor to remove elements from EHDefaultStore was contra-productive,
        because EHCache provides its own invalidation mechanisms which are more
        sophisticated than the removal of random items. Find more information
        at http://marc.info/?t=117563247800004&amp;r=1&amp;w=2.
      </action>        
      <action dev="reinhard" type="update">
        Make the maximum number of disk objects configureable.
      </action>  

Added:
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-store-impl.properties
      - copied unchanged from r523803, cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-core-store.properties
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-ehcache.xml
      - copied, changed from r523803, cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store.xml
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml   (with props)
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-transient.xml
      - copied, changed from r523803, cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-transient.xml
Removed:
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/properties/cocoon-core-store.properties
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-janitor.xml
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-transient.xml
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store.xml
Modified:
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
    cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/MRUMemoryStore.java

Modified: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml?view=diff&rev=525757&r1=525756&r2=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/changes/changes.xml Thu Apr  5 01:31:14 2007
@@ -24,8 +24,43 @@
     +-->
 <document>
   <body>
-    <release version="1.0.0-M1-SNAPSHOT" date="2007-00-00" description="unreleased">  
-      
+    <release version="1.0.0-RC1" date="2007-??-??" description="unreleased">  
+      <action dev="reinhard" type="fix">
+        Move all Spring configuration files into the "cocoon-store-impl" namespace.
+      </action>       
+      <action dev="reinhard" type="fix">
+        MRUMemoryStore registers at StoreJanitor only in that case, if StoreJanitor
+        is set as dependency. Assuming that in many cases the MRUMemoryStore is
+        used for often requested resources like compiled XSLTTemplates or i18n resource bundles,
+        it doesn't make sense to remove them as most probably they will be added
+        within one of the next requests hiting Cocoon. Find more information
+        at http://marc.info/?t=117563247800004&amp;r=1&amp;w=2.
+      </action>       
+      <action dev="reinhard" type="add">
+        Expose all configuration properties that EHCache provides via setter methods.
+        Using them, EHDefaultStore can be completly configured in the Spring bean
+        definition. This allows setting maxElementsInMemory, memoryStoreEvictionPolicy, 
+        overflowToDisk, diskStorePath, eternal, timeToLiveSeconds, timeToIdleSeconds, 
+        diskPersistent, diskExpiryThreadIntervalSeconds, registeredEventListeners, 
+        bootstrapCacheLoader, maxElementsOnDisk. See the 1.2.4 constructor at 
+        http://ehcache.sourceforge.net/javadoc/net/sf/ehcache/Cache.html for
+        details.
+      </action>        
+      <action dev="reinhard" type="fix">
+        EHDefaultStore doesn't register at StoreJanitor anymore. The usage of
+        StoreJanitor to remove elements from EHDefaultStore was contra-productive,
+        because EHCache provides its own invalidation mechanisms which are more
+        sophisticated than the removal of random items. Find more information
+        at http://marc.info/?t=117563247800004&amp;r=1&amp;w=2.
+      </action>        
+      <action dev="reinhard" type="update">
+        Make the maximum number of disk objects configureable.
+      </action>    
+    </release>    
+    <release version="1.0.0-M1" date="2007-03-02" description="released">  
+      <action dev="reinhard" type="add">
+        Initial creation.
+      </action>    
     </release>
   </body>
 </document>

Modified: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?view=diff&rev=525757&r1=525756&r2=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Thu Apr  5 01:31:14 2007
@@ -29,6 +29,9 @@
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
 import net.sf.ehcache.Status;
+import net.sf.ehcache.bootstrap.BootstrapCacheLoader;
+import net.sf.ehcache.event.RegisteredEventListeners;
+import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
 
 import org.apache.cocoon.configuration.Settings;
 import org.apache.cocoon.util.IOUtils;
@@ -36,35 +39,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.excalibur.store.Store;
-import org.apache.excalibur.store.StoreJanitor;
 
 /**
- * Store implementation based on EHCache.
- * (http://ehcache.sourceforge.net/)
- * Configure the store. 
- * <br/>
- * The following options can be used:
- * <ul>
- *  <li><code>maxobjects</code> (10000) - The maximum number of in-memory objects.</li>
- *  <li><code>overflow-to-disk</code> (true) - Whether to spool elements to disk after
- *   maxobjects has been exceeded.</li>
- * <li><code>eternal</code> (true) - whether or not entries expire. When set to
- * <code>false</code> the <code>timeToLiveSeconds</code> and
- * <code>timeToIdleSeconds</code> parameters are used to determine when an
- * item expires.</li>
- * <li><code>timeToLiveSeconds</code> (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.</li>
- * <li><code>timeToIdleSeconds</code> (0) - the maximum time between retrievals
- * of an entry. If the entry is not retrieved for this period, it is removed from the
- * cache.</li>
- *  <li><code>use-cache-directory</code> (false) - If true the <i>cache-directory</i>
- *   context entry will be used as the location of the disk store. 
- *   Within the servlet environment this is set in web.xml.</li>
- *  <li><code>use-work-directory</code> (false) - If true the <i>work-directory</i>
- *   context entry will be used as the location of the disk store.
- *   Within the servlet environment this is set in web.xml.</li>
- *  <li><code>directory</code> - Specify an alternative location of the disk store.
- * </ul>
+ * <p>Store implementation based on EHCache (http://ehcache.sourceforge.net/)
+ * Configure the store using the setter methods.</p>
  * 
  * <p>
  * Setting <code>eternal</code> to <code>false</code> but not setting
@@ -101,6 +79,7 @@
  * <p>
  * <code>disk-persistent</code> Whether the disk store persists between restarts of
  * the Virtual Machine. The default value is true.
+ * </p>
  *
  * @version $Id$
  */
@@ -108,12 +87,14 @@
 
     // ---------------------------------------------------- Constants
 
-    private static final int MAXOBJECTS = 10000;
+    private static final int MAX_MEM_OBJECTS = 10000;
+    private static final int MAX_DISK_OBJECTS = 50000;
     private static final boolean OVERFLOW_TO_DISK = true;
     private static final boolean DISK_PERSISTENT = true;
     private static final boolean ETERNAL = true;
     private static final long TIME_TO_LIVE_SECONDS = 0L;
     private static final long TIME_TO_IDLE_SECONDS = 0L;
+    private static final long DISK_EXPIRY_THREAD_INTERVAL_SECONDS = 120;
     private static final boolean USE_WORK_DIRECTORY = false;
     private static final boolean USE_CACHE_DIRECTORY = false;
     private static final String DEFAULT_CACHE_NAME = "cocoon-ehcache";    
@@ -123,14 +104,17 @@
     private static int instanceCount = 0;
 
     // ---------------------------------------------------- Instance variables
-
+    
+    /** By default we use the logger for this class. */
+    private Log logger = LogFactory.getLog(getClass());    
+    
+    // EHCache
     private Cache cache;
     private CacheManager cacheManager;
 
-    private String cacheName;
-
     // configuration options
-    private int maxObjects = MAXOBJECTS;
+    private int maxMemObjects = MAX_MEM_OBJECTS;
+    private int maxDiskObjects = MAX_DISK_OBJECTS;
     private boolean overflowToDisk = OVERFLOW_TO_DISK;
     private boolean diskPersistent = DISK_PERSISTENT;
     private boolean eternal = ETERNAL;
@@ -138,29 +122,18 @@
     private long timeToIdleSeconds = TIME_TO_IDLE_SECONDS;
     private boolean useCacheDirectory = USE_CACHE_DIRECTORY;
     private boolean useWorkDirectory = USE_WORK_DIRECTORY;
-    private String directory;
-    /** The service manager */
-
-    /** By default we use the logger for this class. */
-    private Log logger = LogFactory.getLog(getClass());
+    private long diskExpiryThreadIntervalSeconds = DISK_EXPIRY_THREAD_INTERVAL_SECONDS;   
+    private MemoryStoreEvictionPolicy memoryStoreEvictionPolicy = null;
+    private RegisteredEventListeners registeredEventListeners = null;
+    private BootstrapCacheLoader bootstrapCacheLoader = null;
 
-    /** The store janitor */
-    private StoreJanitor storeJanitor;
-    
-    /** The settings object */
     private Settings settings;
-
+    private String cacheName;    
+    private String directory;    
     private File workDir;
     private File cacheDir;
-
     private String diskStorePath;  // The directory to be used a disk store path. Uses java.io.tmpdir if the argument is null.
 
-    // ---------------------------------------------------- Lifecycle
-
-    public EHDefaultStore() {    
-        
-    }
-
     /**
      *  <li><code>directory</code> - Specify an alternative location of the disk store.
      * @param directory
@@ -190,11 +163,19 @@
     }
 
     /**
-     * <code>maxobjects</code> (10000) - The maximum number of in-memory objects.
-     * @param maxObjects
+     * <code>maxMemobjects</code> (10000) - The maximum number of in-memory objects.
+     * @param maxMemobjects
+     */
+    public void setMaxMemObjects(int maxMemObjects) {
+        this.maxMemObjects = maxMemObjects;
+    }
+    
+    /**
+     * <code>maxDiskObjects</code> (50000) - The maximum number of disc objects.
+     * @param maxDiskObjects
      */
-    public void setMaxObjects(int maxObjects) {
-        this.maxObjects = maxObjects;
+    public void setMaxDiskObjects(int maxDiskObjects) {
+        this.maxDiskObjects = maxDiskObjects;
     }
 
     /**
@@ -224,7 +205,41 @@
     public void setTimeToLiveSeconds(long timeToLiveSeconds) {
         this.timeToLiveSeconds = timeToLiveSeconds;
     }
-
+    
+    /**
+     * <li><code>diskExpiryThreadIntervalSeconds</code> (120) - The number of seconds 
+     * between runs of the disk expiry thread.</li>
+     * @param diskExpiryThreadIntervalSeconds
+     */
+    public void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds) {
+        this.diskExpiryThreadIntervalSeconds = diskExpiryThreadIntervalSeconds;
+    }    
+
+    /**
+     * <li><code>memoryStoreEvictionPolicy</code> (null) - Tone of LRU, LFU and FIFO. If 
+     * null, it will be set to LRU.</li>
+     * @param memoryStoreEvictionPolicy
+     */    
+    public void setMemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy) {
+        this.memoryStoreEvictionPolicy = memoryStoreEvictionPolicy;
+    }    
+ 
+    /**
+     * A notification service. Optionally null, in which case a new one with no registered listeners will be created.
+     * @param registeredEventListeners
+     */
+    public void setRegisteredEventListeners(RegisteredEventListeners registeredEventListeners) {
+        this.registeredEventListeners = registeredEventListeners;
+    }    
+        
+    /**
+     * The BootstrapCacheLoader to use to populate the cache when it is first initialised. Null if none is required.
+     * @param bootstrapCacheLoader
+     */
+    public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) {
+        this.bootstrapCacheLoader = bootstrapCacheLoader;
+    }    
+            
     /**
      *  <li><code>use-cache-directory</code> (false) - If true the <i>cache-directory</i>
      *   context entry will be used as the location of the disk store. 
@@ -244,27 +259,20 @@
     public void setUseWorkDirectory(boolean useWorkDirectory) {
         this.useWorkDirectory = useWorkDirectory;
     }
-
-    public Log getLogger() {
-        return this.logger;
-    }
-
-    public void setLogger(Log l) {
-        this.logger = l;
-    }
-
+    
     /**
      * @param settings the settings to set
      */
     public void setSettings(Settings settings) {
         this.settings = settings;
+    }    
+
+    public Log getLogger() {
+        return this.logger;
     }
 
-    /**
-     * @param storeJanitor the storeJanitor to set
-     */
-    public void setStoreJanitor(StoreJanitor storeJanitor) {
-        this.storeJanitor = storeJanitor;
+    public void setLogger(Log l) {
+        this.logger = l;
     }
 
     /**
@@ -359,14 +367,26 @@
             this.cacheName = DEFAULT_CACHE_NAME;
         }          
                 
-
         // read configuration - we have to replace the diskstorepath in the configuration
         // as the diskStorePath argument of the Cache constructor is ignored and set by the
         // CacheManager! (see bug COCOON-1927)
-        this.cache = new Cache(this.cacheName, this.maxObjects, this.overflowToDisk, this.eternal,
-                this.timeToLiveSeconds, this.timeToIdleSeconds, this.diskPersistent, 120);
+        this.cache = new Cache(
+                        this.cacheName,
+                        this.maxMemObjects,
+                        this.memoryStoreEvictionPolicy,
+                        this.overflowToDisk,
+                        this.diskStorePath,
+                        this.eternal,
+                        this.timeToLiveSeconds,
+                        this.timeToIdleSeconds,
+                        this.diskPersistent,
+                        this.diskExpiryThreadIntervalSeconds,
+                        this.registeredEventListeners,
+                        this.bootstrapCacheLoader,
+                        this.maxDiskObjects);
+                        
+        
         this.cacheManager.addCache(this.cache);
-        this.storeJanitor.register(this);
         getLogger().info("EHCache cache \"" + this.cacheName + "\" initialized");
     }
 
@@ -374,9 +394,6 @@
      * Shutdown the CacheManager.
      */
     public void destroy() {
-        if (this.storeJanitor != null)
-            this.storeJanitor.unregister(this);
-
         /*
          * EHCache can be a bitch when shutting down. Basically every cache registers
          * a hook in the Runtime for every persistent cache, that will be executed when

Modified: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/MRUMemoryStore.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/MRUMemoryStore.java?view=diff&rev=525757&r1=525756&r2=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/MRUMemoryStore.java (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/java/org/apache/cocoon/components/store/impl/MRUMemoryStore.java Thu Apr  5 01:31:14 2007
@@ -117,7 +117,9 @@
 
         this.cache = new Hashtable((int) (this.maxObjects * 1.2));
         this.mrulist = new LinkedList();
-        this.storeJanitor.register(this);
+        if(this.storeJanitor != null) {
+            this.storeJanitor.register(this);
+        }
     }
 
     /**

Copied: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-ehcache.xml (from r523803, cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-ehcache.xml?view=diff&rev=525757&p1=cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store.xml&r1=523803&p2=cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-ehcache.xml&r2=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store.xml (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-ehcache.xml Thu Apr  5 01:31:14 2007
@@ -33,9 +33,8 @@
       +-->
   <bean name="org.apache.excalibur.store.Store" class="org.apache.cocoon.components.store.impl.EHDefaultStore"
         init-method="init" destroy-method="destroy">
-    <property name="maxObjects" value="${org.apache.cocoon.store.maxobjects}"/>
+    <property name="maxMemObjects" value="${org.apache.cocoon.store.maxobjects}"/>
     <property name="useCacheDirectory" value="${org.apache.cocoon.store.use-cache-directory}"/>
-    <property name="storeJanitor" ref="org.apache.excalibur.store.StoreJanitor"/>
     <property name="settings" ref="org.apache.cocoon.configuration.Settings"/>
   </bean>
 

Added: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml?view=auto&rev=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml (added)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml Thu Apr  5 01:31:14 2007
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- Normally uses the org.apache.excalibur.store.impl.StoreJanitorImpl as
+     the default-class but as that uses its own Thread spawning there is
+     the org.apache.cocoon.components.store.impl.CocoonStoreJanitor class
+     to use a daemon thread from the org.apache.cocoon.components.thread.RunnableManager
+     component.
+     NOTE: As soon as our patch has been accepted by the Excalibur community and an
+           excalibur-store has been release we can switch back to the original
+           org.apache.excalibur.store.impl.StoreJanitorImpl class
+
+     $Id$
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+  <!--+
+      | Store Janitor: the store garbage collector and memory usage controller.
+      |
+      | WARNING: Be careful with the heapsize and freememory parameters.
+      |           Wrong values can cause high cpu usage.
+      |
+      | Example configuration:
+      | Jvm settings:
+      |    -Xmx200000000
+      | store-janitor settings:
+      |    <parameter name="freememory" value="5000000"/>
+      |    <parameter name="heapsize" value="196000000"/>
+      |
+      | It is recommended to have heapsize equal to -Xmx, especially on Sun's
+      | JVM which are unable to shrink its heap once it grows above minimum.
+      | Freememory should be greater than amount of memory necessary for normal
+      | application operation.
+      | BUT: The heap size of the memory of the JVM is a little bit less than
+      |      the value you specify for -Xmx, so you have to set the heapsize
+      |      for the store janitor to a value which is lower (2% less seems
+      |      to be a working value).
+      +-->
+      
+  <bean name="org.apache.excalibur.store.StoreJanitor" class="org.apache.cocoon.components.store.impl.CocoonStoreJanitor"
+        init-method="init" destroy-method="destroy">
+    <!--+
+        | How much free memory shall be available in the jvm?
+        | If not specified, defaults to 1Mb.
+        +-->
+    <property name="freeMemory" value="2048000"/>
+    <!--+
+        | How much memory at max jvm can consume?
+        | The default max heapsize for Sun's JVM is (almost) 64Mb,
+        | can be increased by specifying -Xmx command line parameter.
+        | If not specified, defaults to 66600000 bytes.
+        +-->
+    <property name="heapSize" value="66600000"/>
+    <!--+
+        | How often shall the cleanup thread check memory?
+        | If not specified, defaults to 10 seconds.
+        +-->
+    <property name="cleanupThreadInterval" value="10"/>
+    <!--+
+        | Experimental adaptive algorithm for cleanup interval
+    <property name="adaptiveThreadInterval" value="true"/>
+        +-->
+    <!--+
+        | What percent of the store elements shall be dropped on low memory?
+        | If not specified, defaults to 10%
+        +-->
+    <property name="percentToFree" value="10"/>
+    <!--+
+        | Shall garbage collector be invoked on low memory?
+        | If not specified, defaults to false.
+        +-->
+    <property name="invokeGC" value="false"/>
+    <!--+
+        | Algorithm describing how to clean caches in low memory situations.
+        |   round-robin: The registered caches are cycled through,
+        |                and each time there is a low memory situation one
+        |                of the registered caches has objects freed from it.
+        |   all-stores:  All registered stores have objects removed from
+        |                them each time there is a low memory situation.
+        | If not specified, defaults to 'round-robin'.
+        +-->
+    <property name="freeingAlgorithm" value="round-robin"/>
+    <!--+
+        | Name of the thread pool to use.
+        | If not specified, defaults to 'daemon'.
+        +-->
+    <property name="threadPool" value="daemon"/>
+
+    <!--+
+        | What should be the priority of the cleanup thread?
+        | This property is used only by older implementation of the janitor.
+        | New implementation uses centrally configured thread pool (see
+        | thread-pools element below).
+    <property name="threadPriority" value="5"/>
+        +-->
+        
+    <property name="runnableManager" ref="org.apache.cocoon.components.thread.RunnableManager"/>
+  </bean>
+</beans>

Propchange: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-janitor.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Copied: cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-transient.xml (from r523803, cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-transient.xml)
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-transient.xml?view=diff&rev=525757&p1=cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-transient.xml&r1=523803&p2=cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-transient.xml&r2=525757
==============================================================================
--- cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-core-store-transient.xml (original)
+++ cocoon/trunk/core/cocoon-store/cocoon-store-impl/src/main/resources/META-INF/cocoon/spring/cocoon-store-impl-transient.xml Thu Apr  5 01:31:14 2007
@@ -31,6 +31,5 @@
   <bean name="org.apache.excalibur.store.Store/TransientStore" class="org.apache.cocoon.components.store.impl.DefaultTransientStore"
         init-method="init" destroy-method="destroy">
     <property name="maxObjects" value="${org.apache.cocoon.store.transient.maxobjects}"/>
-    <property name="storeJanitor" ref="org.apache.excalibur.store.StoreJanitor"/>
   </bean>
 </beans>