Author: cmailleux
Date: Wed Oct  3 12:06:09 2007
New Revision: 415

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D415&repname=
=3Desi_server
Log:
Allow to change cache provider (EHCACHE by default bu REFERENCECACHE is ava=
ilable also, see in data.xml)
We do not cache edit/compare/preview mode by default to cache this mode loo=
k into data.xml into passthrough section

Modified:
    trunk/WEB-INF/config/data.xml
    trunk/src/org/jahia/esi/cache/MainCache.java
    trunk/src/org/jahia/esi/settings/ConfigParser.java
    trunk/src/org/jahia/esi/settings/SettingsBean.java

Modified: trunk/WEB-INF/config/data.xml
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/WEB-INF/config/=
data.xml&rev=3D415&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/WEB-INF/config/data.xml (original)
+++ trunk/WEB-INF/config/data.xml Wed Oct  3 12:06:09 2007
@@ -27,6 +27,9 @@
             test the setup to make sure everything works.
         -->
         <maximizeBrowserLocalCaching>false</maximizeBrowserLocalCaching>
+        <!-- define your cache provider possible values are : EHCAHCE or R=
EFERENCECACHE
+             ReferenceCache is not compatible with cluster mode for esi-->
+        <cacheProvider>REFERENCECACHE</cacheProvider>
         <!-- If your Jahia servers are clustered, you will want all your E=
SI servers to cluster and share
         the same fragment cache instance, activate this setting.
         Make also sure that shareEsiCacheEntriesBetweenServers (see below)=
 is also set to true.
@@ -143,13 +146,13 @@
         nor will it be parsed for ESI tags for the matching requests : -->
         <default-passthrough-rules>
             <!-- activate passthrough for pages in EDIT mode -->
-            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
-                                  <!--url=3D"/op/edit/" description=3D"EDI=
T mode passthrough"/>-->
-            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
-                                  <!--url=3D"/op/preview/" description=3D"=
Preview mode passthrough"/>-->
-            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
-                                  <!--url=3D"/op/compare/" description=3D"=
Compare mode passthrough"/>-->
-            <!-- activate passthrough for files already compressed -->
+            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
+                                  url=3D"/op/edit/" description=3D"EDIT mo=
de passthrough"/>
+            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
+                                  url=3D"/op/preview/" description=3D"Prev=
iew mode passthrough"/>
+            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
+                                  url=3D"/op/compare/" description=3D"Comp=
are mode passthrough"/>
+             <!--activate passthrough for files already compressed -->
             <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule"
                               type=3D"SUBSTRING"
                               url=3D".zgz"

Modified: trunk/src/org/jahia/esi/cache/MainCache.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/cache/MainCache.java&rev=3D415&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/org/jahia/esi/cache/MainCache.java (original)
+++ trunk/src/org/jahia/esi/cache/MainCache.java Wed Oct  3 12:06:09 2007
@@ -57,6 +57,7 @@
 import org.jahia.esi.Utils;
 import org.jahia.esi.EsiConst;
 import org.jahia.services.cache.*;
+import org.jahia.services.cache.simple.SimpleCacheProvider;
 import org.jahia.services.cache.ehcache.EhCacheProvider;
 import org.jahia.services.cache.treecache.TreeCacheProvider;
 import org.jahia.exceptions.JahiaInitializationException;
@@ -158,7 +159,8 @@
         cacheService =3D CacheFactory.getInstance();
 =

         CacheProvider cacheProvider =3D null;
-
+        String s =3D SettingsBean.getInstance().getCacheProvider();
+        if(s.equals("EHCACHE")) {
         if (SettingsBean.getInstance().isClusterEsiCache()) {
             log.info("--- ESI Fragment cache is CLUSTERED ---");
             cacheProvider =3D new EhCacheProvider(true);
@@ -167,6 +169,9 @@
             log.info("--- ESI Fragment cache is STANDALONE (i.e. NOT clust=
ered) ---");
             cacheProvider =3D new EhCacheProvider(false);
         }
+        } else if (s.equals("REFERENCECACHE")) {
+            cacheProvider =3D new SimpleCacheProvider();
+        }
 =

         cacheService.setCacheProvider(cacheProvider);
         cacheService.setSettingsBean(SettingsBean.getInstance());

Modified: trunk/src/org/jahia/esi/settings/ConfigParser.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/settings/ConfigParser.java&rev=3D415&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/org/jahia/esi/settings/ConfigParser.java (original)
+++ trunk/src/org/jahia/esi/settings/ConfigParser.java Wed Oct  3 12:06:09 =
2007
@@ -250,6 +250,7 @@
         digester.addBeanPropertySetter( "config/generalsettings/addCacheKe=
yDebugInfo", "addCacheKeyDebugInfo" );
         digester.addBeanPropertySetter( "config/generalsettings/webDavUrlM=
arker", "webDavUrlMarker" );
         digester.addBeanPropertySetter( "config/generalsettings/contextPat=
h", "contextPath" );
+        digester.addBeanPropertySetter( "config/generalsettings/cacheProvi=
der", "cacheProvider" );
 =

         SettingsBean settingsBean =3D (SettingsBean) digester.parse(data);
         SettingsBean.setInstance(settingsBean);

Modified: trunk/src/org/jahia/esi/settings/SettingsBean.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/settings/SettingsBean.java&rev=3D415&repname=3Desi_server
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/org/jahia/esi/settings/SettingsBean.java (original)
+++ trunk/src/org/jahia/esi/settings/SettingsBean.java Wed Oct  3 12:06:09 =
2007
@@ -190,6 +190,8 @@
      */
     private LinkedList remoteEsiServers;
 =

+    private String cacheProvider =3D "EHCACHE";
+
     public SettingsBean() {
         //set default value in case it is not set in data.xml
         //The default value is set to the value used in the -Xmx parameter
@@ -844,6 +846,14 @@
         this.maximumSizeOfCacheableBinaryContent =3D maximumSizeOfCacheabl=
eBinaryContentInKiloBytes*1024;
     }
 =

+    public String getCacheProvider() {
+        return cacheProvider;
+    }
+
+    public void setCacheProvider(String cacheProvider) {
+        this.cacheProvider =3D cacheProvider;
+    }
+
     public String toString() {
         return "SettingsBean{" + "\n" +
                 "  clusterEsiCache=3D'" + clusterEsiCache + "'" + "\n" +

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to