You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by "Gregor J. Rothfuss" <gr...@apache.org> on 2005/03/16 22:09:36 UTC

[Fwd: cocoon and whirly cache how-to]

this might be of interest for those who are not happy with jcs and the 
janitor ..

-------- Original Message --------
Subject: cocoon and whirly cache how-to
Date: Tue, 15 Mar 2005 16:25:24 -0500
From: Eric Meyer <Er...@QuoinInc.com>
To: Gregor J. Rothfuss <gr...@wyona.com>

Here's how to use whirly cache with cocoon. I'd be happy to hear any
corrections/suggestions.

Regards,
Eric

Whirly Cache Cocoon How-To

Get the latest (fixed) version of Whirly Cache.

Put whirlycache.jar and the necessary supporting jars such as
concurrent.jar into your WEB-INF/classes/lib directory

Extract the /WEB-INF/classes/org/apache/cocoon/cocoon.roles from the
cocoon.jar and modify it to replace both caches with Whirly Cache, and
remove the store janitor:

   <role
default-class="com.whirlycott.cache.component.store.WhirlycacheStore"
name="org.apache.excalibur.store.Store" shorthand="store"/>

   <role
default-class="com.whirlycott.cache.component.store.WhirlycacheStore"
name="org.apache.excalibur.store.Store/TransientStore"
shorthand="transient-store"/>

<!-- NO store janitor
   <role default-class="org.apache.excalibur.store.impl.StoreJanitorImpl"
name="org.apache.excalibur.store.StoreJanitor" shorthand="store-janitor"/>
-->

Set the whirly cache conifuration parameters in your cocoon.xconf file,
and remove the store-janitor entry.

   <!--+
       | Transient Store: holds objects that don't have to survive shutdown
       |
       | Common configuration parameters:
       | maxobjects: Indicates how many objects will be hold in the cache.
       |    When the number of maxobjects has been reached. The last object
       |    in the cache will be thrown out.
       +-->
   <transient-store logger="core.store.transient">
         <backend>com.whirlycott.cache.impl.ConcurrentHashMapImpl</backend>
         <tuner-sleeptime>10</tuner-sleeptime>

         <!-- evicts oldest items when pruning -->
         <!--
<policy>com.whirlycott.cache.policy.FIFOMaintenancePolicy</policy> -->
         <!-- evicts least recently used items when pruning -->
         <!--
<policy>com.whirlycott.cache.policy.LRUMaintenancePolicy</policy> -->
         <!-- evicts least frequently used items when pruning -->
         <policy>com.whirlycott.cache.policy.LFUMaintenancePolicy</policy>

         <maxsize>10000</maxsize>
   </transient-store>

   <!--+
       | Store: generic store. The default implementation is an in-memory
store
       | backed by a disk store (based on JCS). This forms a two-stage
       | cache composed of a fast in-memory MRU front-end and a persistent
       | back-end which stores the less-used objects.
       |
       | Common configuration parameters:
       | maxobjects: Indicates how many objects will be held in the cache.
       |    When the number of maxobjects has been reached. The last object
       |    in the cache will be thrown out.
       +-->
   <store logger="core.store">
     <parameter name="use-cache-directory" value="true"/>
         <backend>com.whirlycott.cache.impl.ConcurrentHashMapImpl</backend>
         <tuner-sleeptime>10</tuner-sleeptime>

         <!-- evicts oldest items when pruning -->
         <!--
<policy>com.whirlycott.cache.policy.FIFOMaintenancePolicy</policy> -->
         <!-- evicts least recently used items when pruning -->
         <!--
<policy>com.whirlycott.cache.policy.LRUMaintenancePolicy</policy> -->
         <!-- evicts least frequently used items when pruning -->
         <policy>com.whirlycott.cache.policy.LFUMaintenancePolicy</policy>

         <maxsize>10000</maxsize>
   </store>





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org