DBPrism Servlet Engine
DBPrism In Memory Server implementation for External Cache Server

InMemoryServerImpl implements the interface defined by External Cache Invalidator Server. It implements his functionality using simply Java's HashMap and a Linked Lists objects. There is a main access point to pages (pagesByPath HashMap) which provides an eficient access by path to the pages stored on it, and the object located by this key, its a Hashtable which contains all the pages on behalf of the given path.

This ESI Invalidation Server is deprecated, use DatabaseServerImpl
Argument provides by cocoon.xconf
  • initialCapacity, Defines initial capacity of the Hashtable for the root path /, because this Hashtable includes all the pages controled by the external invalidator server could be required a fine tunning.
  • loadFactor, Same as above defines load factor of the Hashtable for the root path.
  • invalidator-user, user name used for authorization purpose of the invalitation message.
  • invalidator-pass, password used for authorization purpose of the invalitation message.
  • Cleanup-Thread-Interval, seconds betwen every checking of invalitation queue.

user.roles example:

<?xml version="1.0"?>
<!DOCTYPE role-list [
<!ELEMENT role-list (role+)> 
<!ELEMENT role (hint*)>
<!ELEMENT hint EMPTY>
<!ATTLIST role name CDATA #REQUIRED
               shorthand CDATA #REQUIRED
               default-class CDATA #IMPLIED
>
<!ATTLIST hint shorthand CDATA #REQUIRED
               class CDATA #REQUIRED
>
]>

<role-list>
 <role name="org.apache.cocoon.components.cache.Server"
       shorthand="cache-server"
       default-class="org.apache.cocoon.components.cache.InMemoryServerImpl"/>
</role-list>
  

cocoon.xconf

<?xml version="1.0"?>
<cocoon version="2.0" user-roles="/user.roles">
.....
  <!-- DBPrism External invalidate cache Server:
        initialCapacity : number      Value for HashMap store
        loadFactor : number           Value for HashMap store
  -->
  <cache-server class="org.apache.cocoon.components.cache.InMemoryServerImpl" 
                 pool-max="1" pool-min="1"
                 logger="core.cache-server">
     <parameter name="initialCapacity" value="500"/>
     <parameter name="loadFactor" value="50"/>
     <parameter name="invalidator-user" value="invalidator"/>
     <parameter name="invalidator-pass" value="invalidator"/>
     <parameter name="Cleanup-Thread-Interval" value="1"/>
  </cache-server>
.....
</cocoon>
  
This work is licensed under a Creative Commons License . Creative Commons License
(C) 1999-2008 - DBPrism ~ DBPrism CMS | Marcelo F. Ochoa | TANDIL ~ Argentina | 2008-10-07T20:12:50
DBPrism at SourceForgeBuilt with Cocoon2