diff --git a/LoadTesting/pom.xml b/LoadTesting/pom.xml
index a7772598b..5f62720c0 100644
--- a/LoadTesting/pom.xml
+++ b/LoadTesting/pom.xml
@@ -25,11 +25,11 @@
com.celements
celements
- 5.0-SNAPSHOT
+ 7.0-SNAPSHOT
4.0.0
celements-loadTests
- 5.0-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Load Testing
diff --git a/celements-component/pom.xml b/celements-component/pom.xml
index e04fb5525..d4ae5ee11 100644
--- a/celements-component/pom.xml
+++ b/celements-component/pom.xml
@@ -3,18 +3,18 @@
com.celements
base-pom
- 6.3
+ 7.0-SNAPSHOT
4.0.0
celements-component
- 6.2-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Component Manager
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
diff --git a/celements-config-source-api/pom.xml b/celements-config-source-api/pom.xml
index 9692e3ddd..210650711 100644
--- a/celements-config-source-api/pom.xml
+++ b/celements-config-source-api/pom.xml
@@ -3,11 +3,11 @@
com.celements
base-pom
- 6.3
+ 7.0-SNAPSHOT
4.0.0
celements-config-source-api
- 6.3-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Configuration Source API
@@ -15,13 +15,13 @@
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.1
+ 7.0-SNAPSHOT
provided
diff --git a/celements-config-source/pom.xml b/celements-config-source/pom.xml
index 61ff22bdf..8e559cf91 100644
--- a/celements-config-source/pom.xml
+++ b/celements-config-source/pom.xml
@@ -3,11 +3,11 @@
com.celements
base-pom
- 6.3
+ 7.0-SNAPSHOT
4.0.0
celements-config-source
- 6.3-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Configuration Source
@@ -15,31 +15,31 @@
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.1
+ 7.0-SNAPSHOT
provided
com.celements
celements-config-source-api
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-reference
- 6.0
+ 7.0-SNAPSHOT
provided
com.celements
celements-servlet
- 6.2
+ 7.0-SNAPSHOT
provided
diff --git a/celements-global-redirect/pom.xml b/celements-global-redirect/pom.xml
index b1333fa4c..33202251e 100644
--- a/celements-global-redirect/pom.xml
+++ b/celements-global-redirect/pom.xml
@@ -24,29 +24,29 @@
com.celements
celements
- 6.2
+ 7.0-SNAPSHOT
4.0.0
celements-global-redirect
- 6.1-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Global Redirect
com.celements
celements-model
- 6.3
+ 7.0-SNAPSHOT
provided
com.celements
celements-xwiki-core
- 6.4
+ 7.0-SNAPSHOT
provided
com.celements
celements-observation
- 6.1
+ 7.0-SNAPSHOT
provided
diff --git a/celements-keycloak/pom.xml b/celements-keycloak/pom.xml
index 77e635bb6..c6793da2e 100644
--- a/celements-keycloak/pom.xml
+++ b/celements-keycloak/pom.xml
@@ -24,35 +24,35 @@
com.celements
celements
- 6.6
+ 7.0-SNAPSHOT
4.0.0
celements-keycloak
- 6.3-SNAPSHOT
+ 7.0-SNAPSHOT
Celements KeyCloak adapter
com.celements
celements-config-source
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-model
- 6.7
+ 7.0-SNAPSHOT
provided
com.celements
celements-core
- 6.15
+ 7.0-SNAPSHOT
provided
com.celements
celements-spring-security
- 6.2
+ 7.0-SNAPSHOT
provided
diff --git a/celements-model/pom.xml b/celements-model/pom.xml
index 54a74e9f7..9a3468011 100644
--- a/celements-model/pom.xml
+++ b/celements-model/pom.xml
@@ -20,26 +20,29 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*
-->
-
+
com.celements
celements
- 6.7
+ 7.0-SNAPSHOT
4.0.0
celements-model
- 6.9-SNAPSHOT
+ 7.0-SNAPSHOT
Celements XWiki
com.celements
celements-config-source
- 6.2
+ 7.0-SNAPSHOT
com.celements
celements-subsystem-migration-manager
- 6.0
+ 7.0-SNAPSHOT
provided
diff --git a/celements-observation/pom.xml b/celements-observation/pom.xml
index fddcd11b9..dd75bc7dd 100644
--- a/celements-observation/pom.xml
+++ b/celements-observation/pom.xml
@@ -1,13 +1,16 @@
-
+
com.celements
base-pom
- 6.4
+ 7.0-SNAPSHOT
4.0.0
celements-observation
- 6.3-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Observation
@@ -15,19 +18,19 @@
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.1
+ 7.0-SNAPSHOT
provided
com.celements
celements-config-source-api
- 6.2
+ 7.0-SNAPSHOT
provided
@@ -35,7 +38,7 @@
celements-servlet
7.0-SNAPSHOT
provided
-
+
diff --git a/celements-reference/pom.xml b/celements-reference/pom.xml
index 062fd6b6f..3af871fd3 100644
--- a/celements-reference/pom.xml
+++ b/celements-reference/pom.xml
@@ -3,11 +3,11 @@
com.celements
base-pom
- 6.0
+ 7.0-SNAPSHOT
4.0.0
celements-reference
- 6.1-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Reference
@@ -15,25 +15,25 @@
com.celements
celements-commons
- 6.0
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.0
+ 7.0-SNAPSHOT
provided
com.celements
celements-config-source-api
- 6.0
+ 7.0-SNAPSHOT
provided
com.celements
celements-servlet
- 6.0
+ 7.0-SNAPSHOT
provided
diff --git a/celements-servlet/pom.xml b/celements-servlet/pom.xml
index c87194596..2f4a815c8 100644
--- a/celements-servlet/pom.xml
+++ b/celements-servlet/pom.xml
@@ -1,13 +1,16 @@
-
+
com.celements
base-pom
- 6.4
+ 7.0-SNAPSHOT
4.0.0
celements-servlet
- 6.4-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Servlet
@@ -20,13 +23,13 @@
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.1
+ 7.0-SNAPSHOT
provided
diff --git a/celements-wiki-manager/component/pom.xml b/celements-wiki-manager/component/pom.xml
index 7ff816391..495525bdd 100644
--- a/celements-wiki-manager/component/pom.xml
+++ b/celements-wiki-manager/component/pom.xml
@@ -3,17 +3,17 @@
com.celements
celements
- 6.6
+ 7.0-SNAPSHOT
4.0.0
celements-wiki-manager
- 6.2-SNAPSHOT
+ 7.0-SNAPSHOT
Celements Wiki Manager
com.celements
celements-model
- 6.6
+ 7.0-SNAPSHOT
provided
diff --git a/celements-wiki-manager/web-module/pom.xml b/celements-wiki-manager/web-module/pom.xml
index ff7b58d0b..08a3aaa43 100644
--- a/celements-wiki-manager/web-module/pom.xml
+++ b/celements-wiki-manager/web-module/pom.xml
@@ -3,18 +3,18 @@
com.celements
celementsweb
- 6.2
+ 7.0-SNAPSHOT
4.0.0
celements-wiki-manager-web
war
Celements Wiki Manager Web
- 6.2-SNAPSHOT
+ 7.0-SNAPSHOT
com.celements
celements-wiki-manager
- 6.1
+ 7.0-SNAPSHOT
diff --git a/celements-xwiki-core/pom.xml b/celements-xwiki-core/pom.xml
index 73714124f..aab352607 100644
--- a/celements-xwiki-core/pom.xml
+++ b/celements-xwiki-core/pom.xml
@@ -20,57 +20,60 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*
-->
-
+
com.celements
base-pom
- 6.4
+ 7.0-SNAPSHOT
4.0.0
celements-xwiki-core
- 6.12-SNAPSHOT
+ 7.0-SNAPSHOT
Celements XWiki
com.celements
celements-commons
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-component
- 6.1
+ 7.0-SNAPSHOT
provided
com.celements
celements-reference
- 6.0
+ 7.0-SNAPSHOT
provided
com.celements
celements-config-source-api
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-config-source
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-observation
- 6.2
+ 7.0-SNAPSHOT
provided
com.celements
celements-servlet
- 6.3
+ 7.0-SNAPSHOT
provided
@@ -577,7 +580,7 @@
com.celements
celements-base-tests
- 6.1
+ 7.0-SNAPSHOT
test
@@ -639,13 +642,11 @@
- **/com/xpn/xwiki/plugin/zipexplorer/ZipExplorerTest.java
+ **/com/xpn/xwiki/plugin/zipexplorer/ZipExplorerTest.java
**/com/xpn/xwiki/render/XWikiRadeoxRendererTest
**/com/xpn/xwiki/render/XWikiVelocityRendererTest.java
**/com/xpn/xwiki/web/XWikiMessageToolTest.java
-
- pertest
diff --git a/celements-xwiki-core/src/main/java/com/xpn/xwiki/internal/cache/DefaultDocumentCache.java b/celements-xwiki-core/src/main/java/com/xpn/xwiki/internal/cache/DefaultDocumentCache.java
index 4940f9142..900174568 100644
--- a/celements-xwiki-core/src/main/java/com/xpn/xwiki/internal/cache/DefaultDocumentCache.java
+++ b/celements-xwiki-core/src/main/java/com/xpn/xwiki/internal/cache/DefaultDocumentCache.java
@@ -23,7 +23,10 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.function.Supplier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.xwiki.bridge.event.AbstractDocumentEvent;
import org.xwiki.bridge.event.DocumentCreatedEvent;
import org.xwiki.bridge.event.DocumentDeletedEvent;
@@ -42,6 +45,9 @@
import org.xwiki.observation.ObservationManager;
import org.xwiki.observation.event.Event;
+import com.google.common.base.Suppliers;
+import com.xpn.xwiki.web.Utils;
+
/**
* Specialized cache component related to documents. It automatically clean the cache when the
* document is related.
@@ -57,6 +63,8 @@
@InstantiationStrategy(ComponentInstantiationStrategy.PER_LOOKUP)
public class DefaultDocumentCache implements DocumentCache {
+ private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDocumentCache.class);
+
/**
* Event listened by the component.
*/
@@ -148,8 +156,8 @@ public void onEvent(Event event, Object source, Object data) {
/**
* Used to register as event listener to invalidate the cache.
*/
- @Requirement
- private ObservationManager observationManager;
+ private Supplier observationManager = Suppliers
+ .memoize(() -> Utils.getComponent(ObservationManager.class));
/**
* {@inheritDoc}
@@ -167,8 +175,11 @@ public void create(CacheConfiguration cacheConfiguration) throws CacheException
.setConfigurationId(cacheConfiguration.getConfigurationId() + ".mapping");
this.mappingCache = this.cacheManager.createNewCache(cacheConfiguration);
-
- this.observationManager.addListener(this.listener);
+ try {
+ this.observationManager.get().addListener(this.listener);
+ } catch (Exception e) {
+ LOGGER.error("Failed to register document cache listener for cache [{}]", this.name, e);
+ }
}
// cache
diff --git a/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/DefaultDocumentCacheTest.java b/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/DefaultDocumentCacheTest.java
index 2927a1fd6..d52d72e13 100644
--- a/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/DefaultDocumentCacheTest.java
+++ b/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/DefaultDocumentCacheTest.java
@@ -22,12 +22,10 @@
import org.jmock.Mock;
import org.junit.Before;
import org.junit.Test;
-import org.xwiki.bridge.event.DocumentUpdatedEvent;
import org.xwiki.cache.config.CacheConfiguration;
import org.xwiki.cache.eviction.EntryEvictionConfiguration;
import org.xwiki.cache.eviction.LRUEvictionConfiguration;
import org.xwiki.model.reference.DocumentReference;
-import org.xwiki.observation.ObservationManager;
import com.xpn.xwiki.XWiki;
import com.xpn.xwiki.doc.XWikiDocument;
@@ -88,17 +86,4 @@ public void testGetSet() throws InterruptedException {
Assert.assertEquals("data2",
this.cache.get(this.document.getDocumentReference(), "ext1", "ext2"));
}
-
- @Test
- public void testEventBasedCleanup() throws Exception {
- this.cache.set("data", this.document.getDocumentReference());
- this.cache.set("data", this.document.getDocumentReference(), "ext1", "ext2");
-
- getComponentManager().lookup(ObservationManager.class).notify(
- new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document,
- getContext());
-
- Assert.assertNull(this.cache.get(this.document.getDocumentReference()));
- Assert.assertNull(this.cache.get(this.document.getDocumentReference(), "ext1", "ext2"));
- }
}
diff --git a/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/rendering/DefaultRenderingCacheTest.java b/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/rendering/DefaultRenderingCacheTest.java
deleted file mode 100644
index b386b6553..000000000
--- a/celements-xwiki-core/src/test/java/com/xpn/xwiki/internal/cache/rendering/DefaultRenderingCacheTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * 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.
- */
-package com.xpn.xwiki.internal.cache.rendering;
-
-import java.util.Collections;
-
-import org.jmock.Mock;
-import org.junit.Before;
-import org.junit.Test;
-import org.xwiki.bridge.event.DocumentUpdatedEvent;
-import org.xwiki.model.reference.DocumentReference;
-import org.xwiki.observation.ObservationManager;
-import org.xwiki.test.MockConfigurationSource;
-
-import com.xpn.xwiki.XWiki;
-import com.xpn.xwiki.doc.XWikiDocument;
-import com.xpn.xwiki.test.AbstractBridgedXWikiComponentTestCase;
-
-/**
- * Unit test for {@link DefaultRenderingCache}.
- *
- * @version $Id$
- * @since 2.4M1
- */
-public class DefaultRenderingCacheTest extends AbstractBridgedXWikiComponentTestCase {
-
- private Mock mockXWiki;
-
- private XWikiDocument document;
-
- private RenderingCache renderingCache;
-
- @Override
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- this.document = new XWikiDocument(new DocumentReference("wiki", "space", "page"));
-
- this.mockXWiki = mock(XWiki.class);
- getContext().setWiki((XWiki) this.mockXWiki.proxy());
-
- this.mockXWiki.stubs().method("getDocument")
- .with(eq(this.document.getDocumentReference()), ANYTHING).will(
- returnValue(this.document));
-
- this.renderingCache = getComponentManager().lookup(RenderingCache.class);
- }
-
- @Override
- protected void registerComponents() throws Exception {
- super.registerComponents();
-
- getConfigurationSource().setProperty("core.renderingcache.enabled", true);
- }
-
- @Test
- public void testGetSetRenderedContent() throws Exception {
- MockConfigurationSource source = getConfigurationSource();
-
- source.setProperty("core.renderingcache.documents", Collections.singletonList(this.document
- .getPrefixedFullName()));
-
- this.renderingCache.setRenderedContent(this.document.getDocumentReference(), "source",
- "renderedContent",
- getContext());
-
- assertEquals("renderedContent",
- this.renderingCache.getRenderedContent(this.document.getDocumentReference(),
- "source", getContext()));
-
- getComponentManager().lookup(ObservationManager.class).notify(
- new DocumentUpdatedEvent(this.document.getDocumentReference()), this.document,
- getContext());
-
- assertNull("renderedContent",
- this.renderingCache.getRenderedContent(this.document.getDocumentReference(),
- "source", getContext()));
- }
-}