r1097 - in xwiki/trunk: . lib patches src/main/java/com/xpn/xwiki src/main/java/com/xpn/xwiki/api src/main/java/com/xpn/xwiki/cache/api src/main/java/com/xpn/xwiki/cache/impl src/main/java/com/xpn/xwiki/doc src/main/java/com/xpn/xwiki/notify src/main/java/com/xpn/xwiki/objects/classes src/main/java/com/xpn/xwiki/plugin src/main/java/com/xpn/xwiki/plugin/feed src/main/java/com/xpn/xwiki/plugin/flickr src/main/java/com/xpn/xwiki/plugin/image src/main/java/com/xpn/xwiki/plugin/query src/main/java/com/xpn/xwiki/render src/main/java/com/xpn/xwiki/render/groovy src/main/java/com/xpn/xwiki/store src/main/java/com/xpn/xwiki/user/api src/main/java/com/xpn/xwiki/user/impl/exo src/main/java/com/xpn/xwiki/user/impl/xwiki src/main/web/WEB-INF

Ludovic Dubost ludovic at users.forge.objectweb.org
Mon Jul 31 01:27:13 CEST 2006


Author: ludovic
Date: 2006-07-31 01:27:07 +0200 (Mon, 31 Jul 2006)
New Revision: 1097

Added:
   xwiki/trunk/lib/oscache-2.3.2M.jar
   xwiki/trunk/patches/OSCacheCache.diff
   xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/ClusterSharedNotification.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java
Removed:
   xwiki/trunk/lib/oscache-2.3.2.jar
Modified:
   xwiki/trunk/build.xml
   xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiInterface.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/api/Document.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/api/User.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/api/XWiki.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/notify/DocObjectChangedRule.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
   xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java
   xwiki/trunk/src/main/web/WEB-INF/oscache.properties
   xwiki/trunk/xwiki.iml
   xwiki/trunk/xwiki.ipr
   xwiki/trunk/xwiki.iws
   xwiki/trunk/xwikibase.iml
Log:
Transformed all caches to XWikiCache
Move virtual wiki cache to XWikiCache, limited by default to 1000 items
Allow caches to be completely deleted on flushAll
Allow clustered cache to only use one jgroups notification bus
Updated oscache to a lightly modified version of oscache



Modified: xwiki/trunk/build.xml
===================================================================
--- xwiki/trunk/build.xml	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/build.xml	2006-07-30 23:27:07 UTC (rev 1097)
@@ -85,7 +85,7 @@
       includes="hibernate-3.0.3.jar" />
 
     <fileset id="libs.main.fileset" dir="${lib.dir}"
-      includes="c3p0-0.8.4.5.jar,cglib-2.1.jar,dom4j-1.6.jar,ehcache-1.1.jar,hibernate-tools-2.1.3.jar,mysql-connector-java-3.1.7-bin.jar,hsqldb-1.7.3.jar,odmg-3.0.jar,oscache-2.3.2.jar,concurrent.jar,jgroups-2.2.9.1.jar,swarmcache.jar,xalan-2.6.0.jar,xerces-2.4.0.jar,xml-apis-2.0.2.jar,jta.jar,antlr-2.7.5.jar,asm-1.5.3.jar,asm-util-1.5.3.jar,
+      includes="c3p0-0.8.4.5.jar,cglib-2.1.jar,dom4j-1.6.jar,ehcache-1.1.jar,hibernate-tools-2.1.3.jar,mysql-connector-java-3.1.7-bin.jar,hsqldb-1.7.3.jar,odmg-3.0.jar,oscache-2.3.2M.jar,concurrent.jar,jgroups-2.2.9.1.jar,swarmcache.jar,xalan-2.6.0.jar,xerces-2.4.0.jar,xml-apis-2.0.2.jar,jta.jar,antlr-2.7.5.jar,asm-1.5.3.jar,asm-util-1.5.3.jar,
      	commons-beanutils-1.7.0.jar,commons-codec-1.3.jar,commons-collections-3.1.jar,commons-dbcp-1.2.1.jar,commons-digester-1.6.jar,commons-fileupload-1.0.jar,commons-lang-2.1.jar,commons-logging-1.0.4.jar,commons-pool-1.1.jar,commons-net-1.1.0.jar,commons-httpclient-2.0.2.jar,ecs-1.4.2.jar,oro-2.0.8.jar,log4j-1.2.8.jar,
      	org.apache.commons.jrcs.rcs.jar,
      	struts-1.2.4.jar,

Deleted: xwiki/trunk/lib/oscache-2.3.2.jar
===================================================================
(Binary files differ)

Added: xwiki/trunk/lib/oscache-2.3.2M.jar
===================================================================
(Binary files differ)


Property changes on: xwiki/trunk/lib/oscache-2.3.2M.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: xwiki/trunk/patches/OSCacheCache.diff
===================================================================
--- xwiki/trunk/patches/OSCacheCache.diff	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/patches/OSCacheCache.diff	2006-07-30 23:27:07 UTC (rev 1097)
@@ -0,0 +1,44 @@
+Index: Cache.java
+===================================================================
+RCS file: /cvs/oscache/src/java/com/opensymphony/oscache/base/Cache.java,v
+retrieving revision 1.5
+diff -u -r1.5 Cache.java
+--- Cache.java	9 Apr 2006 12:50:34 -0000	1.5
++++ Cache.java	30 Jul 2006 20:19:07 -0000
+@@ -83,6 +83,12 @@
+     private boolean blocking = false;
+ 
+     /**
++     *  Optional cache name which allows to be used to identify a cache
++     *  in SharedJavaGroupsBroadcastingListener and direct the notifications to the right cache
++     */
++    private String name = "";
++
++    /**
+      * Create a new Cache
+      *
+      * @param useMemoryCaching Specify if the memory caching is going to be used
+@@ -142,7 +148,22 @@
+ 
+         this.blocking = blocking;
+     }
+-    
++
++    /*
++     * @return the name of the cache
++     */
++    public String getName() {
++        return name;
++    }
++
++    /*
++     * Sets the name of the cache
++     * @name name to be set
++     */
++    public void setName(String name) {
++        this.name = name;
++   }
++
+     /**
+      * @return the maximum number of items to cache can hold.
+      */

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/XWiki.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -35,6 +35,8 @@
 import com.xpn.xwiki.api.Document;
 import com.xpn.xwiki.api.User;
 import com.xpn.xwiki.cache.api.XWikiCacheService;
+import com.xpn.xwiki.cache.api.XWikiCache;
+import com.xpn.xwiki.cache.api.XWikiCacheNeedsRefreshException;
 import com.xpn.xwiki.cache.impl.OSCacheService;
 import com.xpn.xwiki.cache.impl.XWikiCacheListener;
 import com.xpn.xwiki.doc.XWikiAttachment;
@@ -117,8 +119,8 @@
     private XWikiRightService rightService;
     private XWikiGroupService groupService;
     private XWikiStatsService statsService;
-    private XWikiCacheService cacheService;
     private XWikiURLFactoryService urlFactoryService;
+    private static XWikiCacheService cacheService;
 
     private MetaClass metaclass = MetaClass.getMetaClass();
     private boolean test = false;
@@ -131,7 +133,7 @@
 
     // These are caches in order to improve finding virtual wikis
     private List virtualWikiList = new ArrayList();
-    private static Map virtualWikiMap = new HashMap();
+    private XWikiCache virtualWikiMap;
     private static Map threadMap = new HashMap();
 
     private boolean isReadOnly = false;
@@ -258,6 +260,10 @@
         return virtualWikiList;
     }
 
+    public XWikiCache getVirtualWikiMap() {
+        return virtualWikiMap;
+    }
+
     public synchronized static XWiki getXWiki(XWikiContext context) throws XWikiException {
         XWiki xwiki = getMainXWiki(context);
 
@@ -274,9 +280,9 @@
             if (host.equals(""))
                 return xwiki;
 
-            String appname = findWikiServer(host, context);
+            String appname = xwiki.findWikiServer(host, context);
 
-            if (appname == null) {
+            if (appname.equals("")) {
                 String uri = request.getRequestURI();
                 int i1 = host.indexOf(".");
                 String servername = (i1 != -1) ? host.substring(0, i1) : host;
@@ -346,27 +352,44 @@
         }
     }
 
-    private static String findWikiServer(String host, XWikiContext context) {
-        String wikiserver = (String) virtualWikiMap.get(host);
-        if (wikiserver != null)
-            return wikiserver;
-
-        String hql = ", BaseObject as obj, StringProperty as prop where obj.name=doc.fullName"
-                + " and obj.className='XWiki.XWikiServerClass' and prop.id.id = obj.id "
-                + "and prop.id.name = 'server' and prop.value='" + host + "'";
-        try {
-            List list = context.getWiki().getStore().searchDocumentsNames(hql, context);
-            if ((list == null) || (list.size() == 0))
-                return null;
-            String docname = (String) list.get(0);
-            if (!docname.startsWith("XWiki.XWikiServer"))
-                return null;
-            wikiserver = docname.substring("XWiki.XWikiServer".length()).toLowerCase();
-            virtualWikiMap.put(host, wikiserver);
-            return wikiserver;
-        } catch (XWikiException e) {
-            return null;
+    private String findWikiServer(String host, XWikiContext context) throws XWikiException {
+        synchronized (this) {
+            if (virtualWikiMap==null) {
+                int iCapacity = 1000;
+                try {
+                    String capacity = Param("xwiki.virtual.cache.capacity");
+                    if (capacity != null)
+                        iCapacity = Integer.parseInt(capacity);
+                } catch (Exception e) {
+                }
+                virtualWikiMap = getCacheService().newCache("xwiki.virtual.cache", iCapacity);
+            }
         }
+        synchronized (host) {
+            String wikiserver = "";
+            try {
+                wikiserver = (String) virtualWikiMap.getFromCache(host);
+                return wikiserver;
+            } catch (XWikiCacheNeedsRefreshException e) {
+                virtualWikiMap.cancelUpdate(host);
+                String hql = ", BaseObject as obj, StringProperty as prop where obj.name=doc.fullName"
+                        + " and obj.className='XWiki.XWikiServerClass' and prop.id.id = obj.id "
+                        + "and prop.id.name = 'server' and prop.value='" + host + "'";
+                try {
+                    List list = context.getWiki().getStore().searchDocumentsNames(hql, context);
+                    if ((list != null) && (list.size() > 0))
+                    {
+                        String docname = (String) list.get(0);
+                        if (docname.startsWith("XWiki.XWikiServer"))
+                            wikiserver = docname.substring("XWiki.XWikiServer".length()).toLowerCase();
+                    }
+                    virtualWikiMap.putInCache(host, wikiserver);
+                    return wikiserver;
+                } catch (XWikiException e2) {
+                    return null;
+                }
+            }
+        }
     }
 
     public static String getServerWikiPage(String servername) {
@@ -499,10 +522,12 @@
             getStatsService(context);
         }
 
-        // Add a notification rule if the preference property plugin is modified
+        // Add a notification for notifications
         getNotificationManager().addGeneralRule(
                 new XWikiActionRule(new XWikiPageNotification()));
 
+        // Add rule to get informed of new servers
+        getNotificationManager().addGeneralRule(new DocObjectChangedRule(this, "XWiki.XWikiServerClass"));
 
         String ro = Param("xwiki.readonly", "no");
         isReadOnly = ("yes".equalsIgnoreCase(ro) || "true".equalsIgnoreCase(ro) || "1".equalsIgnoreCase(ro));
@@ -1386,7 +1411,8 @@
         // We need to flush the virtual wiki list
         virtualWikiList = new ArrayList();
         // We need to flush the server Cache
-        virtualWikiMap = new HashMap();
+        virtualWikiMap.flushAll();
+        virtualWikiMap = null;
 
         // We need to flush the group service cache
         if (groupService != null)
@@ -1446,8 +1472,32 @@
                 preparePlugins(context);
             }
         }
+
+        flushVirtualWikis(olddoc);
+        flushVirtualWikis(newdoc);
     }
 
+    private void flushVirtualWikis(XWikiDocument doc) {
+        List bobjects = doc.getObjects("XWiki.XWikiServerClass");
+        if (bobjects!=null) {
+            Iterator it = bobjects.iterator();
+            while (it.hasNext()) {
+                BaseObject bobj = (BaseObject) it.next();
+                if (bobj!=null) {
+                    String host = bobj.getStringValue("server");
+                    if ((host!=null)&&(!"".equals(host))) {
+                        try {
+                            if (virtualWikiMap.getFromCache(host)!=null)
+                                virtualWikiMap.flushEntry(host);
+                        } catch (XWikiCacheNeedsRefreshException e) {
+                            virtualWikiMap.cancelUpdate(host);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     public synchronized BaseClass getUserClass(XWikiContext context) throws XWikiException {
         XWikiDocument doc;
         boolean needsUpdate = false;
@@ -1969,8 +2019,8 @@
         }
 
         try {
-            XWikiGroupService gservice = (XWikiGroupService) getGroupService();
-            gservice.addUserToGroup(fullwikiname, context.getDatabase(), "XWiki.XWikiAllGroup");
+            XWikiGroupService gservice = (XWikiGroupService) getGroupService(context);
+            gservice.addUserToGroup(fullwikiname, context.getDatabase(), "XWiki.XWikiAllGroup", context);
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -2146,6 +2196,7 @@
 
     public void deleteDocument(XWikiDocument doc, XWikiContext context) throws XWikiException {
         getStore().deleteXWikiDoc(doc, context);
+        getNotificationManager().verify(doc, new XWikiDocument(doc.getWeb(), doc.getName()), XWikiDocChangeNotificationInterface.EVENT_CHANGE, context);
     }
 
     public String getDatabase() {
@@ -2434,6 +2485,9 @@
             // Verify is server page already exist
             XWikiDocument serverdoc = getDocument("XWiki", wikiServerPage, context);
             if (serverdoc.isNew()) {
+                // clear entry in virtual wiki cache
+                virtualWikiMap.flushEntry(wikiUrl);
+                
                 // Create Wiki Server page
                 serverdoc.setStringValue("XWiki.XWikiServerClass", "server", wikiUrl);
                 serverdoc.setLargeStringValue("XWiki.XWikiServerClass", "owner", wikiAdmin);
@@ -2723,7 +2777,7 @@
         this.rightService = rightService;
     }
 
-    public XWikiGroupService getGroupService() {
+    public XWikiGroupService getGroupService(XWikiContext context) throws XWikiException {
         if (groupService == null) {
             String groupClass;
             if (isExo())
@@ -2733,7 +2787,6 @@
 
             try {
                 groupService = (XWikiGroupService) Class.forName(groupClass).newInstance();
-                groupService.init(this);
             } catch (Exception e) {
                 e.printStackTrace();
                 if (isExo())
@@ -2742,6 +2795,7 @@
                     groupService = new XWikiGroupServiceImpl();
             }
         }
+        groupService.init(this, context);
         return groupService;
     }
 

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiException.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -66,6 +66,7 @@
     public static final int MODULE_XWIKI_DIFF = 13;
     public static final int MODULE_XWIKI_GROOVY = 14;
     public static final int MODULE_XWIKI_NOTIFICATION = 15;
+    public static final int MODULE_XWIKI_CACHE = 16;
 
     public static final int MODULE_PLUGIN_LASZLO = 21;
 
@@ -196,6 +197,8 @@
 
     public static final int ERROR_XWIKI_NOTIFICATION = 15001;
 
+    public static final int ERROR_CACHE_INITIALIZING = 16001;
+
     public static final int ERROR_LASZLO_INVALID_XML = 21001;
     public static final int ERROR_LASZLO_INVALID_DOTDOT = 21002;
 
@@ -315,14 +318,14 @@
         super.printStackTrace(s);
         if (exception != null) {
             s.write("\n\nWrapped Exception:\n\n");
-            if (exception instanceof org.hibernate.JDBCException) {
+            if (exception.getCause()!=null)
+                exception.getCause().printStackTrace(s);
+            else if (exception instanceof org.hibernate.JDBCException) {
                 (((JDBCException) exception).getSQLException()).printStackTrace(s);
             } else if (exception instanceof MethodInvocationException) {
                 (((MethodInvocationException) exception).getWrappedThrowable()).printStackTrace(s);
             } else if (exception instanceof ServletException) {
                 (((ServletException) exception).getRootCause()).printStackTrace(s);
-            } else if (exception instanceof TransformerException) {
-                (((TransformerException) exception).getCause()).printStackTrace(s);
             } else {
                 exception.printStackTrace(s);
             }
@@ -333,14 +336,14 @@
         super.printStackTrace(s);
         if (exception != null) {
             s.print("\n\nWrapped Exception:\n\n");
-            if (exception instanceof org.hibernate.JDBCException) {
+            if (exception.getCause()!=null)
+                exception.getCause().printStackTrace(s);
+            else if (exception instanceof org.hibernate.JDBCException) {
                 (((JDBCException) exception).getSQLException()).printStackTrace(s);
             } else if (exception instanceof MethodInvocationException) {
                 (((MethodInvocationException) exception).getWrappedThrowable()).printStackTrace(s);
             } else if (exception instanceof ServletException) {
                 (((ServletException) exception).getRootCause()).printStackTrace(s);
-            } else if (exception instanceof TransformerException) {
-                (((TransformerException) exception).getCause()).printStackTrace(s);
             } else {
                 exception.printStackTrace(s);
             }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiInterface.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiInterface.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/XWikiInterface.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,25 +1,25 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author vmassol
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author vmassol
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki;
 
@@ -279,7 +279,7 @@
 
     void setRightService(XWikiRightService rightService);
 
-    XWikiGroupService getGroupService();
+    XWikiGroupService getGroupService(XWikiContext context) throws XWikiException;
 
     void setGroupService(XWikiGroupService groupService);
 

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/api/Document.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/api/Document.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/api/Document.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -188,7 +188,7 @@
         return doc.getRenderedContent(context);
     }
 
-    public String getRenderedContent(String text) {
+    public String getRenderedContent(String text) throws XWikiException {
         return doc.getRenderedContent(text, context);
     }
 
@@ -504,7 +504,7 @@
         return doc.displayForm(className, context);
     }
 
-    public String displayRendered(com.xpn.xwiki.api.PropertyClass pclass, String prefix, Collection object) {
+    public String displayRendered(com.xpn.xwiki.api.PropertyClass pclass, String prefix, Collection object) throws XWikiException {
         if ((pclass==null)||(object==null))
             return "";
         return doc.displayRendered(pclass.getBasePropertyClass(), prefix, object.getCollection(), context);

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/api/User.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/api/User.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/api/User.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,24 +1,24 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author kaaloo
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author kaaloo
+ */
 
 
 package com.xpn.xwiki.api;
@@ -46,7 +46,7 @@
     }
     
     public boolean isUserInGroup(String groupName) throws XWikiException {
-    	XWikiGroupService groupService = context.getWiki().getGroupService();
+    	XWikiGroupService groupService = context.getWiki().getGroupService(context);
     	Collection groups = groupService.listGroupsForUser(user.getUser(), context);
     	return groups.contains(groupName);
     }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/api/XWiki.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/api/XWiki.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/api/XWiki.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -557,7 +557,7 @@
         }
     }
 
-    public String renderText(String text, Document doc) {
+    public String renderText(String text, Document doc) throws XWikiException {
         return xwiki.getRenderingEngine().renderText(text, doc.getDoc(), context);
     }
 

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -22,31 +22,56 @@
 package com.xpn.xwiki.cache.api;
 
 import com.xpn.xwiki.XWiki;
+import com.xpn.xwiki.XWikiException;
 
+import java.util.Properties;
+
 public interface XWikiCacheService
 {
     /**
      * Initializes the service
      */
     public void init(XWiki context);
-    
+
     /*
-     * Returns a local only (never clustered) cache
-     */
-    public XWikiCache newLocalCache();
+    * Returns a local only (never clustered) cache
+    */
+    public XWikiCache newLocalCache() throws XWikiException;
 
     /*
      * Returns a local only (never clustered) cache with given capacity
      */
-    public XWikiCache newLocalCache(int capacity);
+    public XWikiCache newLocalCache(int capacity) throws XWikiException;
 
     /*
      * Returns a cache that could be configured to be clustered
      */
-    public XWikiCache newCache();
+    public XWikiCache newCache(String cacheName) throws XWikiException;
 
     /*
      * Returns a cache that could be configured to be clustered with the given capacity
      */
-    public XWikiCache newCache(int capacity);
+    public XWikiCache newCache(String cacheName, int capacity) throws XWikiException;
+
+
+    /*
+     * Returns a custom cache
+     */
+    public XWikiCache newCache(String cacheName, Properties props) throws XWikiException;
+
+    /*
+     * Returns a custom local cache
+     */
+    public XWikiCache newLocalCache(Properties props) throws XWikiException;
+
+    /*
+     * Returns a custom cache with capacity
+     */
+    public XWikiCache newCache(String cacheName, Properties props, int capacity) throws XWikiException;
+
+    /*
+     * Returns a custom local cache with capacity
+     */
+    public XWikiCache newLocalCache(Properties props, int capacity) throws XWikiException;
+
 }

Added: xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/ClusterSharedNotification.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/ClusterSharedNotification.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/ClusterSharedNotification.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -0,0 +1,55 @@
+package com.xpn.xwiki.cache.impl;
+
+import com.opensymphony.oscache.plugins.clustersupport.ClusterNotification;
+
+import java.io.Serializable;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: ldubost
+ * Date: 30 juil. 2006
+ * Time: 17:22:32
+ * To change this template use File | Settings | File Templates.
+ */
+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+
+/**
+ * A notification message that holds information about a cache event. This
+ * class is <code>Serializable</code> to allow it to be sent across the
+ * network to other machines running in a cluster.
+ *
+ * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
+ * @author $Author: dres $
+ * @version $Revision: 1.1 $
+ */
+public class ClusterSharedNotification extends ClusterNotification {
+
+    protected String cacheName;
+
+    /**
+     * Creates a new notification message object to broadcast to other
+     * listening nodes in the cluster.
+     *
+     * @param type       The type of notification message. Valid types are
+     *                   {@link #FLUSH_KEY} and {@link #FLUSH_GROUP}.
+     * @param data       Specifies the object key or group name to flush.
+     */
+    public ClusterSharedNotification(String cacheName, int type, Serializable data) {
+        super(type, data);
+        this.cacheName = cacheName;
+    }
+
+
+    public String getCacheName() {
+        return cacheName;
+    }
+
+    public String toString() {
+        StringBuffer buf = new StringBuffer();
+        buf.append("cacheName=").append(cacheName).append(super.toString());
+        return buf.toString();
+    }
+}

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -16,6 +16,7 @@
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.cache.api.XWikiCacheNeedsRefreshException;
 import com.xpn.xwiki.XWiki;
+import com.xpn.xwiki.XWikiException;
 
 /**
  * Copyright 2006, XpertNet SARL, and individual contributors as indicated by
@@ -52,12 +53,16 @@
     private String                    name;
     private int                       capacity;
 
-    public OSCacheCache(Properties props)
+    public OSCacheCache(Properties props)  throws XWikiException
     {
-        cacheAdmin = new GeneralCacheAdministrator(props);
+        try {
+          cacheAdmin = new GeneralCacheAdministrator(props);
+        } catch (Throwable e) {
+          throw new XWikiException(XWikiException.MODULE_XWIKI_CACHE, XWikiException.ERROR_CACHE_INITIALIZING, "Exception while initializing cache", e);  
+        }
     }
 
-    public OSCacheCache(Properties props, int capacity)
+    public OSCacheCache(Properties props, int capacity) throws XWikiException
     {
         this(props);
         cacheAdmin.setCacheCapacity(capacity);
@@ -151,7 +156,7 @@
      */
     public int getNumberEntries()
     {
-        return cacheAdmin.getCache().getNbEntries();
+        return cacheAdmin.getCache().getSize();
     }
 
     public void setName(String name)

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -6,16 +6,13 @@
 import java.lang.ref.WeakReference;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
+import java.util.*;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import com.xpn.xwiki.XWiki;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.cache.api.XWikiCacheService;
 
@@ -79,33 +76,66 @@
         log.info("Initialized OSCacheService");
     }
     
-    public XWikiCache newLocalCache()
+    public XWikiCache newLocalCache() throws XWikiException
     {
         return new OSCacheCache(localCacheProperties);
     }
 
-    public XWikiCache newLocalCache(int capacity)
+    public XWikiCache newLocalCache(int capacity) throws XWikiException
     {
         return new OSCacheCache(localCacheProperties, capacity);
     }
 
-    public XWikiCache newCache(Properties props)
+    public XWikiCache newCache(String cacheName, Properties props) throws XWikiException
     {
-        OSCacheCache cc = new OSCacheCache(props);
+        OSCacheCache cc = new OSCacheCache(mergeProperties(props, localCacheProperties));
+        cc.setName(cacheName);
         initCache(cc);
         return cc;
     }
 
-    public XWikiCache newCache()
+    public XWikiCache newLocalCache(Properties props) throws XWikiException
     {
+        OSCacheCache cc = new OSCacheCache(mergeProperties(props, cacheProperties));
+        initCache(cc);
+        return cc;
+    }
+
+    public XWikiCache newCache(String cacheName, Properties props, int capacity) throws XWikiException {
+        OSCacheCache cc = new OSCacheCache(mergeProperties(props, localCacheProperties), capacity);
+        cc.setName(cacheName);
+        initCache(cc);
+        return cc;
+    }
+
+    public XWikiCache newLocalCache(Properties props, int capacity) throws XWikiException {
+        OSCacheCache cc = new OSCacheCache(mergeProperties(props, cacheProperties), capacity);
+        initCache(cc);
+        return cc;
+    }
+
+    private Properties mergeProperties(Properties props, Properties sourceProps) {
+        Properties targetProps = (Properties) sourceProps.clone();
+        Enumeration en = props.keys();
+        while (en.hasMoreElements()) {
+            Object key = en.nextElement();
+            Object value = props.get(key);
+            targetProps.put(key, value);
+        }
+        return targetProps;
+    }
+
+
+    public XWikiCache newCache(String cacheName) throws XWikiException {
         OSCacheCache cc = new OSCacheCache(cacheProperties);
+        cc.setName(cacheName);
         initCache(cc);
         return cc;
     }
 
-    public XWikiCache newCache(int capacity)
-    {
+    public XWikiCache newCache(String cacheName, int capacity) throws XWikiException {
         OSCacheCache cc = new OSCacheCache(cacheProperties, capacity);
+        cc.setName(cacheName);
         initCache(cc);
         return cc;
     }

Added: xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -0,0 +1,324 @@
+package com.xpn.xwiki.cache.impl;
+
+import com.opensymphony.oscache.plugins.clustersupport.ClusterNotification;
+import com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener;
+import com.opensymphony.oscache.base.*;
+import com.opensymphony.oscache.base.events.*;
+import org.jgroups.blocks.NotificationBus;
+import org.jgroups.Channel;
+import org.jgroups.Address;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * <p>A concrete implementation of the {@link com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener} based on
+ * the JavaGroups library. This Class uses JavaGroups to broadcast cache flush
+ * messages across a cluster.</p>
+ *
+ * <p>This variation of the JavaGroupsBroadcastingListerner uses a static NotificationBus which
+ * is shared accross all instances of OSCache using this listerner. In order to work the cache entry keys have to
+ * be unique accross all caches. 
+ *
+ * <p>One of the following properties should be configured in <code>oscache.properties</code> for
+ * this listener:
+ * <ul>
+ * <li><b>cache.cluster.multicast.ip</b> - The multicast IP that JavaGroups should use for broadcasting</li>
+ * <li><b>cache.cluster.properties</b> - The JavaGroups channel properties to use. Allows for precise
+ * control over the behaviour of JavaGroups</li>
+ * </ul>
+ * Please refer to the clustering documentation for further details on the configuration of this listener.</p>
+ *
+ * @author <a href="&#109;a&#105;&#108;&#116;&#111;:chris&#64;swebtec.&#99;&#111;&#109;">Chris Miller</a>
+ * @author Ludovic Dubost ludovic at xwiki.com
+ */
+public class SharedJavaGroupsBroadcastingListener implements NotificationBus.Consumer, CacheEntryEventListener, LifecycleAware {
+    private final static Log log = LogFactory.getLog(JavaGroupsBroadcastingListener.class);
+    private static final String BUS_NAME = "OSCacheBus";
+    private static final String CHANNEL_PROPERTIES = "cache.cluster.properties";
+    private static final String MULTICAST_IP_PROPERTY = "cache.cluster.multicast.ip";
+
+    /**
+     * The name to use for the origin of cluster events. Using this ensures
+     * events are not fired recursively back over the cluster.
+     */
+    protected static final String CLUSTER_ORIGIN = "CLUSTER";
+    protected Map cacheMap = new HashMap();
+
+    /**
+     * The first half of the default channel properties. They default channel properties are:
+     * <pre>
+     * UDP(mcast_addr=*.*.*.*;mcast_port=45566;ip_ttl=32;\
+     * mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
+     * PING(timeout=2000;num_initial_members=3):\
+     * MERGE2(min_interval=5000;max_interval=10000):\
+     * FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
+     * pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
+     * UNICAST(timeout=300,600,1200,2400):\
+     * pbcast.STABLE(desired_avg_gossip=20000):\
+     * FRAG(frag_size=8096;down_thread=false;up_thread=false):\
+     * pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
+     * </pre>
+     *
+     * Where <code>*.*.*.*</code> is the specified multicast IP, which defaults to <code>231.12.21.132</code>.
+     */
+    private static final String DEFAULT_CHANNEL_PROPERTIES_PRE = "UDP(mcast_addr=";
+
+    /**
+     * The second half of the default channel properties. They default channel properties are:
+     * <pre>
+     * UDP(mcast_addr=*.*.*.*;mcast_port=45566;ip_ttl=32;\
+     * mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
+     * PING(timeout=2000;num_initial_members=3):\
+     * MERGE2(min_interval=5000;max_interval=10000):\
+     * FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
+     * pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
+     * UNICAST(timeout=300,600,1200,2400):\
+     * pbcast.STABLE(desired_avg_gossip=20000):\
+     * FRAG(frag_size=8096;down_thread=false;up_thread=false):\
+     * pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
+     * </pre>
+     *
+     * Where <code>*.*.*.*</code> is the specified multicast IP, which defaults to <code>231.12.21.132</code>.
+     */
+    private static final String DEFAULT_CHANNEL_PROPERTIES_POST = ";mcast_port=45566;ip_ttl=32;mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" + "PING(timeout=2000;num_initial_members=3):MERGE2(min_interval=5000;max_interval=10000):FD_SOCK:VERIFY_SUSPECT(timeout=1500):" + "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):UNICAST(timeout=300,600,1200,2400):pbcast.STABLE(desired_avg_gossip=20000):" + "FRAG(frag_size=8096;down_thread=false;up_thread=false):pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)";
+    private static final String DEFAULT_MULTICAST_IP = "231.12.21.132";
+    private static NotificationBus bus = null;
+    private static int busCount = 0;
+
+    /**
+     * Initializes the broadcasting listener by starting up a JavaGroups notification
+     * bus instance to handle incoming and outgoing messages.
+     *
+     * @param config An OSCache configuration object.
+     * @throws com.opensymphony.oscache.base.InitializationException If this listener has
+     * already been initialized.
+     */
+    public synchronized void initialize(Cache cache, Config config) throws InitializationException {
+        String name = cache.getName();
+        if (cacheMap.get(name)!=null) {
+            if (log.isErrorEnabled())
+                log.error("A cache with name " + name + " has already been registered");
+        }
+        cacheMap.put(name, cache);
+
+        String properties = config.getProperty(CHANNEL_PROPERTIES);
+        String multicastIP = config.getProperty(MULTICAST_IP_PROPERTY);
+
+        if ((properties == null) && (multicastIP == null)) {
+            multicastIP = DEFAULT_MULTICAST_IP;
+        }
+
+        if (properties == null) {
+            properties = DEFAULT_CHANNEL_PROPERTIES_PRE + multicastIP.trim() + DEFAULT_CHANNEL_PROPERTIES_POST;
+        } else {
+            properties = properties.trim();
+        }
+
+        if (log.isInfoEnabled()) {
+            log.info("Starting a new JavaGroups broadcasting listener with properties=" + properties);
+        }
+
+        try {
+            if (bus==null) {
+                bus = new NotificationBus(BUS_NAME, properties);
+                bus.start();
+                bus.getChannel().setOpt(Channel.LOCAL, new Boolean(false));
+                bus.setConsumer(this);
+            }
+            busCount++;
+            log.info("JavaGroups clustering support started successfully");
+        } catch (Exception e) {
+            throw new InitializationException("Initialization failed: " + e);
+        }
+    }
+
+
+    public Cache getCache(String cacheName) {
+        return (Cache) cacheMap.get(cacheName);
+    }
+
+    public void cacheEntryAdded(CacheEntryEvent cacheEntryEvent) {
+    }
+
+    public void cacheEntryRemoved(CacheEntryEvent cacheEntryEvent) {
+    }
+
+    public void cacheEntryUpdated(CacheEntryEvent cacheEntryEvent) {
+    }
+
+    /**
+     * Event fired when an entry is flushed from the cache. This broadcasts
+     * the flush message to any listening nodes on the network.
+     */
+    public void cacheEntryFlushed(CacheEntryEvent event) {
+        if (!Cache.NESTED_EVENT.equals(event.getOrigin()) && !CLUSTER_ORIGIN.equals(event.getOrigin())) {
+            if (log.isDebugEnabled()) {
+                log.debug("cacheEntryFlushed called (" + event + ")");
+            }
+
+            sendNotification(new ClusterSharedNotification(event.getMap().getName(), ClusterNotification.FLUSH_KEY, event.getKey()));
+        }
+    }
+
+    /**
+     * Event fired when an entry is removed from the cache. This broadcasts
+     * the remove method to any listening nodes on the network, as long as
+     * this event wasn't from a broadcast in the first place.
+     */
+    public void cacheGroupFlushed(CacheGroupEvent event) {
+        if (!Cache.NESTED_EVENT.equals(event.getOrigin()) && !CLUSTER_ORIGIN.equals(event.getOrigin())) {
+            if (log.isDebugEnabled()) {
+                log.debug("cacheGroupFushed called (" + event + ")");
+            }
+
+            sendNotification(new ClusterSharedNotification(event.getMap().getName(), ClusterNotification.FLUSH_GROUP, event.getGroup()));
+        }
+    }
+
+    public void cachePatternFlushed(CachePatternEvent event) {
+        if (!Cache.NESTED_EVENT.equals(event.getOrigin()) && !CLUSTER_ORIGIN.equals(event.getOrigin())) {
+            if (log.isDebugEnabled()) {
+                log.debug("cachePatternFushed called (" + event + ")");
+            }
+
+            sendNotification(new ClusterSharedNotification(event.getMap().getName(), ClusterNotification.FLUSH_PATTERN, event.getPattern()));
+        }
+    }
+
+    public void cacheFlushed(CachewideEvent event) {
+        if (!Cache.NESTED_EVENT.equals(event.getOrigin()) && !CLUSTER_ORIGIN.equals(event.getOrigin())) {
+            if (log.isDebugEnabled()) {
+                log.debug("cacheFushed called (" + event + ")");
+            }
+
+            sendNotification(new ClusterSharedNotification(event.getCache().getName(), ClusterNotification.FLUSH_CACHE, event.getDate()));
+        }
+    }
+
+    /**
+     * Handles incoming notification messages. This method should be called by the
+     * underlying broadcasting implementation when a message is received from another
+     * node in the cluster.
+     *
+     * @param message The incoming cluster notification message object.
+     */
+    public void handleClusterNotification(ClusterSharedNotification message) {
+        Cache cache = getCache(message.getCacheName());
+        if (cache == null) {
+            log.warn("A cluster notification (" + message + ") was received, but the cache named " + message.getCacheName() + " is not registered on this machine. Notification ignored.");
+
+            return;
+        }
+
+        if (log.isInfoEnabled()) {
+            log.info("Cluster notification (" + message + ") was received.");
+        }
+
+        switch (message.getType()) {
+            case ClusterNotification.FLUSH_KEY:
+                cache.flushEntry((String) message.getData(), CLUSTER_ORIGIN);
+                break;
+            case ClusterNotification.FLUSH_GROUP:
+                cache.flushGroup((String) message.getData(), CLUSTER_ORIGIN);
+                break;
+            case ClusterNotification.FLUSH_PATTERN:
+                cache.flushPattern((String) message.getData(), CLUSTER_ORIGIN);
+                break;
+            case ClusterNotification.FLUSH_CACHE:
+                cache.flushAll((Date) message.getData(), CLUSTER_ORIGIN);
+                break;
+            default:
+                log.error("The cluster notification (" + message + ") is of an unknown type. Notification ignored.");
+        }
+    }
+
+    /**
+     * Shuts down the JavaGroups being managed by this listener. This
+     * occurs once the cache is shut down and this listener is no longer
+     * in use.
+     *
+     * @throws com.opensymphony.oscache.base.FinalizationException
+     */
+    public synchronized void finialize() throws FinalizationException {
+        if (log.isInfoEnabled()) {
+            log.info("JavaGroups shutting down...");
+        }
+
+        // It's possible that the notification bus is null (CACHE-154)
+        if (bus != null) {
+            busCount--;
+            if (busCount==0)
+                bus.stop();
+            bus = null;
+        } else {
+            log.warn("Notification bus wasn't initialized or finialize was invoked before!");
+        }
+
+        if (log.isInfoEnabled()) {
+            log.info("JavaGroups shutdown complete.");
+        }
+    }
+
+    /**
+     * Uses JavaGroups to broadcast the supplied notification message across the cluster.
+     *
+     * @param message The cluster nofication message to broadcast.
+     */
+    protected void sendNotification(ClusterSharedNotification message) {
+        bus.sendNotification(message);
+    }
+
+    /**
+     * Handles incoming notification messages from JavaGroups. This method should
+     * never be called directly.
+     *
+     * @param serializable The incoming message object. This must be a {@link ClusterNotification}.
+     */
+    public void handleNotification(Serializable serializable) {
+        if (!(serializable instanceof ClusterNotification)) {
+            log.error("An unknown cluster notification message received (class=" + serializable.getClass().getName() + "). Notification ignored.");
+
+            return;
+        }
+
+        handleClusterNotification((ClusterSharedNotification) serializable);
+    }
+
+    /**
+     * We are not using the caching, so we just return something that identifies
+     * us. This method should never be called directly.
+     */
+    public Serializable getCache() {
+        return "JavaGroupsBroadcastingListener: " + bus.getLocalAddress();
+    }
+
+    /**
+     * A callback that is fired when a new member joins the cluster. This
+     * method should never be called directly.
+     *
+     * @param address The address of the member who just joined.
+     */
+    public void memberJoined(Address address) {
+        if (log.isInfoEnabled()) {
+            log.info("A new member at address '" + address + "' has joined the cluster");
+        }
+    }
+
+    /**
+     * A callback that is fired when an existing member leaves the cluster.
+     * This method should never be called directly.
+     *
+     * @param address The address of the member who left.
+     */
+    public void memberLeft(Address address) {
+        if (log.isInfoEnabled()) {
+            log.info("Member at address '" + address + "' left the cluster");
+        }
+    }
+}
+

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1883,7 +1883,7 @@
         }
     }
 
-    public String displayRendered(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context) {
+    public String displayRendered(PropertyClass pclass, String prefix, BaseCollection object, XWikiContext context) throws XWikiException {
         String result = pclass.displayView(pclass.getName(), prefix, object, context);
         return getRenderedContent(result, context);
     }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/notify/DocObjectChangedRule.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/notify/DocObjectChangedRule.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/notify/DocObjectChangedRule.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,24 +1,24 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki.notify;
 
@@ -54,10 +54,12 @@
         if (vobj1.size()!=vobj2.size())
             return false;
         for (int i=0;i<vobj1.size();i++) {
-            if ((vobj1.get(i)==null)&&(vobj2.get(i)!=null))
-                return false;
-            if (!vobj1.get(i).equals(vobj2.get(i)))
-                return false;
+            if (!((vobj1.get(i)==null)&&(vobj2.get(i)==null))) {
+                if ((vobj1.get(i)==null)||(vobj2.get(i)==null))
+                    return false;
+                if (!vobj1.get(i).equals(vobj2.get(i)))
+                    return false;
+            }
         }
         return true;
     }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -27,7 +27,7 @@
                     notifyPage(notifpages2[i], rule, doc, action, context);
                 }
             }
-            String xnotif = context.getRequest().getParameter("xnotification");
+            String xnotif = (context.getRequest()!=null) ? context.getRequest().getParameter("xnotification") : null;
             if ((xnotif!=null)&&(!xnotif.equals(""))) {
               notifyPage(xnotif, rule, doc, action, context);
             }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -31,7 +31,7 @@
     public List getList(XWikiContext context) {
         List list;
         try {
-            list = context.getWiki().getGroupService().listAllGroups(context);
+            list = context.getWiki().getGroupService(context).listAllGroups(context);
         } catch (XWikiException e) {
             // TODO add log exception
             list = new ArrayList();

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -31,7 +31,7 @@
     public List getList(XWikiContext context) {
         List list;
         try {
-            list = context.getWiki().getGroupService().listMemberForGroup(null, context);
+            list = context.getWiki().getGroupService(context).listMemberForGroup(null, context);
         } catch (XWikiException e) {
             // TODO add log exception
             list = new ArrayList();

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -23,6 +23,7 @@
 package com.xpn.xwiki.plugin;
 
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.api.Api;
 import com.xpn.xwiki.doc.XWikiAttachment;
 

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,28 +1,29 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author moghrabix
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author moghrabix
+ */
 
 package com.xpn.xwiki.plugin;
 
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.api.Api;
 import com.xpn.xwiki.doc.XWikiAttachment;
 
@@ -32,7 +33,7 @@
 
     void setClassName(String name);
     void setName(String name);
-    void init(XWikiContext context);
+    void init(XWikiContext context) throws XWikiException;
     void virtualInit(XWikiContext context);
 
     /*

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -32,8 +32,6 @@
 import org.apache.commons.logging.LogFactory;
 
 import com.sun.syndication.feed.synd.*;
-import com.sun.syndication.io.SyndFeedInput;
-import com.sun.syndication.io.XmlReader;
 import com.sun.syndication.fetcher.FeedFetcher;
 import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
 import com.xpn.xwiki.XWikiContext;
@@ -43,7 +41,6 @@
 import com.xpn.xwiki.api.Api;
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.cache.api.XWikiCacheNeedsRefreshException;
-import com.xpn.xwiki.cache.impl.OSCacheCache;
 import com.xpn.xwiki.plugin.XWikiDefaultPlugin;
 import com.xpn.xwiki.plugin.XWikiPluginInterface;
 
@@ -103,14 +100,39 @@
     public void flushCache() {
         if (feedCache!=null)
             feedCache.flushAll();
+        feedCache = null;
     }
 
     public void init(XWikiContext context) {
         super.init(context);
-        feedCache = context.getWiki().getCacheService().newLocalCache();
+        prepareCache(context);
         refreshPeriod = (int) context.getWiki().ParamAsLong("xwiki.plugins.feed.cacherefresh", 3600);
     }
 
+
+    public void initCache(XWikiContext context) throws XWikiException {
+        int iCapacity = 100;
+        try {
+            String capacity = context.getWiki().Param("xwiki.plugins.feed.cache.capacity");
+            if (capacity != null)
+                iCapacity = Integer.parseInt(capacity);
+        } catch (Exception e) {}
+
+        initCache(iCapacity, context);
+    }
+
+    public void initCache(int iCapacity, XWikiContext context) throws XWikiException {
+            feedCache = context.getWiki().getCacheService().newLocalCache(iCapacity);
+    }
+
+    protected void prepareCache(XWikiContext context) {
+        try {
+            if (feedCache==null)
+                initCache(context);
+        } catch (XWikiException e) {
+        }
+    }
+
     public SyndFeed getFeeds(String sfeeds, XWikiContext context) throws IOException {
             return getFeeds(sfeeds, true, context);
     }
@@ -161,13 +183,15 @@
 
     public SyndFeed getFeed(String sfeed, boolean ignoreInvalidFeeds, boolean force, XWikiContext context) throws IOException {
         SyndFeed feed = null;
-        if (!force)
-        try {
-          feed = (SyndFeed) feedCache.getFromCache(sfeed, refreshPeriod);
+        prepareCache(context);
+        if (!force) {
+            try {
+                feed = (SyndFeed) feedCache.getFromCache(sfeed, refreshPeriod);
 
-        } catch (XWikiCacheNeedsRefreshException e) {
-            feedCache.cancelUpdate(sfeed);
-        } catch (Exception e) {
+            } catch (XWikiCacheNeedsRefreshException e) {
+                feedCache.cancelUpdate(sfeed);
+            } catch (Exception e) {
+            }
         }
 
         if (feed==null)

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,24 +1,24 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author sdumitriu
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author sdumitriu
+ */
 
 package com.xpn.xwiki.plugin.flickr;
 
@@ -27,6 +27,7 @@
 
 import com.aetrion.flickr.RequestContext;
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.api.Api;
 import com.xpn.xwiki.plugin.XWikiDefaultPlugin;
 import com.xpn.xwiki.plugin.XWikiPluginInterface;

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -50,15 +50,10 @@
 public class ImagePlugin extends XWikiDefaultPlugin {
     private static final Log log = LogFactory.getLog(ImagePlugin.class);
     private static final int TYPE_JPG = 1;
-
     private static final int TYPE_PNG = 2;
-
     private static final int TYPE_BMP = 3;
-
     private static String name = "image";
-
     private XWikiCache imageCache;
-
     private int capacity = 50;
 
     public ImagePlugin(String name, String className, XWikiContext context) {
@@ -78,6 +73,10 @@
 
     public void init(XWikiContext context) {
         super.init(context);
+        initCache(context);
+    }
+
+    public void initCache(XWikiContext context) {
         String capacityParam = "";
         try {
             capacityParam = context.getWiki().Param("xwiki.plugin.image.cache.capacity");
@@ -96,13 +95,17 @@
 
         props.put("cache.persistence.class", "com.opensymphony.oscache.plugins.diskpersistence.DiskPersistenceListener");
         props.put("cache.path", "temp/imageCache");
-        
-        imageCache = new OSCacheCache(props, capacity);
+
+        try {
+            imageCache = context.getWiki().getCacheService().newLocalCache(props, capacity);
+        } catch (XWikiException e) {
+        }
     }
 
     public void flushCache() {
         if (imageCache != null)
             imageCache.flushAll();
+        imageCache = null;
     }
 
     public XWikiAttachment downloadAttachment(XWikiAttachment attachment, XWikiContext context) {
@@ -110,6 +113,10 @@
         int height = 0;
         int width = 0;
         XWikiAttachment attachmentClone = null;
+
+        if (imageCache==null)
+            initCache(context);
+
         try {
             String sheight = context.getRequest().getParameter("height");
             String swidth = context.getRequest().getParameter("width");

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -32,6 +32,7 @@
 import org.apache.jackrabbit.core.query.QueryRootNode;
 
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.api.Api;
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.plugin.XWikiDefaultPlugin;
@@ -43,11 +44,11 @@
 	private static final Log log = LogFactory.getLog(QueryPlugin.class);
 	XWikiCache		cache;
 	XWikiContext	context;
-	public QueryPlugin(String name, String className, XWikiContext context) {
-		super(name, className, context);
-		this.context = context;
-		this.cache = this.context.getWiki().getCacheService().newCache();		
-	}
+	public QueryPlugin(String name, String className, XWikiContext context) throws XWikiException {
+        super(name, className, context);
+        this.context = context;
+        this.cache = this.context.getWiki().getCacheService().newCache("xwiki.plugin.query.cache", 100);
+    }
 	
 	public String getName() { return "query"; }
 

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,28 +1,29 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- */
+/*
+ * Copyright 2006, XpertNet SARL, and individual contributors as indicated
+ * by the contributors.txt.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+ * @author ludovic
+ */
 
 package com.xpn.xwiki.render;
 
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.doc.XWikiDocument;
 
 public interface XWikiRenderer {

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -73,7 +73,7 @@
         initCache(context);
     }
 
-    public void initCache(XWikiContext context) {
+    public void initCache(XWikiContext context) throws XWikiException {
         int iCapacity = 100;
         try {
         String capacity = context.getWiki().Param("xwiki.render.cache.capacity");
@@ -83,9 +83,9 @@
         initCache(iCapacity, context);
     }
 
-    public void initCache(int iCapacity, XWikiContext context) {
+    public void initCache(int iCapacity, XWikiContext context) throws XWikiException {
         XWikiCacheService cacheService = context.getWiki().getCacheService();
-        cache = cacheService.newCache(iCapacity);
+        cache = cacheService.newCache("xwiki.rendering.cache", iCapacity);
     }
 
     public XWikiCache getCache() {
@@ -149,11 +149,17 @@
 
     public String renderText(String text, XWikiDocument contentdoc, XWikiDocument includingdoc, XWikiContext context) {
         String key = getKey(text, contentdoc, includingdoc, context);
+
+        try {
+            if (cache==null)
+                initCache(context);
+        } catch (XWikiException e) {}
+
         synchronized (key) {
             try {
                 XWikiRenderingCache cacheObject = null;
                 try {
-                    cacheObject = (XWikiRenderingCache) cache.getFromCache(key);
+                    cacheObject = (cache!=null) ? (XWikiRenderingCache) cache.getFromCache(key) : null;
                 } catch (XWikiCacheNeedsRefreshException e2) {
                     cache.cancelUpdate(key);
                 }
@@ -241,6 +247,7 @@
         for (int i=0;i<renderers.size();i++)
            ((XWikiRenderer)renderers.get(i)).flushCache();
         cache.flushAll();
+        cache = null;
     }
 
     public String convertMultiLine(String macroname, String params, String data, String allcontent, XWikiVirtualMacro macro, XWikiContext context) {

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -64,22 +64,6 @@
 */
 public class GroovyTemplateEngine extends TemplateEngine {
 
-    private class GTEClassLoader extends ClassLoader {
-        private HashMap classMap = new HashMap();
-
-        public GTEClassLoader(ClassLoader parent) {
-            super(parent);
-        }
-        protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
-            Object cached = classMap.get(name);
-            if (cached!=null) return (Class) cached;
-            ClassLoader parent = getParent();
-            if (parent!=null) return parent.loadClass(name);
-            return super.loadClass(name,resolve);
-        }
-    }
-
-
 /* (non-Javadoc)
 * @see groovy.util.TemplateEngine#createTemplate(java.io.Reader)
 */

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -58,21 +58,6 @@
     private XWikiCache classCache;
 
 
-    private class XWikiRenderingEngineClassLoader extends ClassLoader {
-        private Map classMap = new HashMap();
-
-        public XWikiRenderingEngineClassLoader(ClassLoader parent) {
-            super(parent);
-        }
-        protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
-            Object cached = classMap.get(name);
-            if (cached!=null) return (Class) cached;
-            ClassLoader parent = getParent();
-            if (parent!=null) return parent.loadClass(name);
-            return super.loadClass(name,resolve);
-        }
-    }
-
     public XWikiGroovyRenderer() {
     }
 
@@ -114,24 +99,43 @@
         return gcontext;
     }
 
-    public void initCache(XWikiContext context) {
-            cache = context.getWiki().getCacheService().newLocalCache(100);
-            classCache = context.getWiki().getCacheService().newLocalCache(100);
+    public void initCache(XWikiContext context) throws XWikiException {
+        int iCapacity = 100;
+        try {
+            String capacity = context.getWiki().Param("xwiki.render.groovy.cache.capacity");
+            if (capacity != null)
+                iCapacity = Integer.parseInt(capacity);
+        } catch (Exception e) {}
+
+        int iClassCapacity = 100;
+        try {
+            String capacity = context.getWiki().Param("xwiki.render.groovy.classcache.capacity");
+            if (capacity != null)
+                iCapacity = Integer.parseInt(capacity);
+        } catch (Exception e) {}
+
+
+        initCache(iCapacity, iClassCapacity, context);
     }
 
+    public void initCache(int iCapacity, int iClassCapacity, XWikiContext context) throws XWikiException {
+            cache = context.getWiki().getCacheService().newLocalCache(iCapacity);
+            classCache = context.getWiki().getCacheService().newLocalCache(iClassCapacity);
+    }
+
     protected void prepareCache(XWikiContext context) {
-        if (cache==null) {
-            cache = context.getWiki().getCacheService().newLocalCache(100);
+        try {
+            if ((cache==null)||(classCache==null))
+                initCache(context);
+        } catch (Exception e) {
         }
-        if (classCache==null) {
-            classCache = context.getWiki().getCacheService().newLocalCache(100);
-        }
     }
 
     public String evaluate(String content, String name, Map gcontext) {
         GroovyTemplateEngine engine = new GroovyTemplateEngine();
         Template template = null;
         boolean refresh = false;
+        
         try {
             XWikiRequest request = (XWikiRequest) gcontext.get("request");
             refresh = "1".equals(request.get("refresh"));
@@ -179,6 +183,8 @@
         if (!context.getWiki().getRightService().hasProgrammingRights(contentdoc, context))
             return content;
 
+        prepareCache(context);
+
         Map gcontext = null;
         try {
             String name = contextdoc.getFullName();
@@ -286,12 +292,12 @@
                 gc = cgc.getGroovyClass();
             }
             catch (XWikiCacheNeedsRefreshException e) {
+                classCache.cancelUpdate(script);
                 GroovyClassLoader gcl = new GroovyClassLoader();
                 gc = gcl.parseClass(script);
                 cgc = new CachedGroovyClass(gc);
                 classCache.putInCache(script, cgc);
             } finally {
-                classCache.cancelUpdate(script);
             }
             return gc.newInstance();
         } catch (Exception e) {
@@ -314,7 +320,6 @@
 
         public void finalize() throws Throwable  {
             try {
-                System.out.println("Finalizing: " + cl.toString());
                 if (cl!=null) {
                     InvokerHelper.removeClass(cl);
                     GroovyTemplateEngine.removeClass(cl);

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -29,7 +29,6 @@
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.cache.api.XWikiCacheNeedsRefreshException;
 import com.xpn.xwiki.cache.api.XWikiCacheService;
-import com.xpn.xwiki.doc.XWikiAttachment;
 import com.xpn.xwiki.doc.XWikiDocument;
 import com.xpn.xwiki.doc.XWikiLock;
 import com.xpn.xwiki.objects.classes.BaseClass;
@@ -48,22 +47,21 @@
     private XWikiStoreInterface store;
     private XWikiCache cache;
     private XWikiCache pageExistCache;
-    private XWikiCache classCache;
     private XWikiCache prefsCache;
     private int cacheCapacity = 100;
     private int prefsCacheCapacity = 1000;
     private int pageExistCacheCapacity = 10000;
 
-    public XWikiCacheStore(XWikiStoreInterface store, XWikiContext context) {
+    public XWikiCacheStore(XWikiStoreInterface store, XWikiContext context) throws XWikiException {
         setStore(store);
         initCache(cacheCapacity, pageExistCacheCapacity, getPrefsCacheCapacity(), context);
     }
 
-    public void initCache(int capacity, int pageExistCacheCapacity, int prefsCacheCapacity, XWikiContext context) {
+    public void initCache(int capacity, int pageExistCacheCapacity, int prefsCacheCapacity, XWikiContext context) throws XWikiException {
         XWikiCacheService cacheService = context.getWiki().getCacheService();
-        setCache(cacheService.newCache(capacity));
-        setPageExistCache(cacheService.newCache(pageExistCacheCapacity));
-        setPrefsCache(cacheService.newCache(prefsCacheCapacity));
+        setCache(cacheService.newCache("xwiki.store.pagecache", capacity));
+        setPageExistCache(cacheService.newCache("xwiki.store.pageexistcache",pageExistCacheCapacity));
+        setPrefsCache(cacheService.newCache("xwiki.store.prefscache", prefsCacheCapacity));
     }
 
     public void setCacheCapacity(int capacity) {

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -23,6 +23,7 @@
 package com.xpn.xwiki.store;
 
 import com.xpn.xwiki.XWikiContext;
+import com.xpn.xwiki.XWikiException;
 
 public interface XWikiCacheStoreInterface extends XWikiStoreInterface {
     public XWikiStoreInterface getStore();
@@ -32,5 +33,5 @@
     public void setPageExistCacheCapacity(int capacity);
     public void setPrefsCacheCapacity(int capacity);
     public void initCache(int capacity, int pageExistCapacity,
-                          int prefsCacheCapacity, XWikiContext context);
+                          int prefsCacheCapacity, XWikiContext context) throws XWikiException;
 }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -30,16 +30,13 @@
 import java.util.List;
 
 public interface XWikiGroupService {
-    public void init(XWiki xwiki);
-
+    public void init(XWiki xwiki, XWikiContext context) throws XWikiException;
+    public void initCache(XWikiContext context) throws XWikiException;
+    public void initCache(int iCapacity, XWikiContext context) throws XWikiException;
     public void flushCache();
-
     public Collection listGroupsForUser(String username, XWikiContext context) throws XWikiException;
-
-    public void addUserToGroup(String user, String database, String group) throws XWikiException;
-
+    public void addUserToGroup(String user, String database, String group, XWikiContext context) throws XWikiException;
     public List listMemberForGroup(String s, XWikiContext context) throws XWikiException;
-
     public List listAllGroups(XWikiContext context) throws XWikiException;
 
 }

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -28,6 +28,7 @@
 import com.xpn.xwiki.cache.api.XWikiCache;
 import com.xpn.xwiki.cache.api.XWikiCacheService;
 import com.xpn.xwiki.user.api.XWikiGroupService;
+import com.xpn.xwiki.user.impl.xwiki.XWikiGroupServiceImpl;
 import org.exoplatform.commons.utils.PageList;
 import org.exoplatform.container.PortalContainer;
 import org.exoplatform.services.organization.*;
@@ -37,10 +38,13 @@
 import java.util.Iterator;
 import java.util.List;
 
-public class ExoGroupServiceImpl implements XWikiGroupService {
+public class ExoGroupServiceImpl extends XWikiGroupServiceImpl implements XWikiGroupService {
     private static OrganizationService organizationService;
-    private XWikiCache groupCache;
 
+    public void init(XWiki xwiki, XWikiContext context) throws XWikiException {
+        super.init(xwiki, context);
+    }
+
     protected GroupHandler getGroupHandler() {
         if (organizationService == null) {
             organizationService = getOrganizationService();
@@ -77,15 +81,7 @@
         return organizationService.getMembershipTypeHandler();
     }
 
-    public void init(XWiki xwiki) {
-        XWikiCacheService cacheService = xwiki.getCacheService();
-        groupCache = cacheService.newCache();
-    }
 
-    public void flushCache() {
-        groupCache.flushAll();
-    }
-
     public Collection listGroupsForUser(String username, XWikiContext context) throws XWikiException {
         GroupHandler groupHandler = getGroupHandler();
         Collection groups = null;
@@ -112,9 +108,8 @@
         }
     }
 
-    public void addUserToGroup(String user, String database, String group) throws XWikiException {
+    public void addUserToGroup(String user, String database, String group, XWikiContext context) throws XWikiException {
         // TODO: test this code
-
         MembershipHandler membershipHandler = getMembershipHandler();
         MembershipTypeHandler memberShipTypeHandler = getMembershipTypeHandler();
         boolean broadcast = false;
@@ -135,6 +130,7 @@
             User username = getUserHandler().findUserByName(user);
             Group groupname = getGroupHandler().findGroupById(group);
             membershipHandler.linkMembership(username, groupname, mst, broadcast);
+            super.addUserToGroup(user, database, group, context);
         } catch (Exception e) {
             Object[] args = {user, group};
             throw new XWikiException(XWikiException.MODULE_XWIKI_ACCESS, XWikiException.ERROR_XWIKI_ACCESS_EXO_EXCEPTION_ADDING_USERS,

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -45,16 +45,31 @@
 import java.util.Vector;
 
 public class XWikiGroupServiceImpl implements XWikiGroupService, XWikiDocChangeNotificationInterface {
-    private XWikiCache groupCache;
+    protected XWikiCache groupCache;
 
-    public void init(XWiki xwiki) {
-        XWikiCacheService cacheService = xwiki.getCacheService();
-        groupCache = cacheService.newCache();
+    public void init(XWiki xwiki, XWikiContext context) throws XWikiException {
+        initCache(context);
         xwiki.getNotificationManager().addGeneralRule(new DocChangeRule(this));
     }
 
+    public void initCache(XWikiContext context) throws XWikiException {
+        int iCapacity = 100;
+        try {
+            String capacity = context.getWiki().Param("xwiki.authentication.group.cache.capacity");
+            if (capacity != null)
+                iCapacity = Integer.parseInt(capacity);
+        } catch (Exception e) {}
+        initCache(iCapacity, context);
+    }
+
+    public void initCache(int iCapacity, XWikiContext context) throws XWikiException {
+        XWikiCacheService cacheService = context.getWiki().getCacheService();
+        groupCache = cacheService.newCache("xwiki.authentication.group.cache", iCapacity);
+    }
+
     public void flushCache() {
         groupCache.flushAll();
+        groupCache = null;
     }
 
     public Collection listGroupsForUser(String username, XWikiContext context) throws XWikiException {
@@ -64,6 +79,8 @@
             String shortname = Util.getName(username);
             String veryshortname = shortname.substring(shortname.indexOf(".") + 1);
             String key = database + ":" + shortname;
+            if (groupCache==null)
+                initCache(context);
             try {
                 list = (List) groupCache.getFromCache(key);
             } catch (XWikiCacheNeedsRefreshException e) {
@@ -84,10 +101,12 @@
     /*
        Adding the user to the group cache
     */
-    public void addUserToGroup(String username, String database, String group) {
+    public void addUserToGroup(String username, String database, String group, XWikiContext context) throws XWikiException {
         String shortname = Util.getName(username);
         List list = null;
         String key = database + ":" + shortname;
+        if (groupCache==null)
+            initCache(context);
         try {
             list = (List) groupCache.getFromCache(key);
         } catch (XWikiCacheNeedsRefreshException e) {
@@ -157,7 +176,7 @@
                     flushCache = true;
 
                 if (flushCache)
-                    groupCache.flushAll();
+                    flushCache();
             }
         } catch (Exception e) {
             e.printStackTrace();

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java	2006-07-30 23:27:07 UTC (rev 1097)
@@ -231,7 +231,7 @@
     }
 
     public boolean checkRight(String name, XWikiDocument doc, String accessLevel,
-                              boolean user, boolean allow, boolean global, XWikiContext context) throws XWikiRightNotFoundException {
+                              boolean user, boolean allow, boolean global, XWikiContext context) throws XWikiRightNotFoundException, XWikiException {
         String className = global ? "XWiki.XWikiGlobalRights" : "XWiki.XWikiRights";
         String fieldName = user ? "users" : "groups";
         boolean found = false;
@@ -337,7 +337,7 @@
         }
 
         Collection grouplist = new ArrayList();
-        XWikiGroupService groupService = context.getWiki().getGroupService();
+        XWikiGroupService groupService = context.getWiki().getGroupService(context);
         String key = context.getDatabase() + ":" + name;
         Collection grouplist1 = (Collection) grouplistcache.get(key);
 

Modified: xwiki/trunk/src/main/web/WEB-INF/oscache.properties
===================================================================
--- xwiki/trunk/src/main/web/WEB-INF/oscache.properties	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/src/main/web/WEB-INF/oscache.properties	2006-07-30 23:27:07 UTC (rev 1097)
@@ -40,7 +40,7 @@
 #                       com.opensymphony.oscache.extra.ScopeEventListenerImpl
 
 # uncomment this to enable clustering
-#cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener,com.xpn.xwiki.cache.impl.XWikiCacheListener
+cache.event.listeners=com.xpn.xwiki.cache.impl.SharedJavaGroupsBroadcastingListener,com.xpn.xwiki.cache.impl.XWikiCacheListener
 
 # CACHE PERSISTENCE CLASS
 #
@@ -130,14 +130,14 @@
 # property is set. See the clustering documentation and the JavaGroups project
 # (www.javagroups.com) for more information on these settings.
 #
-#cache.cluster.properties=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;\
-#mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\
-#PING(timeout=2000;num_initial_members=3):\
-#MERGE2(min_interval=5000;max_interval=10000):\
-#FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
-#pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
-#UNICAST(timeout=300,600,1200,2400):\
-#pbcast.STABLE(desired_avg_gossip=20000):\
-#FRAG(frag_size=8096;down_thread=false;up_thread=false):\
-#pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
-#cache.cluster.multicast.ip=231.12.21.132
+cache.cluster.properties=UDP(bind_addr=127.0.0.1;mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=32;\
+mcast_send_buf_size=150000;mcast_recv_buf_size=80000;enable_diagnostics=false):\
+PING(timeout=2000;num_initial_members=1):\
+MERGE2(min_interval=5000;max_interval=10000):\
+FD_SOCK:VERIFY_SUSPECT(timeout=1500):\
+pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\
+UNICAST(timeout=300,600,1200,2400):\
+pbcast.STABLE(desired_avg_gossip=20000):\
+FRAG(frag_size=8096;down_thread=false;up_thread=false):\
+pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)
+#cache.cluster.multicast.ip=228.1.2.3

Modified: xwiki/trunk/xwiki.iml
===================================================================
--- xwiki/trunk/xwiki.iml	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/xwiki.iml	2006-07-30 23:27:07 UTC (rev 1097)
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module version="4" relativePaths="true" type="J2EE_WEB_MODULE" j2ee-integration="Tomcat Server">
+  <component name="AppServerSpecificValidatorsManager" />
   <component name="ModuleRootManager" />
   <component name="NewModuleRootManager">
     <output url="file://$MODULE_DIR$/build/xwiki" />
@@ -39,12 +40,13 @@
     <orderEntry type="library" name="Servlet API" level="project" />
     <orderEntry type="library" name="JMock" level="project" />
     <orderEntry type="library" name="WebServices" level="project" />
-    <orderEntry type="library" name="Tomcat 5.0" level="application" />
     <orderEntry type="library" name="Chart" level="project" />
     <orderEntry type="library" name="JCR" level="project" />
     <orderEntry type="library" name="XML" level="project" />
+    <orderEntry type="library" name="cache" level="project" />
     <orderEntry type="library" name="Tomcat" level="application_server_libraries" />
-    <orderEntry type="library" name="cache" level="project" />
+    <orderEntry type="library" name="XMPP" level="project" />
+    <orderEntry type="library" name="Tomcat 5.0" level="application" />
     <orderEntryProperties />
   </component>
   <component name="VcsManagerConfiguration">
@@ -158,6 +160,10 @@
       <attribute name="method" value="1" />
       <attribute name="URI" value="/WEB-INF/lib" />
     </containerElement>
+    <containerElement type="library" level="project" name="XMPP">
+      <attribute name="method" value="1" />
+      <attribute name="URI" value="/WEB-INF/lib" />
+    </containerElement>
     <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/web-test.xml" optional="false" version="2.3" />
     <deploymentDescriptor name="context.xml" url="file://$MODULE_DIR$/src/main/web/META-INF/context.xml" optional="false" version="5.x" />
     <deploymentDescriptor name="" url="file://$MODULE_DIR$/src/main/web/META-INF/context.xml" optional="false">

Modified: xwiki/trunk/xwiki.ipr
===================================================================
--- xwiki/trunk/xwiki.ipr	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/xwiki.ipr	2006-07-30 23:27:07 UTC (rev 1097)
@@ -10,13 +10,22 @@
       <properties />
     </buildFile>
   </component>
+  <component name="BuildJarProjectSettings">
+    <option name="BUILD_JARS_ON_MAKE" value="false" />
+  </component>
+  <component name="CodeStyleProjectProfileManger">
+    <option name="PROJECT_PROFILE" />
+    <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+    <scopes />
+    <profiles />
+  </component>
   <component name="CodeStyleSettingsManager">
     <option name="PER_PROJECT_SETTINGS" />
     <option name="USE_PER_PROJECT_SETTINGS" value="false" />
   </component>
   <component name="CompilerConfiguration">
     <option name="DEFAULT_COMPILER" value="Javac" />
-    <option name="CLEAR_OUTPUT_DIRECTORY" value="true" />
+    <option name="CLEAR_OUTPUT_DIRECTORY" value="false" />
     <option name="DEPLOY_AFTER_MAKE" value="2" />
     <resourceExtensions>
       <entry name=".+\.(properties|xml|html|dtd|tld|cfg|txt.1|txt.2|sxw|doc|vm|xsl)" />
@@ -54,6 +63,20 @@
     <option name="myForwardDirection" value="false" />
   </component>
   <component name="DependencyValidationManager" />
+  <component name="EclipseCompilerSettings">
+    <option name="DEBUGGING_INFO" value="true" />
+    <option name="GENERATE_NO_WARNINGS" value="true" />
+    <option name="DEPRECATION" value="false" />
+    <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+    <option name="MAXIMUM_HEAP_SIZE" value="128" />
+  </component>
+  <component name="EclipseEmbeddedCompilerSettings">
+    <option name="DEBUGGING_INFO" value="true" />
+    <option name="GENERATE_NO_WARNINGS" value="true" />
+    <option name="DEPRECATION" value="false" />
+    <option name="ADDITIONAL_OPTIONS_STRING" value="" />
+    <option name="MAXIMUM_HEAP_SIZE" value="128" />
+  </component>
   <component name="EntryPointsManager">
     <entry_points />
   </component>
@@ -63,6 +86,7 @@
     <option name="OUTPUT_DIRECTORY" />
   </component>
   <component name="GUI Designer component loader factory" />
+  <component name="IdProvider" IDEtalkID="8CA5FF5B0D5DF7DE366CFA9ED4BB41A7" />
   <component name="ImportConfiguration">
     <option name="VENDOR" value="XPERTNET" />
     <option name="RELEASE_TAG" value="XPERTNET_0_1" />
@@ -71,6 +95,35 @@
     <option name="KEYWORD_SUBSTITUTION_WRAPPERS" value="aj kv;bat kv;cfg kv;cgi kv;class b;cmd kv;conf kv;css kv;dtd kv;ear b;form kv;hs kv;htm kv;html kv;idl kv;iml kv;ipr kv;iws kv;jar b;java kv;jhm kv;jnlp kv;js kv;jsf kv;jsp kv;jspf kv;log kv;mf kv;pl kv;pm kv;policy kv;properties kv;sh kv;sht kv;shtm kv;shtml kv;sql kv;tld kv;txt kv;vm kv;war b;wsdl kv;xhtml kv;xml kv;xsd kv;xsl kv;zip b;" />
     <option name="MAKE_NEW_FILES_READ_ONLY" value="false" />
   </component>
+  <component name="InspectionProjectProfileManager">
+    <option name="PROJECT_PROFILE" value="Project Default" />
+    <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
+    <scopes />
+    <profiles>
+      <profile version="1.0">
+        <option name="myName" value="Project Default" />
+        <option name="myLocal" value="false" />
+        <used_levels>
+          <error>
+            <option name="myName" value="ERROR" />
+            <option name="myVal" value="400" />
+          </error>
+          <warning>
+            <option name="myName" value="WARNING" />
+            <option name="myVal" value="300" />
+          </warning>
+          <information>
+            <option name="myName" value="INFO" />
+            <option name="myVal" value="200" />
+          </information>
+          <server>
+            <option name="myName" value="SERVER PROBLEM" />
+            <option name="myVal" value="100" />
+          </server>
+        </used_levels>
+      </profile>
+    </profiles>
+  </component>
   <component name="J2EEManager" />
   <component name="JavacSettings">
     <option name="DEBUGGING_INFO" value="true" />
@@ -103,6 +156,12 @@
     <option name="IS_EMACS_ERRORS_MODE" value="true" />
     <option name="ADDITIONAL_OPTIONS_STRING" value="" />
   </component>
+  <component name="LogConsolePreferences">
+    <option name="FILTER_ERRORS" value="false" />
+    <option name="FILTER_WARNINGS" value="false" />
+    <option name="FILTER_INFO" value="true" />
+    <option name="CUSTOM_FILTER" />
+  </component>
   <component name="Palette2">
     <group name="Swing">
       <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false">
@@ -205,6 +264,23 @@
       <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false">
         <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
       </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
     </group>
   </component>
   <component name="ProjectModuleManager">
@@ -214,6 +290,7 @@
     </modules>
   </component>
   <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.5" />
+  <component name="ProjectRunConfigurationManager" />
   <component name="RegexPlugin">
     <option name="pos1" value="92" />
     <option name="pos2" value="100" />
@@ -228,7 +305,9 @@
     <option name="GENERATE_IIOP_STUBS" value="false" />
     <option name="ADDITIONAL_OPTIONS_STRING" value="" />
   </component>
+  <component name="StarteamVcsAdapter" />
   <component name="UI designer component loader factory" />
+  <component name="VssVcs" />
   <component name="WebManager">
     <option enabled="true" />
   </component>
@@ -282,9 +361,9 @@
         <root url="jar://$PROJECT_DIR$/lib/c3p0-0.8.4.5.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/hibernate-tools-2.1.3.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/mysql-connector-java-3.1.7-bin.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/jta.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/hsqldb-1.8.0.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/hibernate-3.0.3.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/jta.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/hsqldb-1.7.3.jar!/" />
       </CLASSES>
       <JAVADOC />
       <SOURCES />
@@ -363,12 +442,10 @@
     </library>
     <library name="Groovy">
       <CLASSES>
-        <root url="jar://$PROJECT_DIR$/lib/groovy-all-1.0-jsr-05.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/groovy-all-1.0-jsr-06.jar!/" />
       </CLASSES>
       <JAVADOC />
-      <SOURCES>
-        <root url="file://D:/dev/java/groovy/groovy-1.0-jsr-04/src/main" />
-      </SOURCES>
+      <SOURCES />
     </library>
     <library name="fop">
       <CLASSES>
@@ -474,10 +551,20 @@
     <library name="cache">
       <CLASSES>
         <root url="jar://$PROJECT_DIR$/lib/jgroups-2.2.9.1.jar!/" />
-        <root url="jar://$PROJECT_DIR$/lib/oscache-2.2.jar!/" />
         <root url="jar://$PROJECT_DIR$/lib/concurrent.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/oscache-2.3.2M.jar!/" />
       </CLASSES>
       <JAVADOC />
+      <SOURCES>
+        <root url="file://C:/dev/java/oscache/src/java" />
+      </SOURCES>
+    </library>
+    <library name="XMPP">
+      <CLASSES>
+        <root url="jar://$PROJECT_DIR$/lib/smack.jar!/" />
+        <root url="jar://$PROJECT_DIR$/lib/smackx.jar!/" />
+      </CLASSES>
+      <JAVADOC />
       <SOURCES />
     </library>
   </component>

Modified: xwiki/trunk/xwiki.iws
===================================================================
--- xwiki/trunk/xwiki.iws	2006-07-25 19:53:29 UTC (rev 1096)
+++ xwiki/trunk/xwiki.iws	2006-07-30 23:27:07 UTC (rev 1097)
@@ -17,17 +17,58 @@
     <option name="USE_USER_FILTER" value="false" />
     <option name="USER" value="" />
   </component>
-  <component name="CheckinPanelState">
-    <Excluded key="C:\dev\java\xwiki\src\main\java\com\xpn\xwiki\user\impl\xwiki\MyFormAuthenticator.java" />
-    <Excluded key="C:\dev\java\xwiki\src\main\java\com\xpn\xwiki\user\impl\xwiki\XWikiAuthServiceImpl.java" />
-    <Excluded key="C:\dev\java\xwiki\src\main\java\com\xpn\xwiki\web\XWikiSpecialCache.java" />
-    <Excluded key="C:\dev\java\xwiki\src\main\resources\xwiki.hbm.xml" />
-    <Excluded key="C:\dev\java\xwiki\src\test\resources\hibernate-test.cfg.xml" />
-    <Excluded key="C:\dev\java\xwiki\src\test\resources\xwiki.cfg" />
-    <Excluded key="C:\dev\java\xwiki\xwiki.iml" />
-    <Excluded key="C:\dev\java\xwiki\xwiki.ipr" />
-    <Excluded key="C:\dev\java\xwiki\xwiki.iws" />
+  <component name="ChangeListManager">
+    <list default="true" name="Default" comment="">
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiGroupServiceImpl.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/SharedJavaGroupsBroadcastingListener.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/OSCacheService.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWikiException.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWikiException.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/web/WEB-INF/hibernate.cfg.xml" afterPath="$PROJECT_DIR$/src/main/web/WEB-INF/hibernate.cfg.xml" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/xmpp" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.iws" afterPath="$PROJECT_DIR$/xwiki.iws" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/XWiki.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/XWiki.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/ClusterSharedNotification.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/Document.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/Document.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/build.xml" afterPath="$PROJECT_DIR$/build.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/store/XWikiCacheStore.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/query/QueryPlugin.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/image/ImagePlugin.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWikiInterface.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWikiInterface.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/resources/log4j.properties" afterPath="$PROJECT_DIR$/src/main/resources/log4j.properties" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/XWikiRenderer.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWiki.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/XWiki.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/test/resources/hibernate-test.cfg.xml" afterPath="$PROJECT_DIR$/src/test/resources/hibernate-test.cfg.xml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/store/XWikiCacheStoreInterface.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/objects/classes/UsersClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/feed/FeedPlugin.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/XWikiDefaultPlugin.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/User.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/api/User.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwikibase.iml" afterPath="$PROJECT_DIR$/xwikibase.iml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/api/XWikiGroupService.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/XWikiRenderingEngine.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/notify/XWikiPageNotification.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.iml" afterPath="$PROJECT_DIR$/xwiki.iml" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/impl/OSCacheCache.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/flickr/FlickrPlugin.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/patches/OSCacheCache.diff" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/xwiki.ipr" afterPath="$PROJECT_DIR$/xwiki.ipr" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/objects/classes/GroupsClass.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/groovy/GroovyTemplateEngine.java" />
+      <change type="DELETED" beforePath="C:\dev\java\xwikisvn\xwiki\trunk\lib\oscache-2.3.2.jar" afterPath="" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java" />
+      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/oscache-2.3.2M.jar" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/web/WEB-INF/oscache.properties" afterPath="$PROJECT_DIR$/src/main/web/WEB-INF/oscache.properties" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/xwiki/XWikiRightServiceImpl.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/cache/api/XWikiCacheService.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/web/WEB-INF/version.properties" afterPath="$PROJECT_DIR$/src/main/web/WEB-INF/version.properties" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/render/groovy/XWikiGroovyRenderer.java" />
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java" afterPath="$PROJECT_DIR$/src/main/java/com/xpn/xwiki/plugin/XWikiPluginInterface.java" />
+    </list>
   </component>
+  <component name="ChangeListSynchronizer" />
+  <component name="ChangesViewManager" flattened_view="true" />
+  <component name="CheckinPanelState" />
   <component name="CodeStyleManager">
     <option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true" />
     <option name="CODE_STYLE_SCHEME" value="" />
@@ -43,6 +84,7 @@
     <option name="CLOSE_MESSAGE_VIEW_IF_SUCCESS" value="true" />
     <option name="COMPILE_DEPENDENT_FILES" value="false" />
   </component>
+  <component name="CoverageDataManager" />
   <component name="Cvs2Configuration">
     <option name="PRUNE_EMPTY_DIRECTORIES" value="true" />
     <option name="MERGING_MODE" value="0" />
@@ -436,6 +478,45 @@
         <option name="CONDITION" value="" />
         <option name="LOG_MESSAGE" value="" />
       </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/src/test/java/com/xpn/xwiki/test/StoreTest.java" line="77" class="com.xpn.xwiki.test.StoreTest" package="com.xpn.xwiki.test">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <option name="CLASS_FILTERS_ENABLED" value="false" />
+        <option name="INSTANCE_FILTERS_ENABLED" value="false" />
+        <option name="CONDITION" value="" />
+        <option name="LOG_MESSAGE" value="" />
+      </breakpoint>
+      <breakpoint url="file://$PROJECT_DIR$/src/main/java/com/xpn/xwiki/user/impl/exo/ExoGroupServiceImpl.java" line="44" class="com.xpn.xwiki.user.impl.exo.ExoGroupServiceImpl" package="com.xpn.xwiki.user.impl.exo">
+        <option name="ENABLED" value="true" />
+        <option name="SUSPEND_POLICY" value="SuspendAll" />
+        <option name="LOG_ENABLED" value="false" />
+        <option name="LOG_EXPRESSION_ENABLED" value="false" />
+        <option name="COUNT_FILTER_ENABLED" value="false" />
+        <option name="COUNT_FILTER" value="0" />
+        <option name="CONDITION_ENABLED" value="false" />
+        <o