exo-jcr SVN: r5333 - in jcr/trunk: exo.jcr.component.core.impl.infinispan.v5 and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-12-15 12:46:42 -0500 (Thu, 15 Dec 2011)
New Revision: 5333
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml
jcr/trunk/exo.jcr.component.core/pom.xml
Log:
EXOJCR-1682: Improve ISPN integration to support properly the distribution mode (jcr)
* Allow to import the classes of jcr.core from another project
* Import the classes of jcr.core from the ispn project
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-12-15 16:53:39 UTC (rev 5332)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-12-15 17:46:42 UTC (rev 5333)
@@ -389,6 +389,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml 2011-12-15 16:53:39 UTC (rev 5332)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml 2011-12-15 17:46:42 UTC (rev 5333)
@@ -72,7 +72,7 @@
<dependency>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>exo.jcr.component.core</artifactId>
- <classifier>test-sources</classifier>
+ <classifier>tests</classifier>
<scope>test</scope>
<version>${project.version}</version>
<exclusions>
12 years, 5 months
exo-jcr SVN: r5332 - in jcr/trunk: exo.jcr.component.core and 60 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-12-15 11:53:39 -0500 (Thu, 15 Dec 2011)
New Revision: 5332
Added:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/AbstractIndexerCacheStore.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexerCacheStore.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexCacheStore.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternNodesId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternPropsId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePropsId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheQPath.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CompressedISPNChangesBuffer.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheHelper.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/PrivilegedISPNCacheHelper.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-indexer.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-lock.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCacheInClusterMode.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/TesterISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-lock.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/test.policy
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-data.xml
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-indexer.xml
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-lock.xml
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/infinispan/
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-configuration.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-lock.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestBinaryValueMultiThreading.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java
jcr/trunk/pom.xml
Log:
EXOJCR-1682: Improve ISPN integration to support properly the distribution mode (jcr part 1)
* Upgrade to ISPN 5.1.0.CR1
* Move ISPN related to class to a dedicated project because it is now incompatible with the rest due to JGroups 3.0
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -37,11 +37,9 @@
<statistics.enabled>false</statistics.enabled>
<properties.url.suffix>.properties</properties.url.suffix>
<properties.url.prefix>classpath:/conf/standalone/default</properties.url.prefix>
- <test.cache.jbc>**/persistent/cache/jbosscache/**</test.cache.jbc>
- <test.cache.ispn>**/persistent/cache/infinispan/**</test.cache.ispn>
<test.cache.all>**/persistent/cache/**</test.cache.all>
<!-- ispn specific exclude by default -->
- <test.cache.exclude>${test.cache.ispn}</test.cache.exclude>
+ <test.cache.exclude>**/persistent/cache/foo/**</test.cache.exclude>
</properties>
<dependencies>
<dependency>
@@ -210,16 +208,6 @@
<artifactId>jbosscache-core</artifactId>
</dependency>
<dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-cachestore-jdbc</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-tests</artifactId>
<classifier>sources</classifier>
@@ -328,7 +316,7 @@
<property>
<name>jgroups.stack</name>
<value>udp</value>
- </property>
+ </property>
</systemProperties>
<includes>
<include>org/exoplatform/services/jcr/api/**/Test*.java</include>
@@ -388,8 +376,20 @@
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>test-jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
@@ -501,14 +501,6 @@
<profile>
<id>run-tck</id>
<build>
- <testResources>
- <testResource>
- <directory>src/TCK/java</directory>
- <includes>
- <include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
- </includes>
- </testResource>
- </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -567,7 +559,7 @@
<property>
<name>jgroups.stack</name>
<value>udp</value>
- </property>
+ </property>
</systemProperties>
<includes>
<include>org/apache/jackrabbit/test/api/*Test.java</include>
@@ -595,14 +587,6 @@
<profile>
<id>run-all</id>
<build>
- <testResources>
- <testResource>
- <directory>src/TCK/java</directory>
- <includes>
- <include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
- </includes>
- </testResource>
- </testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -661,7 +645,7 @@
<property>
<name>jgroups.stack</name>
<value>udp</value>
- </property>
+ </property>
</systemProperties>
<includes>
<!-- From default tests -->
@@ -914,84 +898,5 @@
<jcr.test.configuration.file>/conf/standalone/cluster/test-configuration-jbc.xml</jcr.test.configuration.file>
</properties>
</profile>
- <profile>
- <id>ispn</id>
- <properties>
- <jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
- <test.cache.exclude>${test.cache.jbc}</test.cache.exclude>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.12.1.3.Final</version>
- </dependency>
- <!-- Excludes jboss-logging-spi since it is in conflict with the
- latest version that is required by infinispan -->
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>ispn-sjdbc</id>
- <properties>
- <jcr.test.configuration.file>/conf/standalone/test-configuration-sjdbc.xml</jcr.test.configuration.file>
- <test.cache.exclude>${test.cache.jbc}</test.cache.exclude>
- <properties.url.suffix>-sjdbc.properties</properties.url.suffix>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.12.1.3.Final</version>
- </dependency>
- <!-- Excludes jboss-logging-spi since it is in conflict with the
- latest version that is required by infinispan -->
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>ispn-cluster</id>
- <properties>
- <jcr.test.configuration.file>/conf/standalone/cluster/test-configuration.xml</jcr.test.configuration.file>
- <test.cache.exclude>${test.cache.jbc}</test.cache.exclude>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.jgroups</groupId>
- <artifactId>jgroups</artifactId>
- <version>2.12.1.3.Final</version>
- </dependency>
- <!-- Excludes jboss-logging-spi since it is in conflict with the
- latest version that is required by infinispan -->
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </profile>
</profiles>
</project>
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -19,17 +19,12 @@
package org.exoplatform.services.jcr.config;
import org.exoplatform.container.configuration.ConfigurationManager;
-import org.exoplatform.commons.utils.PrivilegedFileHelper;
-import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
/**
* Builds configuration from template using map of template-variables <--> value.
@@ -40,16 +35,9 @@
* @version $Id: TemplateConfigurationHelper.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
*
*/
-public class TemplateConfigurationHelper
+public class TemplateConfigurationHelper extends org.exoplatform.container.util.TemplateConfigurationHelper
{
- // list with include-patterns
- private List<Pattern> includes = new ArrayList<Pattern>();
- // list with exclude-patterns
- private List<Pattern> excludes = new ArrayList<Pattern>();
-
- private ConfigurationManager cfm;
-
/**
* Creates instance of template configuration helper with given lists of filtering
* patterns. Parameter will be included only if it matches any include-pattern and
@@ -65,18 +53,7 @@
*/
public TemplateConfigurationHelper(String[] includes, String[] excludes, ConfigurationManager cfm)
{
- super();
- this.cfm = cfm;
- // compile include patterns
- for (String regex : includes)
- {
- this.includes.add(Pattern.compile(regex));
- }
- // compile exclude patterns
- for (String regex : excludes)
- {
- this.excludes.add(Pattern.compile(regex));
- }
+ super(includes, excludes, cfm);
}
/**
@@ -88,89 +65,6 @@
* @return
* @throws IOException
*/
- public InputStream fillTemplate(InputStream inputStream, Map<String, String> parameters) throws IOException
- {
- if (inputStream == null || parameters == null || parameters.size() == 0)
- {
- return inputStream;
- }
- // parameters filtering
- Map<String, String> preparedParams = prepareParameters(parameters);
- // read stream
- String configuration = readStream(inputStream);
- for (Entry<String, String> entry : preparedParams.entrySet())
- {
- configuration = configuration.replace(entry.getKey(), entry.getValue());
- }
- // create new stream
- InputStream configurationStream = new ByteArrayInputStream(configuration.getBytes());
- return configurationStream;
- }
-
- /**
- * Reads configuration file from a stream and replaces all the occurrences of template-variables
- * (like : "${parameter.name}") with values provided in the map.
- *
- * @param filename
- * @param parameters
- * @return
- * @throws IOException
- */
- public InputStream fillTemplate(String filename, Map<String, String> parameters) throws IOException
- {
- InputStream inputStream = null;
- // try to get using configuration manager
- try
- {
- inputStream = cfm.getInputStream(filename);
- }
- catch (Exception e)
- {
- // will try to use another resolve mechanism
- }
-
- // try to get resource by class loader
- if (inputStream == null)
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
- inputStream = cl == null ? null : cl.getResourceAsStream(filename);
- }
-
- // check system class loader
- if (inputStream == null)
- {
- inputStream = getClass().getClassLoader().getResourceAsStream(filename);
- }
-
- // try to get as file stream
- if (inputStream == null)
- {
- try
- {
- inputStream = PrivilegedFileHelper.fileInputStream(filename);
- }
- catch (IOException e)
- {
- // Still can't resolve
- }
- }
- // inputStream still remains null, so file was not opened
- if (inputStream == null)
- {
- throw new IOException("Can't find or open file:" + filename);
- }
- return fillTemplate(inputStream, parameters);
- }
-
- /**
- * Reads configuration file from a stream and replaces all the occurrences of template-variables
- * (like : "${parameter.name}") with values provided in the map.
- *
- * @param inputStream
- * @param parameters
- * @return
- * @throws IOException
- */
public InputStream fillTemplate(InputStream inputStream, List<SimpleParameterEntry> parameters) throws IOException
{
Map<String, String> map = new HashMap<String, String>();
@@ -199,73 +93,4 @@
}
return fillTemplate(filename, map);
}
-
- /**
- * Checks if String mathes to any pattern from the list
- *
- * @param patterns
- * @param parameter
- * @return
- */
- private boolean matches(List<Pattern> patterns, String parameter)
- {
- for (Pattern pattern : patterns)
- {
- if (pattern.matcher(parameter).matches())
- {
- // string matched
- return true;
- }
- }
- return false;
- }
-
- /**
- * Filters the map of parameters, leaving only those than matches filtering regular expressions.
- * Also adds "${}" to the parameter key: <br>
- * I.e. such map provided on input:
- *
- * "jbosscache-cache.loader":"org.exoplatform"
- * "jbosscache-configuration":"/conf/test.xml"
- * "max-volatile-size":"100Kb"
- *
- * the output will be like:
- *
- * "${jbosscache-cache.loader}":"org.exoplatform"
- *
- * Other will be ignored (depending on includes/excludes lists provided in constructor).
- *
- * @param parameters
- * @return
- */
- protected Map<String, String> prepareParameters(Map<String, String> parameters)
- {
- Map<String, String> map = new HashMap<String, String>();
- for (Entry<String, String> entry : parameters.entrySet())
- {
- if (matches(includes, entry.getKey()) && !matches(excludes, entry.getKey()))
- {
- map.put("${" + entry.getKey() + "}", entry.getValue());
- }
- }
- return map;
- }
-
- /**
- * Reads bytes from input stream and builds a string from them
- *
- * @param inputStream
- * @return
- * @throws IOException
- */
- protected String readStream(InputStream inputStream) throws IOException
- {
- StringBuffer out = new StringBuffer();
- byte[] b = new byte[4096];
- for (int n; (n = inputStream.read(b)) != -1;)
- {
- out.append(new String(b, 0, n));
- }
- return out.toString();
- }
}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-data.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-data.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-data.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
- <expiration wakeUpInterval="5000"/>
- </default>
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-indexer.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-indexer.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-indexer.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="NONE"/>
-
- <loaders passivation="false" shared="false" preload="false">
- <loader class="${infinispan-cachestore-classname}" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <async enabled="false"/>
- </loader>
- </loaders>
- </default>
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-lock.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="NONE"/>
-
- <loaders passivation="false" shared="true" preload="true">
- <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
- <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
- <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
- <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
- <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
- <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
- <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
- <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
- <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
- <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
- <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
- </properties>
- <async enabled="false"/>
- </loader>
- </loaders>
- </default>
-
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,214 +0,0 @@
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<repository-service default-repository="repository">
- <repositories>
- <repository name="repository" system-workspace="production" default-workspace="production">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="production">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/production" />
- </properties>
- <value-storages>
- <value-storage id="production" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/production" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/production" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="backup">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/backup" />
- </properties>
- <value-storages>
- <value-storage id="backup" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/backup" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/backup" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="digital-assets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/digital-assets" />
- </properties>
- <value-storages>
- <value-storage id="digital-assets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/digital-assets" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:folder" />
- </properties>
- </initializer>
- <cache enabled="true"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/digital-assets" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestArabicSearch.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -27,8 +27,8 @@
import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames;
import org.exoplatform.services.jcr.impl.core.query.lucene.Util;
-import java.io.File;
import java.io.FileInputStream;
+import java.net.URL;
import java.util.Calendar;
import javax.jcr.query.Query;
@@ -49,10 +49,10 @@
public void testSearchWithEncodingParameter() throws Exception
{
- File file = new File("src/test/resources/ArabicUTF8.txt");
- assertTrue("/test/resources/ArabicUTF8.txt not found", file.exists());
+ URL url = TestArabicSearch.class.getResource("/ArabicUTF8.txt");
+ assertNotNull("ArabicUTF8.txt not found", url);
- FileInputStream fis = new FileInputStream(file);
+ FileInputStream fis = new FileInputStream(url.getFile());
NodeImpl node = (NodeImpl)root.addNode(fileName, "nt:file");
NodeImpl cont = (NodeImpl)node.addNode("jcr:content", "nt:resource");
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestDateSearch.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -27,8 +27,8 @@
import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames;
import org.exoplatform.services.jcr.impl.core.query.lucene.Util;
-import java.io.File;
import java.io.FileInputStream;
+import java.net.URL;
import java.util.Calendar;
import javax.jcr.query.Query;
@@ -48,10 +48,10 @@
public void testSearchDate() throws Exception
{
- File file = new File("src/test/resources/test.xls");
- assertTrue("/test/resources/test.xls not found", file.exists());
+ URL url = TestDateSearch.class.getResource("/test.xls");
+ assertNotNull("test.xls not found", url);
- FileInputStream fis = new FileInputStream(file);
+ FileInputStream fis = new FileInputStream(url.getFile());
NodeImpl node = (NodeImpl)root.addNode(fileName, "nt:file");
NodeImpl cont = (NodeImpl)node.addNode("jcr:content", "nt:resource");
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestExcelFileSearch.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -31,8 +31,8 @@
import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames;
import org.exoplatform.services.jcr.impl.core.query.lucene.Util;
-import java.io.File;
import java.io.FileInputStream;
+import java.net.URL;
import java.util.Calendar;
/**
@@ -46,10 +46,10 @@
public void testFindFileContent() throws Exception
{
- File file = new File("src/test/resources/test.xls");
- assertTrue("/test/resources/book.xls not found", file.exists());
+ URL url = TestExcelFileSearch.class.getResource("/test.xls");
+ assertNotNull("test.xls not found", url);
- FileInputStream fis = new FileInputStream(file);
+ FileInputStream fis = new FileInputStream(url.getFile());
NodeImpl node = (NodeImpl)root.addNode("excelFile", "nt:file");
NodeImpl cont = (NodeImpl)node.addNode("jcr:content", "nt:resource");
@@ -61,7 +61,7 @@
root.save();
fis.close();
- fis = new FileInputStream(file);
+ fis = new FileInputStream(url.getFile());
DocumentReaderService extr =
(DocumentReaderService)session.getContainer().getComponentInstanceOfType(DocumentReaderService.class);
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -336,7 +336,6 @@
/**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getACLHolders()
*/
- @Override
public List<ACLHolder> getACLHolders() throws RepositoryException, IllegalStateException,
UnsupportedOperationException
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestBinaryValueMultiThreading.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestBinaryValueMultiThreading.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/TestBinaryValueMultiThreading.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.impl.core.SessionImpl;
import java.io.FileInputStream;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
@@ -43,7 +44,13 @@
private String LOCAL_BIG_FILE = null;
- private String LOCAL_SMALL_FILE = "src/test/resources/index/test_index.doc";
+ private static String LOCAL_SMALL_FILE;
+ static
+ {
+ URL url = TestBinaryValueMultiThreading.class.getResource("/index/test_index.doc");
+ assertNotNull("test_index.doc not found", url);
+ LOCAL_SMALL_FILE = url.getFile();
+ }
private static String REMOTE_BIG_FILE = "\\\\Exooffice\\public\\Tmp\\resources\\BigFile.zip";
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/dataflow/persistent/TestGetNodesConcurrentModification.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -164,7 +163,9 @@
super.setUp();
fails = new ArrayList<String>();
- contentFile = new URL("file:///" + new File("src/test/resources/index/test_index.doc").getAbsolutePath());
+ URL url = TestGetNodesConcurrentModification.class.getResource("/index/test_index.doc");
+ assertNotNull("test_index.doc not found", url);
+ contentFile = url;
initDB();
}
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-configuration.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-configuration.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,683 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
- xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
- <component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="INFO, stdout, file"/>
-
- <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
- <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
-
- <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.stdout.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
- <property name="log4j.appender.file.File" value="target/jcr.log"/>
-
- <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.file.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
- <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
- </properties-param>
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>SimpleLog properties</description>
- <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
- <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
- </properties-param -->
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>jdk1.4 Logger properties</description>
- <property name="handlers" value="java.util.logging.ConsoleHandler"/>
- <property name=".level" value="FINE"/>
- <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
- </properties-param -->
-
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- <component-plugins>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="test" value="http://www.apache.org/jackrabbit/test"/>
- <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
- <property name="rma" value="http://www.rma.com/jcr/"/>
- <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/test/nodetypes-tck.xml</value>
- <value>jar:/conf/test/nodetypes-impl.xml</value>
- <value>jar:/conf/test/nodetypes-usecase.xml</value>
- <value>jar:/conf/test/nodetypes-config.xml</value>
- <value>jar:/conf/test/nodetypes-config-extended.xml</value>
- <value>jar:/conf/test/wcm-nodetypes.xml</value>
- <value>jar:/conf/test/nodetypes-publication-config.xml</value>
- <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepository</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepository
- </description>
- <value>jar:/conf/test/nodetypes-test.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepositoryTest2</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
- </description>
- <value>jar:/conf/test/nodetypes-test2.xml</value>
- </values-param>
-
- <!--values-param>
- <name>testInitNodeTypesRepositoryTest3</name>
- <description>Node types from ext. Needed bacause core starup earlie than ext</description>
- <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
- </values-param-->
-
- </init-params>
- </component-plugin>
- </component-plugins>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/standalone/cluster/test-jcr-config.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="dialect" value="auto" />
- <property name="source-name" value="jdbcjcr"/>
- <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.security.Authenticator</key>
- <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
- </component>
-
- <component>
- <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>3000</value>
- </value-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.rpc.RPCService</key>
- <type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
- <init-params>
- <value-param>
- <name>jgroups-configuration</name>
- <value>jar:/conf/standalone/cluster/udp-mux.xml</value>
- </value-param>
- <value-param>
- <name>jgroups-cluster-name</name>
- <value>RPCService-Cluster</value>
- </value-param>
- <value-param>
- <name>jgroups-default-timeout</name>
- <value>0</value>
- </value-param>
- </init-params>
- </component>
- <!-- component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>300</value>
- </value-param>
- </init-params>
- </component -->
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
- <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
- <property name="username" value="${jdbcjcr.username:sa}"/>
- <property name="password" value="${jdbcjcr.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1.url:jdbc:hsqldb:file:target/temp/data/jcr}"/>
- <property name="username" value="${jdbcjcr1.username:sa}"/>
- <property name="password" value="${jdbcjcr1.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr2.url:jdbc:hsqldb:file:target/temp/data/jcr2}"/>
- <property name="username" value="${jdbcjcr2.username:sa}"/>
- <property name="password" value="${jdbcjcr2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr3</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr3.url:jdbc:hsqldb:file:target/temp/data/jcr3}"/>
- <property name="username" value="${jdbcjcr3.username:sa}"/>
- <property name="password" value="${jdbcjcr3.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtest</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- <property name="maxActive" value="100" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrdb2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
- <property name="username" value="${jdbcjcrdb2.username:sa}"/>
- <property name="password" value="${jdbcjcrdb2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1db2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1db2.url:jdbc:hsqldb:file:target/temp/data/jcrdb2}"/>
- <property name="username" value="${jdbcjcr1db2.username:sa}"/>
- <property name="password" value="${jdbcjcr1db2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
- <property name="username" value="${jdbcjcrtck.username:sa}"/>
- <property name="password" value="${jdbcjcrtck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1tck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1tck.url:jdbc:hsqldb:file:target/temp/data/jcrtck}"/>
- <property name="username" value="${jdbcjcr1tck.username:sa}"/>
- <property name="password" value="${jdbcjcr1tck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2tck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr2tck.url:jdbc:hsqldb:file:target/temp/data/jcr2tck}"/>
- <property name="username" value="${jdbcjcr2tck.username:sa}"/>
- <property name="password" value="${jdbcjcr2tck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export3</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>testdbcleaner</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
- <property name="username" value="${testdbcleaner.username:sa}"/>
- <property name="password" value="${testdbcleaner.password:}"/>
- <property name="maxActive" value="20" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>repo</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="repositoryName" value="db1"/>
- <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>rmi.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>rmirepository</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="url" value="//localhost:9999/repository"/>
- </properties-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
- <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
-</configuration>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
- <expiration wakeUpInterval="5000"/>
- </default>
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="NONE"/>
-
- <loaders passivation="false" shared="false" preload="false">
- <loader class="${infinispan-cachestore-classname}" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <async enabled="false"/>
- </loader>
- </loaders>
- </default>
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
-
- <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
- <properties>
- <property name="configurationFile" value="${jgroups-configuration}"/>
- </properties>
- </transport>
- </global>
-
- <default>
- <clustering mode="replication">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" />
- <sync replTimeout="20000"/>
- </clustering>
-
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="NONE"/>
-
- <loaders passivation="false" shared="true" preload="true">
- <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
- <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
- <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
- <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
- <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
- <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
- <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
- <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
- <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
- <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
- <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
- </properties>
- <async enabled="false"/>
- </loader>
- </loaders>
- </default>
-
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,695 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
- <!--
-
- Copyright (C) 2009 eXo Platform SAS. 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.
- -->
-<repository-service default-repository="db1">
- <repositories>
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="ws"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type"
- value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="jdbc-dialect" value="auto" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1" />
- </properties>
- <value-storages>
- <value-storage id="ws1"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1/ws1" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2" lazy-read-threshold="1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2" />
- </properties>
- <value-storages>
- <value-storage id="ws2"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1/ws2" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws3">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr3" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws3" />
- </properties>
- <value-storages>
- <!--
- This storage is used to check whether properties are removed correctly from each value-storage
- (TestRemoveFromValueStorage.java)
- -->
- <value-storage id="ws3_big"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3_big" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="1024K" />
- </filters>
- </value-storage>
- <value-storage id="ws3"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type"
- value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1/ws3" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr3" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db2" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrdb2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wsdb2" />
- </properties>
- <value-storages>
- <value-storage id="ws"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wsdb2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions"
- value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db2/ws" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1db2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1db2" />
- </properties>
- <value-storages>
- <value-storage id="ws1"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1db2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db2/ws1" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1db2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db1tck" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wstck" />
- </properties>
- <value-storages>
- <value-storage id="ws"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wstck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions"
- value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1tck/ws" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1tck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1tck" />
- </properties>
- <value-storages>
- <value-storage id="ws1"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions"
- value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1tck/ws1" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1tck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr2tck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2tck" />
- </properties>
- <value-storages>
- <value-storage id="ws2"
- class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions"
- value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="max-volatile-time" value="60" />
- <property name="index-dir" value="target/temp/index/db1tck/ws2" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
- <property name="extractorPoolSize" value="2" />
- <property name="extractorTimeout" value="10" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
- <property name="infinispan-cluster-name" value="JCR-cluster" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2tck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
\ No newline at end of file
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,504 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
- xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
- <component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="INFO, stdout, file"/>
-
- <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
- <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
-
- <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.stdout.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
- <property name="log4j.appender.file.File" value="target/jcr.log"/>
-
- <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.file.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
- <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
- </properties-param>
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>SimpleLog properties</description>
- <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
- <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
- </properties-param -->
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>jdk1.4 Logger properties</description>
- <property name="handlers" value="java.util.logging.ConsoleHandler"/>
- <property name=".level" value="FINE"/>
- <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
- </properties-param -->
-
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- <component-plugins>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="test" value="http://www.apache.org/jackrabbit/test"/>
- <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
- <property name="rma" value="http://www.rma.com/jcr/"/>
- <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/test/nodetypes-tck.xml</value>
- <value>jar:/conf/test/nodetypes-impl.xml</value>
- <value>jar:/conf/test/nodetypes-usecase.xml</value>
- <value>jar:/conf/test/nodetypes-config.xml</value>
- <value>jar:/conf/test/nodetypes-config-extended.xml</value>
- <value>jar:/conf/test/wcm-nodetypes.xml</value>
- <value>jar:/conf/test/nodetypes-publication-config.xml</value>
- <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepository</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepository
- </description>
- <value>jar:/conf/test/nodetypes-test.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepositoryTest2</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
- </description>
- <value>jar:/conf/test/nodetypes-test2.xml</value>
- </values-param>
-
- <!--values-param>
- <name>testInitNodeTypesRepositoryTest3</name>
- <description>Node types from ext. Needed bacause core starup earlie than ext</description>
- <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
- </values-param-->
-
- </init-params>
- </component-plugin>
- </component-plugins>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/standalone/test-jcr-config-sjdbc.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="dialect" value="auto" />
- <property name="source-name" value="jdbcjcr"/>
- <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.security.Authenticator</key>
- <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
- </component>
-
- <component>
- <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>3000</value>
- </value-param>
- </init-params>
- </component>
-
- <!-- component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>300</value>
- </value-param>
- </init-params>
- </component -->
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
- <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
- <property name="username" value="${jdbcjcr.username:sa}"/>
- <property name="password" value="${jdbcjcr.password:}"/>
- <property name="maxActive" value="20" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtest</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- <property name="maxActive" value="100" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrdb2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
- <property name="username" value="${jdbcjcrdb2.username:sa}"/>
- <property name="password" value="${jdbcjcrdb2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
- <property name="username" value="${jdbcjcrtck.username:sa}"/>
- <property name="password" value="${jdbcjcrtck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export3</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>testdbcleaner</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
- <property name="username" value="${testdbcleaner.username:sa}"/>
- <property name="password" value="${testdbcleaner.password:}"/>
- <property name="maxActive" value="20" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>repo</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="repositoryName" value="db1"/>
- <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>rmi.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>rmirepository</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="url" value="//localhost:9999/repository"/>
- </properties-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
- <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
-</configuration>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,665 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
- xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
- <component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="INFO, stdout, file"/>
-
- <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
- <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
-
- <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.stdout.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
- <property name="log4j.appender.file.File" value="target/jcr.log"/>
-
- <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
- <property name="log4j.appender.file.layout.ConversionPattern"
- value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
-
- <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
- <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
- </properties-param>
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>SimpleLog properties</description>
- <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
- <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
- </properties-param -->
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>jdk1.4 Logger properties</description>
- <property name="handlers" value="java.util.logging.ConsoleHandler"/>
- <property name=".level" value="FINE"/>
- <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
- </properties-param -->
-
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- <component-plugins>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="test" value="http://www.apache.org/jackrabbit/test"/>
- <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
- <property name="rma" value="http://www.rma.com/jcr/"/>
- <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
- <value>jar:/conf/test/nodetypes-tck.xml</value>
- <value>jar:/conf/test/nodetypes-impl.xml</value>
- <value>jar:/conf/test/nodetypes-usecase.xml</value>
- <value>jar:/conf/test/nodetypes-config.xml</value>
- <value>jar:/conf/test/nodetypes-config-extended.xml</value>
- <value>jar:/conf/test/wcm-nodetypes.xml</value>
- <value>jar:/conf/test/nodetypes-publication-config.xml</value>
- <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepository</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepository
- </description>
- <value>jar:/conf/test/nodetypes-test.xml</value>
- </values-param>
-
- <values-param>
- <name>testInitNodeTypesRepositoryTest2</name>
- <description>
- Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
- </description>
- <value>jar:/conf/test/nodetypes-test2.xml</value>
- </values-param>
-
- <!--values-param>
- <name>testInitNodeTypesRepositoryTest3</name>
- <description>Node types from ext. Needed bacause core starup earlie than ext</description>
- <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
- </values-param-->
-
- </init-params>
- </component-plugin>
- </component-plugins>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/standalone/test-jcr-config.xml</value>
- </value-param>
- <properties-param>
- <name>working-conf</name>
- <description>working-conf</description>
- <property name="dialect" value="auto" />
- <property name="source-name" value="jdbcjcr"/>
- <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.security.Authenticator</key>
- <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
- </component>
-
- <component>
- <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
- </component>
-
- <component>
- <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>3000</value>
- </value-param>
- </init-params>
- </component>
-
- <!-- component>
- <key>org.exoplatform.services.transaction.TransactionService</key>
- <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
- <init-params>
- <value-param>
- <name>timeout</name>
- <value>300</value>
- </value-param>
- </init-params>
- </component -->
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
- <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
- <property name="username" value="${jdbcjcr.username:sa}"/>
- <property name="password" value="${jdbcjcr.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1.url:jdbc:hsqldb:file:target/temp/data/jcr}"/>
- <property name="username" value="${jdbcjcr1.username:sa}"/>
- <property name="password" value="${jdbcjcr1.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr2.url:jdbc:hsqldb:file:target/temp/data/jcr2}"/>
- <property name="username" value="${jdbcjcr2.username:sa}"/>
- <property name="password" value="${jdbcjcr2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr3</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr3.url:jdbc:hsqldb:file:target/temp/data/jcr3}"/>
- <property name="username" value="${jdbcjcr3.username:sa}"/>
- <property name="password" value="${jdbcjcr3.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtest</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- <property name="maxActive" value="100" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrdb2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
- <property name="username" value="${jdbcjcrdb2.username:sa}"/>
- <property name="password" value="${jdbcjcrdb2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1db2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1db2.url:jdbc:hsqldb:file:target/temp/data/jcrdb2}"/>
- <property name="username" value="${jdbcjcr1db2.username:sa}"/>
- <property name="password" value="${jdbcjcr1db2.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcrtck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
- <property name="username" value="${jdbcjcrtck.username:sa}"/>
- <property name="password" value="${jdbcjcrtck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr1tck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr1tck.url:jdbc:hsqldb:file:target/temp/data/jcrtck}"/>
- <property name="username" value="${jdbcjcr1tck.username:sa}"/>
- <property name="password" value="${jdbcjcr1tck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2tck</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${jdbcjcr2tck.url:jdbc:hsqldb:file:target/temp/data/jcr2tck}"/>
- <property name="username" value="${jdbcjcr2tck.username:sa}"/>
- <property name="password" value="${jdbcjcr2tck.password:}"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export1</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export2</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>jdbcjcr2export3</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
- <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
- <property name="username" value="sa"/>
- <property name="password" value=""/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.datasource</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>testdbcleaner</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.sql.DataSource</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
- <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
- <property name="username" value="${testdbcleaner.username:sa}"/>
- <property name="password" value="${testdbcleaner.password:}"/>
- <property name="maxActive" value="20" />
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>bind.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>repo</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="repositoryName" value="db1"/>
- <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>rmi.jcr</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.naming.BindReferencePlugin</type>
- <init-params>
- <value-param>
- <name>bind-name</name>
- <value>rmirepository</value>
- </value-param>
- <value-param>
- <name>class-name</name>
- <value>javax.jcr.Repository</value>
- </value-param>
- <value-param>
- <name>factory</name>
- <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
- </value-param>
- <properties-param>
- <name>ref-addresses</name>
- <description>ref-addresses</description>
- <property name="url" value="//localhost:9999/repository"/>
- </properties-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-
- <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
- <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
-</configuration>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-config.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
- </global>
-
- <default>
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
- <expiration wakeUpInterval="5000"/>
- </default>
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-lock.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<infinispan
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
-
- <global>
- <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
- <properties>
- <property name="threadNamePrefix" value="EvictionThread"/>
- </properties>
- </evictionScheduledExecutor>
-
- <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
- </global>
-
- <default>
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
- <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
- <jmxStatistics enabled="true"/>
- <eviction strategy="NONE"/>
-
- <loaders passivation="false" shared="true" preload="true">
- <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
- <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
- <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
- <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
- <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
- <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
- <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
- <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
- <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
- <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
- <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
- </properties>
- <async enabled="false"/>
- </loader>
- </loaders>
- </default>
-
-</infinispan>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,589 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<repository-service default-repository="db1">
- <repositories>
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="jdbc-dialect" value="auto" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2" lazy-read-threshold="1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2" />
- </properties>
- <value-storages>
- <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws3">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws3" />
- </properties>
- <value-storages>
- <!--
- This storage is used to check whether properties are removed
- correctly from each value-storage
- (TestRemoveFromValueStorage.java)
- -->
- <value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3_big" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="1024K" />
- </filters>
- </value-storage>
- <value-storage id="ws3" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws3" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db2" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrdb2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wsdb2" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wsdb2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db2/ws" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrdb2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1db2" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1db2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db2/ws1" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
-
- <repository name="db1tck" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wstck" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wstck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1tck" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="false" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2tck" />
- </properties>
- <value-storages>
- <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt"/>
- <property name="extractorPoolSize" value="2"/>
- <property name="extractorTimeout" value="10"/>
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
Deleted: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -1,589 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<repository-service default-repository="db1">
- <repositories>
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="jdbc-dialect" value="auto" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2" lazy-read-threshold="1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2" />
- </properties>
- <value-storages>
- <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws3">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr3" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws3" />
- </properties>
- <value-storages>
- <!--
- This storage is used to check whether properties are removed
- correctly from each value-storage
- (TestRemoveFromValueStorage.java)
- -->
- <value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3_big" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="1024K" />
- </filters>
- </value-storage>
- <value-storage id="ws3" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws3" />
- <property name="digest-algo" value="MD5" />
- <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
- <property name="jdbc-source-name" value="jdbcjcr" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws3" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr3" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
- <repository name="db2" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrdb2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wsdb2" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wsdb2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db2/ws" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1db2" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1db2" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1db2" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db2/ws1" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1db2" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
-
-
- <repository name="db1tck" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/wstck" />
- </properties>
- <value-storages>
- <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/wstck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws1">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr1tck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws1tck" />
- </properties>
- <value-storages>
- <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws1tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1tck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
-
- <workspace name="ws2">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr2tck" />
- <property name="dialect" value="auto" />
- <property name="multi-db" value="true" />
- <property name="update-storage" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="target/temp/swap/ws2tck" />
- </properties>
- <value-storages>
- <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="target/temp/values/ws2tck" />
- <property name="enabled" value="${value-storage-enabled}" />
- </properties>
- <filters>
- <filter property-type="Binary" min-value-size="100K" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
- </properties>
- </initializer>
- <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
- <properties>
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt"/>
- <property name="extractorPoolSize" value="2"/>
- <property name="extractorTimeout" value="10"/>
- </properties>
- </query-handler>
- <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
- <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
- <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
- <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
- <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
- <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
- <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
- <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2tck" />
- <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
- </properties>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/pom.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,722 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>jcr-parent</artifactId>
+ <version>1.14.6-GA-SNAPSHOT</version>
+ </parent>
+ <artifactId>exo.jcr.component.core.impl.infinispan.v5</artifactId>
+ <name>eXo JCR :: Component :: Core Service based on ISPN 5</name>
+ <description>eXo JCR Service core component based on Infinispan 5</description>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
+ <cache.enabled>true</cache.enabled>
+ <value.storage.enabled>true</value.storage.enabled>
+ <statistics.enabled>false</statistics.enabled>
+ <properties.url.suffix>.properties</properties.url.suffix>
+ <properties.url.prefix>classpath:/conf/standalone/default</properties.url.prefix>
+ <test.cache.all>**/persistent/cache/**</test.cache.all>
+ <!-- ispn specific exclude by default -->
+ <test.cache.exclude>**/persistent/cache/jbosscache/**</test.cache.exclude>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.cluster.testclient</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.rpc.impl.jgroups.v3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <classifier>test-sources</classifier>
+ <scope>test</scope>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jgroups</groupId>
+ <artifactId>jgroups</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <classifier>sources</classifier>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- Excludes jboss-logging-spi since it is in conflict with the
+ latest version that is required by infinispan -->
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- TCK binaries and deps for repo stub, some eXo API test -->
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-cachestore-jdbc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.resource</groupId>
+ <artifactId>connector-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- ===== Databases JDBC support for tests ===== -->
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <!-- ======================================================================= -->
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.sql</include>
+ <include>**/*.dtd</include>
+ </includes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>login.conf</include>
+ <include>**/*.xml</include>
+ <include>**/*.drl</include>
+ <include>**/*.vm</include>
+ <include>**/*.doc</include>
+ <include>**/*.xls</include>
+ <include>**/*.ppt</include>
+ <include>**/*.txt</include>
+ <include>**/*.tiff</include>
+ <include>**/*.pdf</include>
+ <include>**/*.dtd</include>
+ <include>**/*.policy</include>
+ </includes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>${env.MAVEN_OPTS} -Dcom.arjuna.ats.arjuna.objectstore.objectStoreDir=${project.build.directory} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
+ <property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>${statistics.enabled}</value>
+ </property>
+ <property>
+ <name>exo.properties.url</name>
+ <value>${properties.url.prefix}${properties.url.suffix}</value>
+ </property>
+ <!-- We add this system property due to some incompatibility between IPv6 and
+ some JVM of Linux distributions such as Ubuntu and Fedora-->
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>jgroups.bind_addr</name>
+ <value>127.0.0.1</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>org/exoplatform/services/jcr/api/**/Test*.java</include>
+ <include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
+ <include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
+ <include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
+ </includes>
+ <excludes>
+ <exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
+ <exclude>org/exoplatform/services/jcr/usecases/common/RemoveSameNameSiblingUnfixedTest.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
+ <!-- Implementation Specific Excludes -->
+ <exclude>${test.cache.exclude}</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.core</artifactId>
+ <classifier>test-sources</classifier>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.apache.jackrabbit</groupId>
+ <artifactId>jackrabbit-jcr-tests</artifactId>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>${project.build.directory}/jcr-core-tests</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}" property="localRepositoryURL" />
+ <makeurl file="${project.build.outputDirectory}" property="outputDirectoryURL" />
+ <makeurl file="${project.build.testOutputDirectory}" property="testOutputDirectoryURL" />
+ <copy todir="${project.build.testOutputDirectory}" overwrite="true">
+ <fileset dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy" />
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO" value="${localRepositoryURL}" />
+ <filter token="MAIN_CLASSES" value="${outputDirectoryURL}" />
+ <filter token="TEST_CLASSES" value="${testOutputDirectoryURL}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <id>add-test-resource</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>add-test-resource</goal>
+ </goals>
+ <configuration>
+ <resources>
+ <resource>
+ <directory>${project.build.directory}/jcr-core-tests</directory>
+ <excludes>
+ </excludes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-test-source</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/jcr-core-tests</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <!-- *** -->
+ <!-- TCK -->
+ <!-- *** -->
+ <!-- Use "mvn -Prun-tck" to launch only them -->
+ <profile>
+ <id>run-tck</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- TAKE CARE TO UPDATE ALSO run-all PROFILE -->
+ <argLine>${env.MAVEN_OPTS} -Dcom.arjuna.ats.arjuna.objectstore.objectStoreDir=${project.build.directory} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
+ <property>
+ <name>known.issues</name>
+ <value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
+ org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
+ org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
+ org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
+ org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion</value>
+ </property>
+ <property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>${statistics.enabled}</value>
+ </property>
+ <property>
+ <name>exo.properties.url</name>
+ <value>${properties.url.prefix}${properties.url.suffix}</value>
+ </property>
+ <!-- We add this system property due to some incompatibility between IPv6 and
+ some JVM of Linux distributions such as Ubuntu and Fedora-->
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>jgroups.bind_addr</name>
+ <value>127.0.0.1</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>org/apache/jackrabbit/test/api/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/query/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/version/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
+ <exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
+ <exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
+ <exclude>org/exoplatform/services/jcr/impl/core/security/Test*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <!-- *** -->
+ <!-- ALL -->
+ <!-- *** -->
+ <!-- Use "mvn -Prun-all" to launch default tests and TCK -->
+ <profile>
+ <id>run-all</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- TAKE CARE TO UPDATE ALSO run-tck PROFILE -->
+ <argLine>${env.MAVEN_OPTS} -Dcom.arjuna.ats.arjuna.objectstore.objectStoreDir=${project.build.directory} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
+ <systemProperties>
+ <property>
+ <name>jcr.test.configuration.file</name>
+ <value>${jcr.test.configuration.file}</value>
+ </property>
+ <property>
+ <name>emma.coverage.out.file</name>
+ <value>target/emma/coverage.ec</value>
+ </property>
+ <property>
+ <name>cache-enabled</name>
+ <value>${cache.enabled}</value>
+ </property>
+ <property>
+ <name>value-storage-enabled</name>
+ <value>${value.storage.enabled}</value>
+ </property>
+ <property>
+ <name>known.issues</name>
+ <value>org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
+ org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
+ org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
+ org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
+ org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion</value>
+ </property>
+ <property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>${statistics.enabled}</value>
+ </property>
+ <property>
+ <name>exo.properties.url</name>
+ <value>${properties.url.prefix}${properties.url.suffix}</value>
+ </property>
+ <!-- We add this system property due to some incompatibility between IPv6 and
+ some JVM of Linux distributions such as Ubuntu and Fedora-->
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>jgroups.bind_addr</name>
+ <value>127.0.0.1</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <!-- From default tests -->
+ <include>org/exoplatform/services/jcr/api/**/Test*.java</include>
+ <include>org/exoplatform/services/jcr/usecases/**/Test*.java</include>
+ <include>org/exoplatform/services/jcr/usecases/**/*Test.java</include>
+ <include>org/exoplatform/services/jcr/impl/**/Test*.java</include>
+ <!-- From TCK -->
+ <include>org/apache/jackrabbit/test/api/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/observation/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/lock/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/nodetype/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/query/*Test.java</include>
+ <include>org/apache/jackrabbit/test/api/version/*Test.java</include>
+ </includes>
+ <excludes>
+ <exclude>org/exoplatform/services/jcr/**/api/TestAll.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/impl/**/Base*.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/usecases/BaseUsecasesTest.java</exclude>
+ <exclude>org/exoplatform/services/jcr/usecases/common/RemoveSameNameSiblingUnfixedTest.java</exclude>
+ <exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
+ <!-- From TCK -->
+ <exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
+ <exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
+ <exclude>org/apache/jackrabbit/test/api/**/FrozenNodeTest.java</exclude>
+ <!-- Implementation Specific Excludes -->
+ <exclude>${test.cache.exclude}</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <!-- We define one profile per driver -->
+ <profile>
+ <id>oracle-10G-R2</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/oracle</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>10.2.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>10.2.0.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>oracle-11G-R1</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/oracle</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>11.1.0.6.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>11.1.0.6.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>oracle-11G-R2</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/oracle</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>ojdbc</artifactId>
+ <version>11.2.0.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ojdbc</groupId>
+ <artifactId>orai18n</artifactId>
+ <version>11.2.0.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mysql-5.0</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/mysql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.8</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mysql-5.1</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/mysql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.14</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mysql-5.5</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/mysql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.18</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>mssql</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/mssql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft</groupId>
+ <artifactId>sqljdbc</artifactId>
+ <version>3.0.1301.101</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>db2</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/db2</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>9.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.db2</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>9.7</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>sybase</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/sybase</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.sybase.jdbc4.jdbc</groupId>
+ <artifactId>jconn4</artifactId>
+ <version>26502</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>pgsql-8.2</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/pgsql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-507.jdbc4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>pgsql-8.3</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/pgsql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-606.jdbc4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>pgsql-8.4</id>
+ <properties>
+ <properties.url.prefix>classpath:/conf/standalone/pgsql</properties.url.prefix>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.4-702.jdbc4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>cache-disabled</id>
+ <properties>
+ <cache.enabled>false</cache.enabled>
+ <test.cache.exclude>${test.cache.all}</test.cache.exclude>
+ </properties>
+ </profile>
+ <profile>
+ <id>value-storage-disabled</id>
+ <properties>
+ <value.storage.enabled>false</value.storage.enabled>
+ </properties>
+ </profile>
+ <profile>
+ <id>sjdbc</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/test-configuration-sjdbc.xml</jcr.test.configuration.file>
+ <properties.url.suffix>-sjdbc.properties</properties.url.suffix>
+ </properties>
+ </profile>
+ <profile>
+ <id>cluster</id>
+ <properties>
+ <jcr.test.configuration.file>/conf/standalone/cluster/test-configuration.xml</jcr.test.configuration.file>
+ </properties>
+ </profile>
+ </profiles>
+</project>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,452 @@
+/*
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.lock.infinispan;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
+import org.exoplatform.management.jmx.annotations.Property;
+import org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder;
+import org.exoplatform.services.jcr.impl.core.lock.cacheable.AbstractCacheableLockManager;
+import org.exoplatform.services.jcr.impl.core.lock.cacheable.CacheableSessionLockManager;
+import org.exoplatform.services.jcr.impl.core.lock.cacheable.LockData;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
+import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
+import org.exoplatform.services.jcr.infinispan.PrivilegedISPNCacheHelper;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.naming.InitialContextInitializer;
+import org.exoplatform.services.transaction.TransactionService;
+import org.infinispan.Cache;
+import org.infinispan.config.Configuration.CacheMode;
+import org.infinispan.lifecycle.ComponentStatus;
+
+import java.io.Serializable;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.lock.LockException;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: InfinispanLockManagerImpl.java 111 2010-11-11 11:11:11Z tolusha $
+ */
+@Managed
+@NameTemplate(@Property(key = "service", value = "lockmanager"))
+public class ISPNCacheableLockManagerImpl extends AbstractCacheableLockManager
+{
+
+ /**
+ * The name to property cache configuration.
+ */
+ public static final String INFINISPAN_JDBC_CL_DATASOURCE = "infinispan-cl-cache.jdbc.datasource";
+
+ public static final String INFINISPAN_JDBC_CL_DATA_COLUMN = "infinispan-cl-cache.jdbc.data.type";
+
+ public static final String INFINISPAN_JDBC_CL_TIMESTAMP_COLUMN = "infinispan-cl-cache.jdbc.timestamp.type";
+
+ public static final String INFINISPAN_JDBC_CL_ID_COLUMN = "infinispan-cl-cache.jdbc.id.type";
+
+ public static final String INFINISPAN_JDBC_TABLE_NAME = "infinispan-cl-cache.jdbc.table.name";
+
+ public static final String INFINISPAN_JDBC_CL_AUTO = "auto";
+
+ /**
+ * Logger
+ */
+ private final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanLockManagerImpl");
+
+ private Cache<Serializable, Object> cache;
+
+ public ISPNCacheableLockManagerImpl(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
+ InitialContextInitializer context, TransactionService transactionService, ConfigurationManager cfm,
+ LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationException, RepositoryException
+ {
+ this(dataManager, config, context, transactionService.getTransactionManager(), cfm, lockRemoverHolder);
+ }
+
+ public ISPNCacheableLockManagerImpl(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
+ InitialContextInitializer context, ConfigurationManager cfm, LockRemoverHolder lockRemoverHolder)
+ throws RepositoryConfigurationException, RepositoryException
+ {
+ this(dataManager, config, context, (TransactionManager)null, cfm, lockRemoverHolder);
+ }
+
+ public ISPNCacheableLockManagerImpl(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
+ InitialContextInitializer context, TransactionManager transactionManager, ConfigurationManager cfm,
+ LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationException, RepositoryException
+ {
+ super(dataManager, config, transactionManager, lockRemoverHolder);
+
+ // make cache
+ if (config.getLockManager() != null)
+ {
+ // create cache using custom factory
+ ISPNCacheFactory<Serializable, Object> factory = new ISPNCacheFactory<Serializable, Object>(cfm);
+
+ // configure cache loader parameters with correct DB data-types
+ configureJDBCCacheLoader(config.getLockManager());
+
+ cache = factory.createCache("L" + config.getUniqueName().replace("_", ""), config.getLockManager());
+ }
+ else
+ {
+ throw new RepositoryConfigurationException("Cache configuration not found");
+ }
+
+ this.getNumLocks = new LockActionNonTxAware<Integer, Object>()
+ {
+ public Integer execute(Object arg)
+ {
+ return cache.size();
+ }
+ };
+
+ this.hasLocks = new LockActionNonTxAware<Boolean, Object>()
+ {
+ public Boolean execute(Object arg)
+ {
+ return !cache.isEmpty();
+ }
+ };
+
+ this.isLockLive = new LockActionNonTxAware<Boolean, String>()
+ {
+ public Boolean execute(String nodeId)
+ {
+ return cache.containsKey(nodeId);
+ }
+ };
+
+ this.refresh = new LockActionNonTxAware<Object, LockData>()
+ {
+ public Object execute(LockData newLockData) throws LockException
+ {
+ Object oldValue = PrivilegedISPNCacheHelper.put(cache, newLockData.getNodeIdentifier(), newLockData);
+ if (oldValue == null)
+ {
+ throw new LockException("Can't refresh lock for node " + newLockData.getNodeIdentifier()
+ + " since lock is not exist");
+ }
+ return null;
+ }
+ };
+
+ this.lockExist = new LockActionNonTxAware<Boolean, String>()
+ {
+ public Boolean execute(String nodeId) throws LockException
+ {
+ return cache.containsKey(nodeId);
+ }
+ };
+
+ this.getLockDataById = new LockActionNonTxAware<LockData, String>()
+ {
+ public LockData execute(String nodeId) throws LockException
+ {
+ return (LockData)cache.get(nodeId);
+ }
+ };
+
+ this.getLockList = new LockActionNonTxAware<List<LockData>, Object>()
+ {
+ public List<LockData> execute(Object arg) throws LockException
+ {
+ Collection<Object> datas = cache.values();
+
+ List<LockData> locksData = new ArrayList<LockData>();
+ for (Object lockData : datas)
+ {
+ if (lockData != null)
+ {
+ locksData.add((LockData)lockData);
+ }
+ }
+ return locksData;
+ }
+ };
+ }
+
+ /**
+ * If JDBC cache loader is used, then fills-in column types. If column type configured from jcr-configuration file,
+ * then nothing is overridden. Parameters are injected into the given parameterEntry.
+ */
+ private void configureJDBCCacheLoader(MappedParametrizedObjectEntry parameterEntry) throws RepositoryException
+ {
+ String dataSourceName = parameterEntry.getParameterValue(INFINISPAN_JDBC_CL_DATASOURCE, null);
+ // if data source is defined, then inject correct data-types.
+ // Also it cans be not defined and nothing should be injected
+ //(i.e. no cache loader is used (possibly pattern is changed, to used another cache loader))
+ if (dataSourceName != null)
+ {
+ String dialect;
+ // detect dialect of data-source
+ try
+ {
+ final DataSource dataSource = (DataSource)new InitialContext().lookup(dataSourceName);
+ if (dataSource == null)
+ {
+ throw new RepositoryException("DataSource (" + dataSourceName + ") can't be null");
+ }
+
+ Connection jdbcConn = null;
+ try
+ {
+ PrivilegedExceptionAction<Connection> action = new PrivilegedExceptionAction<Connection>()
+ {
+ public Connection run() throws Exception
+ {
+ return dataSource.getConnection();
+ }
+ };
+ try
+ {
+ jdbcConn = SecurityHelper.doPrivilegedExceptionAction(action);
+ }
+ catch (PrivilegedActionException pae)
+ {
+ Throwable cause = pae.getCause();
+ if (cause instanceof SQLException)
+ {
+ throw (SQLException)cause;
+ }
+ else if (cause instanceof RuntimeException)
+ {
+ throw (RuntimeException)cause;
+ }
+ else
+ {
+ throw new RuntimeException(cause);
+ }
+ }
+
+ dialect = DialectDetecter.detect(jdbcConn.getMetaData());
+ }
+ finally
+ {
+ if (jdbcConn != null && !jdbcConn.isClosed())
+ {
+ try
+ {
+ jdbcConn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException("Error of connection close", e);
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new RepositoryException("Error configuring JDBC cache loader", e);
+ }
+
+ // default values, will be overridden with types suitable for concrete data base.
+ String blobType = "BLOB";
+ String charType = "VARCHAR(512)";
+ String timeStampType = "BIGINT";
+ // HSSQL
+ if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_HSQLDB))
+ {
+ blobType = "VARBINARY(65535)";
+ }
+ // MYSQL
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_MYSQL)
+ || dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_MYSQL_UTF8)
+ || dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_MYSQL_MYISAM)
+ || dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_MYSQL_MYISAM_UTF8))
+ {
+ blobType = "LONGBLOB";
+ }
+ // ORACLE
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_ORACLE)
+ || dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_ORACLEOCI))
+ {
+ // Oracle suggests the use VARCHAR2 instead of VARCHAR while declaring data type.
+ charType = "VARCHAR2(512)";
+ timeStampType = "NUMBER(19, 0)";
+ }
+ // POSTGRE SQL
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_PGSQL))
+ {
+ blobType = "bytea";
+ }
+ // Microsoft SQL
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_MSSQL))
+ {
+ blobType = "VARBINARY(MAX)";
+ }
+ // SYBASE
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_SYBASE))
+ {
+ blobType = "IMAGE";
+ }
+ // INGRES
+ else if (dialect.equalsIgnoreCase(DBConstants.DB_DIALECT_INGRES))
+ {
+ blobType = "long byte";
+ }
+ // else GENERIC, DB2 etc
+
+ // set parameters if not defined
+ // if parameter is missing in configuration, then
+ // getParameterValue(INFINISPAN_JDBC_CL_DATA_COLUMN, INFINISPAN_JDBC_CL_AUTO)
+ // will return INFINISPAN_JDBC_CL_AUTO. If parameter is present in configuration and
+ //equals to "auto", then it should be replaced
+ // with correct value for given database
+ if (parameterEntry.getParameterValue(INFINISPAN_JDBC_CL_DATA_COLUMN, INFINISPAN_JDBC_CL_AUTO)
+ .equalsIgnoreCase(INFINISPAN_JDBC_CL_AUTO))
+ {
+ parameterEntry.putParameterValue(INFINISPAN_JDBC_CL_DATA_COLUMN, blobType);
+ }
+
+ if (parameterEntry.getParameterValue(INFINISPAN_JDBC_CL_ID_COLUMN, INFINISPAN_JDBC_CL_AUTO).equalsIgnoreCase(
+ INFINISPAN_JDBC_CL_AUTO))
+ {
+ parameterEntry.putParameterValue(INFINISPAN_JDBC_CL_ID_COLUMN, charType);
+ }
+
+ if (parameterEntry.getParameterValue(INFINISPAN_JDBC_CL_TIMESTAMP_COLUMN, INFINISPAN_JDBC_CL_AUTO)
+ .equalsIgnoreCase(INFINISPAN_JDBC_CL_AUTO))
+ {
+ parameterEntry.putParameterValue(INFINISPAN_JDBC_CL_TIMESTAMP_COLUMN, timeStampType);
+ }
+ }
+ else
+ {
+ LOG.warn("CacheLoader DataSource " + INFINISPAN_JDBC_CL_DATASOURCE + " is not configured.");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void stop()
+ {
+ super.stop();
+ PrivilegedISPNCacheHelper.stop(cache);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected synchronized void internalLock(String sessionId, String nodeIdentifier) throws LockException
+ {
+ CacheableSessionLockManager session = sessionLockManagers.get(sessionId);
+ if (session != null && session.containsPendingLock(nodeIdentifier))
+ {
+ LockData lockData = session.getPendingLock(nodeIdentifier);
+
+ // this will return null if success. And old data if something exists...
+ LockData oldLockData = doPut(lockData);
+
+ if (oldLockData != null)
+ {
+ throw new LockException("Unable to write LockData. Node [" + lockData.getNodeIdentifier()
+ + "] already has LockData!");
+ }
+
+ session.notifyLockPersisted(nodeIdentifier);
+ }
+ else
+ {
+ throw new LockException("No lock in pending locks");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected synchronized void internalUnLock(String sessionId, String nodeIdentifier) throws LockException
+ {
+ LockData lData = getLockDataById(nodeIdentifier);
+
+ if (lData != null)
+ {
+ doRemove(lData);
+
+ CacheableSessionLockManager sessMgr = sessionLockManagers.get(sessionId);
+ if (sessMgr != null)
+ {
+ sessMgr.notifyLockRemoved(nodeIdentifier);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected LockData doPut(LockData lockData)
+ {
+ return (LockData)PrivilegedISPNCacheHelper.putIfAbsent(cache, lockData.getNodeIdentifier(), lockData);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doRemove(LockData lockData)
+ {
+ cache.remove(lockData.getNodeIdentifier());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isAloneInCluster()
+ {
+ return cache.getConfiguration().getCacheMode() == CacheMode.LOCAL
+ || cache.getCacheManager().getMembers().size() == 1;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doClean()
+ {
+ if (cache.getStatus() == ComponentStatus.RUNNING)
+ {
+ for (LockData lockData : getLockList())
+ {
+ doRemove(lockData);
+ }
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/AbstractIndexerCacheStore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/AbstractIndexerCacheStore.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/AbstractIndexerCacheStore.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper;
+import org.exoplatform.services.jcr.impl.core.query.Indexer;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
+import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.container.entries.InternalCacheEntry;
+import org.infinispan.context.Flag;
+import org.infinispan.loaders.AbstractCacheStore;
+import org.infinispan.loaders.AbstractCacheStoreConfig;
+import org.infinispan.loaders.CacheLoaderConfig;
+import org.infinispan.loaders.CacheLoaderException;
+
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+
+/**
+ * Abstract Indexer Cache Loader defines default implementation of data processing received via cache.
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: AbstractInputCacheStore.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public abstract class AbstractIndexerCacheStore extends AbstractCacheStore
+{
+
+ /**
+ * A map of all the indexers that has been registered
+ */
+ protected final Map<String, Indexer> indexers = new HashMap<String, Indexer>();
+
+ protected static final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.IndexerCacheLoader");
+
+ /**
+ * Executor used to remove all the entries that have already been treated. We
+ * need it because starting from ISPN 5.1 even changes applied in auto commit
+ * mode are done within a transaction so if we try to drop the entries
+ * directly we get an IllegalStateException because the operation is done
+ * during a commit and if we try to execute it outside the transaction we
+ * create a deadlock as the lock on the entry is hold by the suspended transaction
+ */
+ private static final ExecutorService EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactory()
+ {
+ private final ThreadGroup group;
+ {
+ SecurityManager s = System.getSecurityManager();
+ group = (s != null) ? s.getThreadGroup() : Thread.currentThread().getThreadGroup();
+ }
+
+ public Thread newThread(Runnable r)
+ {
+ Thread t = new Thread(group, r, "IndexerCacheStoreCleaner", 0);
+ t.setDaemon(true);
+ return t;
+ }
+ });
+
+ /**
+ * This method will register a new Indexer according to the given parameters.
+ *
+ * @param searchManager
+ * @param parentSearchManager
+ * @param handler
+ * @param parentHandler
+ * @throws RepositoryConfigurationException
+ */
+ public void register(SearchManager searchManager, SearchManager parentSearchManager, QueryHandler handler,
+ QueryHandler parentHandler) throws RepositoryConfigurationException
+ {
+ indexers.put(searchManager.getWsId(), new Indexer(searchManager, parentSearchManager, handler,
+ parentHandler));
+ if (log.isDebugEnabled())
+ {
+ log.debug("Register " + searchManager.getWsId() + " " + this + " in " + indexers);
+ }
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheStore#store(org.infinispan.container.entries.InternalCacheEntry)
+ */
+ public void store(InternalCacheEntry entry) throws CacheLoaderException
+ {
+ if (entry.getKey() instanceof ChangesKey && entry.getValue() instanceof ChangesFilterListsWrapper)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.info("Received list wrapper, start indexing...");
+ }
+ // updating index
+ ChangesFilterListsWrapper wrapper = (ChangesFilterListsWrapper)entry.getValue();
+ final ChangesKey key = (ChangesKey)entry.getKey();
+ try
+ {
+ Indexer indexer = indexers.get(key.getWsId());
+ if (indexer == null)
+ {
+ log.warn("No indexer could be found for the cache entry " + key.toString());
+ if (log.isDebugEnabled())
+ {
+ log.debug("The current content of the map of indexers is " + indexers);
+ }
+ }
+ else if (wrapper.withChanges())
+ {
+ indexer.updateIndex(wrapper.getChanges(), wrapper.getParentChanges());
+ }
+ else
+ {
+ indexer.updateIndex(wrapper.getAddedNodes(), wrapper.getRemovedNodes(), wrapper.getParentAddedNodes(),
+ wrapper.getParentRemovedNodes());
+ }
+ }
+ finally
+ {
+ if (getModeHandler().getMode() == IndexerIoMode.READ_WRITE)
+ {
+ // remove the data from the cache
+ EXECUTOR.submit(new Runnable()
+ {
+ public void run()
+ {
+ cache.getAdvancedCache().withFlags(Flag.SKIP_LOCKING, Flag.FORCE_ASYNCHRONOUS, Flag.SKIP_REMOTE_LOOKUP).removeAsync(key);
+ }
+ });
+ }
+ }
+ }
+ }
+
+ /**
+ * @return IndexerIoModeHandler instance
+ */
+ public abstract IndexerIoModeHandler getModeHandler();
+
+ // ===================================================
+
+ /**
+ * @see org.infinispan.loaders.CacheLoader#getConfigurationClass()
+ */
+ public Class<? extends CacheLoaderConfig> getConfigurationClass()
+ {
+ return AbstractCacheStoreConfig.class;
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheStore#fromStream(java.io.ObjectInput)
+ */
+ public void fromStream(ObjectInput inputStream) throws CacheLoaderException
+ {
+ throw new UnsupportedOperationException("This operation is not supported by this component.");
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheStore#toStream(java.io.ObjectOutput)
+ */
+ public void toStream(ObjectOutput outputStream) throws CacheLoaderException
+ {
+ throw new UnsupportedOperationException("This operation is not supported by this component.");
+ }
+
+ /**
+ * @see org.infinispan.loaders.AbstractCacheStore#purgeInternal()
+ */
+ @Override
+ protected void purgeInternal() throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheStore#clear()
+ */
+ public void clear() throws CacheLoaderException
+ {
+ throw new UnsupportedOperationException("This operation is not supported by this component.");
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheStore#remove(java.lang.Object)
+ */
+ public boolean remove(Object key) throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ return true;
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheLoader#load(java.lang.Object)
+ */
+ public InternalCacheEntry load(Object key) throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ return null;
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheLoader#load(int)
+ */
+ public Set<InternalCacheEntry> load(int numEntries) throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ return null;
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheLoader#loadAll()
+ */
+ public Set<InternalCacheEntry> loadAll() throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ return null;
+ }
+
+ /**
+ * @see org.infinispan.loaders.CacheLoader#loadAllKeys(java.util.Set)
+ */
+ public Set<Object> loadAllKeys(Set<Object> keysToExclude) throws CacheLoaderException
+ {
+ // This cacheStore only accepts data
+ return null;
+ }
+
+}
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.CacheKey;
+
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 22.02.011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: ChangesKey.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class ChangesKey extends CacheKey
+{
+ private String wsId;
+
+ ChangesKey()
+ {
+ super();
+ }
+
+ ChangesKey(String wsId, String id)
+ {
+ super(id);
+ this.wsId = wsId;
+ }
+
+ /**
+ * @return unique workspace identifier
+ */
+ public String getWsId()
+ {
+ return wsId;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ super.writeExternal(out);
+ byte[] buf = wsId.getBytes(Constants.DEFAULT_ENCODING);
+ out.writeInt(buf.length);
+ out.write(buf);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ super.readExternal(in);
+ byte[] buf = new byte[in.readInt()];
+ in.readFully(buf);
+ wsId = new String(buf, Constants.DEFAULT_ENCODING);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof ChangesKey)
+ {
+ ChangesKey key = (ChangesKey)obj;
+ return (key.hash == hash && key.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexChangesFilter.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexChangesFilter.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper;
+import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.impl.core.query.IndexingTree;
+import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
+import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
+import org.exoplatform.services.jcr.util.IdGenerator;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.Cache;
+import org.infinispan.context.Flag;
+import org.infinispan.loaders.CacheLoaderManager;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 23.02.2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: ISPNIndexChangesFilter.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class ISPNIndexChangesFilter extends IndexerChangesFilter
+{
+ /**
+ * Logger instance for this class.
+ */
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.ISPNIndexChangesFilter");
+
+ public static final String PARAM_INFINISPAN_CACHESTORE_CLASS = "infinispan-cachestore-classname";
+
+ /**
+ * ISPN cache.
+ */
+ private final Cache<Serializable, Object> cache;
+
+ /**
+ * Unique workspace identifier.
+ */
+ private final String wsId;
+
+ /**
+ * ISPNIndexChangesFilter constructor.
+ */
+ public ISPNIndexChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
+ QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
+ QueryHandler parentHandler, ConfigurationManager cfm) throws IOException, RepositoryException,
+ RepositoryConfigurationException
+ {
+ super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler, cfm);
+
+ this.wsId = searchManager.getWsId();
+
+ ISPNCacheFactory<Serializable, Object> factory = new ISPNCacheFactory<Serializable, Object>(cfm);
+ config.putParameterValue(PARAM_INFINISPAN_CACHESTORE_CLASS, IndexerCacheStore.class.getName());
+ this.cache = factory.createCache("Indexer_" + searchManager.getWsId(), config);
+
+ CacheLoaderManager cacheLoaderManager =
+ cache.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class);
+ IndexerCacheStore cacheStore = (IndexerCacheStore)cacheLoaderManager.getCacheLoader();
+
+ cacheStore.register(searchManager, parentSearchManager, handler, parentHandler);
+ IndexerIoModeHandler modeHandler = cacheStore.getModeHandler();
+ handler.setIndexerIoModeHandler(modeHandler);
+ parentHandler.setIndexerIoModeHandler(modeHandler);
+
+ if (!parentHandler.isInitialized())
+ {
+ parentHandler.setIndexInfos(new ISPNIndexInfos(searchManager.getWsId(), cache, true, modeHandler));
+ parentHandler.setIndexUpdateMonitor(new ISPNIndexUpdateMonitor(searchManager.getWsId(), cache, true,
+ modeHandler));
+ parentHandler.init();
+ }
+ if (!handler.isInitialized())
+ {
+ handler.setIndexInfos(new ISPNIndexInfos(searchManager.getWsId(), cache, false, modeHandler));
+ handler.setIndexUpdateMonitor(new ISPNIndexUpdateMonitor(searchManager.getWsId(), cache, false, modeHandler));
+ handler.init();
+ }
+ }
+
+ protected Log getLogger()
+ {
+ return log;
+ }
+
+ protected void doUpdateIndex(ChangesFilterListsWrapper changes)
+ {
+ ChangesKey changesKey = new ChangesKey(wsId, IdGenerator.generate());
+ cache.getAdvancedCache().withFlags(Flag.SKIP_LOCKING).put(changesKey, changes);
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter#isShared()
+ */
+ public boolean isShared()
+ {
+ return true;
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexInfos.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos;
+import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex;
+import org.exoplatform.services.jcr.infinispan.PrivilegedISPNCacheHelper;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.ActionNonTxAware;
+import org.infinispan.Cache;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
+import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 22.02.2011
+ *
+ * List of indexes is stored in FS and all operations with it are wrapped by IndexInfos class. In
+ * standalone mode index and so the list of indexes are managed by indexer and can't be changed
+ * externally.
+ * But in cluster environment all JCR Indexers are reading from shared file system and only one
+ * cluster node is writing this index. So read-only cluster nodes should be notified when content
+ * of index (actually list of index segments) is changed.
+ * This class is responsible for storing list of segments (indexes) in ISPN cache.
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: ISPNIndexInfos.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+@Listener
+public class ISPNIndexInfos extends IndexInfos implements IndexerIoModeListener
+{
+
+ /**
+ * Logger.
+ */
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.ISPNIndexInfos");
+
+ private static final String INDEX_NAMES = "$names".intern();
+
+ private static final String SYSINDEX_NAMES = "$sysNames".intern();
+
+ /**
+ * ISPN cache.
+ */
+ private final Cache<Serializable, Object> cache;
+
+ /**
+ * Used to retrieve the current mode.
+ */
+ private final IndexerIoModeHandler modeHandler;
+
+ /**
+ * Cache key for storing index names.
+ */
+ private final IndexInfosKey namesKey;
+
+ /**
+ * Need to write the index info out of the current transaction
+ * due to the fact that even in auto commit mode, changes are now applied
+ * within a transaction starting from ISPN 5.1
+ */
+ private final ActionNonTxAware<Void, Void, RuntimeException> write =
+ new ActionNonTxAware<Void, Void, RuntimeException>()
+ {
+
+ @Override
+ protected TransactionManager getTransactionManager()
+ {
+ return cache.getAdvancedCache().getTransactionManager();
+ }
+
+ @Override
+ protected Void execute(Void arg) throws RuntimeException
+ {
+ PrivilegedISPNCacheHelper.put(cache, namesKey, getNames());
+ return null;
+ }
+ };
+
+ /**
+ * ISPNIndexInfos constructor.
+ *
+ * @param wsId
+ * unique workspace identifier
+ * @param cache
+ * ISPN cache
+ * @param system
+ * notifies if this IndexInfos is from system search manager or not
+ * @param modeHandler
+ * used to retrieve the current mode
+ */
+ public ISPNIndexInfos(String wsId, Cache<Serializable, Object> cache, boolean system,
+ IndexerIoModeHandler modeHandler)
+ {
+ this(wsId, DEFALUT_NAME, cache, system, modeHandler);
+ }
+
+ /**
+ * ISPNIndexInfos constructor.
+ *
+ * @param wsId
+ * unique workspace identifier
+ * @param fileName
+ * name of the file where the infos are stored.
+ * @param cache
+ * ISPN cache
+ * @param system
+ * notifies if this IndexInfos is from system search manager or not
+ * @param modeHandler
+ * used to retrieve the current mode
+ */
+ public ISPNIndexInfos(String wsId, String fileName, Cache<Serializable, Object> cache, boolean system,
+ IndexerIoModeHandler modeHandler)
+ {
+ super(fileName);
+ this.cache = cache;
+ this.modeHandler = modeHandler;
+ this.modeHandler.addIndexerIoModeListener(this);
+ this.namesKey = new IndexInfosKey(wsId + (system ? SYSINDEX_NAMES : INDEX_NAMES));
+
+ if (modeHandler.getMode() == IndexerIoMode.READ_ONLY)
+ {
+ // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
+ cache.addListener(this);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onChangeMode(IndexerIoMode mode)
+ {
+ if (mode == IndexerIoMode.READ_WRITE)
+ {
+ // Now is read-write. Index list is actual and shouldn't be refreshed.
+ // Remove listener to avoid asserting if ioMode is RO on each cache event
+ cache.removeListener(this);
+ // re-read from FS current actual list.
+ try
+ {
+ super.read();
+ }
+ catch (IOException e)
+ {
+ log.error("Cannot read the list of index names", e);
+ }
+ }
+ else
+ {
+ // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
+ cache.addListener(this);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void write() throws IOException
+ {
+ // if READ_WRITE and is dirty, then flush.
+ if (isDirty() && modeHandler.getMode() == IndexerIoMode.READ_WRITE)
+ {
+ // write to FS
+ super.write();
+
+ // write to cache
+ write.run();
+ }
+ }
+
+ /**
+ * Method will be invoked when a cache entry has been modified only in READ_ONLY mode.
+ *
+ * @param event
+ * CacheEntryModifiedEvent
+ */
+ @CacheEntryModified
+ public void cacheEntryModified(CacheEntryModifiedEvent event)
+ {
+ if (!event.isPre() && event.getKey().equals(namesKey))
+ {
+ Set<String> set = (Set<String>)event.getValue();
+ if (set != null)
+ {
+ setNames(set);
+
+ // callback multiIndex to refresh lists
+ try
+ {
+ MultiIndex multiIndex = getMultiIndex();
+ if (multiIndex != null)
+ {
+ multiIndex.refreshIndexList();
+ }
+ }
+ catch (IOException e)
+ {
+ log.error("Failed to update indexes! " + e.getMessage(), e);
+ }
+ }
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ISPNIndexUpdateMonitor.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor;
+import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitorListener;
+import org.exoplatform.services.jcr.infinispan.PrivilegedISPNCacheHelper;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.ActionNonTxAware;
+import org.infinispan.Cache;
+import org.infinispan.CacheException;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
+import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 22.02.2011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: ISPNIndexUpdateMonitor.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+@Listener
+public class ISPNIndexUpdateMonitor implements IndexUpdateMonitor, IndexerIoModeListener
+{
+ /**
+ * Logger instance for this class
+ */
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.ISPNIndexUpdateMonitor");
+
+ /**
+ * ISPN cache.
+ */
+ private final Cache<Serializable, Object> cache;
+
+ private boolean localUpdateInProgress = false;
+
+ private static final String INDEX_PARAMETERS = "$index_parameters".intern();
+
+ private static final String SYSINDEX_PARAMETERS = "$sysindex_parameters".intern();
+
+ public final IndexerIoModeHandler modeHandler;
+
+ /**
+ * Need to set the flag "update in progress" out of the current transaction
+ * due to the fact that even in auto commit mode, changes are now applied
+ * within a transaction starting from ISPN 5.1
+ */
+ private final ActionNonTxAware<Void, Boolean, RuntimeException> setUpdateInProgress =
+ new ActionNonTxAware<Void, Boolean, RuntimeException>()
+ {
+
+ @Override
+ protected TransactionManager getTransactionManager()
+ {
+ return cache.getAdvancedCache().getTransactionManager();
+ }
+
+ @Override
+ protected Void execute(Boolean updateInProgress) throws RuntimeException
+ {
+ PrivilegedISPNCacheHelper.put(cache, updateKey, updateInProgress);
+ return null;
+ }
+ };
+
+ /**
+ * The list of all the listeners
+ */
+ private final List<IndexUpdateMonitorListener> listeners;
+
+ /**
+ * Cache key for sending notifications.
+ */
+ private final IndexUpdateKey updateKey;
+
+ /**
+ * ISPNIndexUpdateMonitor constructor.
+ *
+ * @param wsId
+ * unique workspace identifier
+ * @param cache
+ * ISPN cache
+ * @param system
+ * notifies if this IndexInfos is from system search manager or not
+ * @param modeHandler
+ * used to retrieve the current mode
+ */
+ public ISPNIndexUpdateMonitor(String wsId, Cache<Serializable, Object> cache, boolean system,
+ IndexerIoModeHandler modeHandler)
+ {
+ this.cache = cache;
+ this.modeHandler = modeHandler;
+ this.listeners = new CopyOnWriteArrayList<IndexUpdateMonitorListener>();
+ this.modeHandler.addIndexerIoModeListener(this);
+ this.updateKey = new IndexUpdateKey(wsId + (system ? SYSINDEX_PARAMETERS : INDEX_PARAMETERS));
+
+ if (IndexerIoMode.READ_WRITE == modeHandler.getMode())
+ {
+ // global, replicated set
+ setUpdateInProgress(false, true);
+ }
+ else
+ {
+ // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
+ cache.addListener(this);
+ Object value = cache.get(updateKey);
+ localUpdateInProgress = value != null ? (Boolean)value : false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onChangeMode(IndexerIoMode mode)
+ {
+ if (mode == IndexerIoMode.READ_WRITE)
+ {
+ // In READ_WRITE, the value of UpdateInProgress is changed locally so no need to listen
+ // to the cache
+ cache.removeListener(this);
+ }
+ else
+ {
+ // In READ_ONLY, the value of UpdateInProgress will be changed remotely, so we have
+ // no need but to listen to the cache to be notified when the value changes
+ cache.addListener(this);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean getUpdateInProgress()
+ {
+ return localUpdateInProgress;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
+ {
+ if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
+ {
+ throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
+ }
+ try
+ {
+ // anyway set local update in progress
+ localUpdateInProgress = updateInProgress;
+ if (persitentUpdate)
+ {
+ setUpdateInProgress.run(new Boolean(updateInProgress));
+ }
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(updateInProgress);
+ }
+
+ }
+ catch (CacheException e)
+ {
+ log.error("Fail to change updateInProgress mode to " + updateInProgress, e);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addIndexUpdateMonitorListener(IndexUpdateMonitorListener listener)
+ {
+ listeners.add(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeIndexUpdateMonitorListener(IndexUpdateMonitorListener listener)
+ {
+ listeners.remove(listener);
+ }
+
+ /**
+ * Method will be invoked when a cache entry has been modified only in READ_ONLY mode.
+ *
+ * @param event
+ * CacheEntryModifiedEvent
+ */
+ @CacheEntryModified
+ public void cacheEntryModified(CacheEntryModifiedEvent event)
+ {
+ if (!event.isPre() && event.getKey().equals(updateKey))
+ {
+ Object value = event.getValue();
+ localUpdateInProgress = value != null ? (Boolean)value : false;
+
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(localUpdateInProgress);
+ }
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.CacheKey;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 22.02.011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: IndexNamesKey.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class IndexInfosKey extends CacheKey
+{
+ IndexInfosKey()
+ {
+ super();
+ }
+
+ IndexInfosKey(String id)
+ {
+ super(id);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof IndexInfosKey)
+ {
+ IndexInfosKey key = (IndexInfosKey)obj;
+ return (key.hash == hash && key.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.CacheKey;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * Date: 22.02.011
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: IndexUpdateKey.java 34360 2010-11-11 11:11:11Z tolusha $
+ */
+public class IndexUpdateKey extends CacheKey
+{
+
+ IndexUpdateKey()
+ {
+ super();
+ }
+
+ IndexUpdateKey(String id)
+ {
+ super(id);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof IndexUpdateKey)
+ {
+ IndexUpdateKey key = (IndexUpdateKey)obj;
+ return (key.hash == hash && key.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexerCacheStore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexerCacheStore.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexerCacheStore.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.util.IdGenerator;
+import org.infinispan.Cache;
+import org.infinispan.config.Configuration.CacheMode;
+import org.infinispan.container.DataContainer;
+import org.infinispan.container.entries.InternalCacheEntry;
+import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.loaders.CacheLoaderConfig;
+import org.infinispan.loaders.CacheLoaderException;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.marshall.StreamingMarshaller;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted;
+import org.infinispan.notifications.cachemanagerlistener.annotation.ViewChanged;
+import org.infinispan.notifications.cachemanagerlistener.event.Event;
+import org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent;
+import org.infinispan.remoting.transport.Address;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+/**
+ * Implements Cache Store for clustered environment. It gives control of Index for coordinator and
+ * adds failover mechanisms when it changes.
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: IndexCacheLoader.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class IndexerCacheStore extends AbstractIndexerCacheStore
+{
+ protected volatile IndexerIoModeHandler modeHandler;
+
+ protected CacheListener listener;
+
+ /**
+ * Address instance that allows SingletonStore to find out whether it became the coordinator of the cluster, or
+ * whether it stopped being it. This dictates whether the SingletonStore is active or not.
+ */
+ private Address localAddress;
+
+ /**
+ * Whether the the current cache is the coordinator and therefore SingletonStore is active. Being active means
+ * delegating calls to the underlying cache loader.
+ */
+ private volatile boolean coordinator;
+
+ protected EmbeddedCacheManager cacheManager;
+
+ @Override
+ public void init(CacheLoaderConfig config, Cache<?, ?> cache, StreamingMarshaller m) throws CacheLoaderException
+ {
+ super.init(config, cache, m);
+ this.cacheManager = cache == null ? null : (EmbeddedCacheManager)cache.getCacheManager();
+ listener = new CacheListener();
+ cacheManager.addListener(listener);
+ }
+
+ /**
+ * Set the mode handler
+ * @param modeHandler
+ */
+ public IndexerIoModeHandler getModeHandler()
+ {
+ if (modeHandler == null)
+ {
+
+ if (cache.getStatus() != ComponentStatus.RUNNING)
+ {
+ throw new IllegalStateException("The cache should be started first");
+ }
+ synchronized (this)
+ {
+ if (modeHandler == null)
+ {
+ this.modeHandler =
+ new IndexerIoModeHandler(cacheManager.isCoordinator()
+ || cache.getConfiguration().getCacheMode() == CacheMode.LOCAL ? IndexerIoMode.READ_WRITE
+ : IndexerIoMode.READ_ONLY);
+ }
+ }
+ }
+ return modeHandler;
+ }
+
+ /**
+ * Indicates whether the current cache is the coordinator of the cluster. This implementation assumes that the
+ * coordinator is the first member in the list.
+ *
+ * @param newView View instance containing the new view of the cluster
+ * @return whether the current cache is the coordinator or not.
+ */
+ private boolean isCoordinator(List<Address> newView, Address currentAddress)
+ {
+ if (!currentAddress.equals(localAddress))
+ {
+ localAddress = currentAddress;
+ }
+ if (localAddress != null)
+ {
+ return !newView.isEmpty() && localAddress.equals(newView.get(0));
+ }
+ else
+ {
+ /* Invalid new view, so previous value returned */
+ return coordinator;
+ }
+ }
+
+ /**
+ * Method called when the cache either becomes the coordinator or stops being the coordinator. If it becomes the
+ * coordinator, it can optionally start the in-memory state transfer to the underlying cache store.
+ *
+ * @param newActiveState true if the cache just became the coordinator, false if the cache stopped being the
+ * coordinator.
+ */
+ protected void activeStatusChanged(final boolean newActiveState)
+ {
+ // originally came from EXOJCR-1345.
+ // Deadlock occurs inside JGroups, if calling some operations inside the same thread,
+ // invoking ViewChanged. That's why, need to perform operation in separated async tread.
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ coordinator = newActiveState;
+
+ getModeHandler().setMode(coordinator ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY);
+ log.info("Set indexer io mode to:" + (coordinator ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY));
+
+ if (coordinator)
+ {
+ doPushState();
+ }
+ }
+ }, "JCR Indexer ActiveStatusChanged-handler").start();
+ }
+
+ /**
+ * Flushes all cache content to underlying CacheStore
+ */
+ protected void doPushState()
+ {
+ final boolean debugEnabled = log.isDebugEnabled();
+
+ if (debugEnabled)
+ {
+ log.debug("start pushing in-memory state to cache cacheLoader collection");
+ }
+
+ Map<String, ChangesFilterListsWrapper> changesMap = new HashMap<String, ChangesFilterListsWrapper>();
+ List<ChangesKey> processedItemKeys = new ArrayList<ChangesKey>();
+
+ DataContainer dc = cache.getAdvancedCache().getDataContainer();
+ Set keys = dc.keySet();
+ InternalCacheEntry entry;
+ // collect all cache entries into the following map:
+ // <WS ID> : <Concated lists of added/removed nodes>
+ for (Object k : keys)
+ {
+ if ((entry = dc.get(k)) != null)
+ {
+ if (entry.getValue() instanceof ChangesFilterListsWrapper && entry.getKey() instanceof ChangesKey)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.info("Received list wrapper, start indexing...");
+ }
+ // get stale List that was not processed
+ ChangesFilterListsWrapper staleListIncache = (ChangesFilterListsWrapper)entry.getValue();
+ ChangesKey key = (ChangesKey)entry.getKey();
+ // get newly created wrapper instance
+ ChangesFilterListsWrapper listToPush = changesMap.get(key.getWsId());
+ if (listToPush == null)
+ {
+ listToPush =
+ new ChangesFilterListsWrapper(new HashSet<String>(), new HashSet<String>(), new HashSet<String>(),
+ new HashSet<String>());
+ changesMap.put(key.getWsId(), listToPush);
+ }
+ // copying lists into the new wrapper
+ listToPush.getParentAddedNodes().addAll(staleListIncache.getParentAddedNodes());
+ listToPush.getParentRemovedNodes().addAll(staleListIncache.getParentRemovedNodes());
+
+ listToPush.getAddedNodes().addAll(staleListIncache.getAddedNodes());
+ listToPush.getRemovedNodes().addAll(staleListIncache.getRemovedNodes());
+ processedItemKeys.add(key);
+ }
+ }
+
+ }
+
+ // process all lists for each workspace
+ for (Entry<String, ChangesFilterListsWrapper> changesEntry : changesMap.entrySet())
+ {
+ // create key based on wsId and generated id
+ ChangesKey changesKey = new ChangesKey(changesEntry.getKey(), IdGenerator.generate());
+ cache.putAsync(changesKey, changesEntry.getValue());
+ }
+
+ for (ChangesKey key : processedItemKeys)
+ {
+ cache.removeAsync(key);
+ }
+
+ if (debugEnabled)
+ {
+ log.debug("in-memory state passed to cache cacheStore successfully");
+ }
+ }
+
+ @Listener
+ public class CacheListener
+ {
+ @CacheStarted
+ public void cacheStarted(Event e)
+ {
+ localAddress = cacheManager.getAddress();
+ coordinator = cacheManager.isCoordinator();
+ }
+
+ /**
+ * The cluster formation changed, so determine whether the current cache stopped being the coordinator or became
+ * the coordinator. This method can lead to an optional in memory to cache loader state push, if the current cache
+ * became the coordinator. This method will report any issues that could potentially arise from this push.
+ */
+ @ViewChanged
+ public void viewChange(ViewChangedEvent event)
+ {
+ boolean tmp = isCoordinator(event.getNewMembers(), event.getLocalAddress());
+
+ if (coordinator != tmp)
+ {
+ activeStatusChanged(tmp);
+ }
+ }
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexCacheStore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexCacheStore.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexCacheStore.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+
+/**
+ * Implements Cache Store that designed to be used when each cluster node has it's own local index
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: LocalIndexerCacheStore.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class LocalIndexCacheStore extends AbstractIndexerCacheStore
+{
+
+ protected volatile IndexerIoModeHandler modeHandler;
+
+ public LocalIndexCacheStore()
+ {
+ super();
+ this.modeHandler = new IndexerIoModeHandler(IndexerIoMode.READ_WRITE); // initialize mode handler
+ }
+
+ @Override
+ public IndexerIoModeHandler getModeHandler()
+ {
+ return modeHandler;
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexChangesFilter.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/LocalIndexChangesFilter.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.core.query.ispn;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.core.query.ChangesFilterListsWrapper;
+import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
+import org.exoplatform.services.jcr.impl.core.query.IndexingTree;
+import org.exoplatform.services.jcr.impl.core.query.LocalIndexMarker;
+import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
+import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
+import org.exoplatform.services.jcr.util.IdGenerator;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.Cache;
+import org.infinispan.context.Flag;
+import org.infinispan.loaders.CacheLoaderManager;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * This type of ChangeFilter offers an ability for each cluster instance to have own
+ * local index (stack of indexes, from persistent to volatile). It uses ISPN cache for
+ * Lucene Documents and UUIDs delivery. Each node works in ReadWrite mode, so manages
+ * it own volatile, merger, local list of persisted indexes and stand-alone
+ * UpdateInProgressMonitor implementation.
+ * This implementation is similar to ISPNIndexChangesFilter but does not use
+ * ISPNIndexInfoss and ISPNIndexUpdateMonitor classes.
+ *
+ * @author <a href="mailto:anatoliy.bazko@gmail.com">Anatoliy Bazko</a>
+ * @version $Id: LocalIndexChangesFilter.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class LocalIndexChangesFilter extends IndexerChangesFilter implements LocalIndexMarker
+{
+ /**
+ * Logger instance for this class
+ */
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.LocalIndexChangesFilter");
+
+ public static final String PARAM_INFINISPAN_CACHESTORE_CLASS = "infinispan-cachestore-classname";
+
+ private final Cache<Serializable, Object> cache;
+
+ private final String wsId;
+
+ /**
+ * LocalIndexChangesFilter constructor.
+ */
+ public LocalIndexChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
+ QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
+ QueryHandler parentHandler, ConfigurationManager cfm) throws IOException, RepositoryException,
+ RepositoryConfigurationException
+ {
+ super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler, cfm);
+
+ this.wsId = searchManager.getWsId();
+ ISPNCacheFactory<Serializable, Object> factory = new ISPNCacheFactory<Serializable, Object>(cfm);
+ config.putParameterValue(PARAM_INFINISPAN_CACHESTORE_CLASS, LocalIndexCacheStore.class.getName());
+ this.cache = factory.createCache("Indexer_" + searchManager.getWsId(), config);
+
+ CacheLoaderManager cacheLoaderManager =
+ cache.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class);
+ AbstractIndexerCacheStore cacheStore = (AbstractIndexerCacheStore)cacheLoaderManager.getCacheLoader();
+
+ cacheStore.register(searchManager, parentSearchManager, handler, parentHandler);
+ IndexerIoModeHandler modeHandler = cacheStore.getModeHandler();
+ handler.setIndexerIoModeHandler(modeHandler);
+ parentHandler.setIndexerIoModeHandler(modeHandler);
+
+ // using default updateMonitor and default
+ if (!parentHandler.isInitialized())
+ {
+ parentHandler.init();
+ }
+ if (!handler.isInitialized())
+ {
+ handler.init();
+ }
+ }
+
+ protected Log getLogger()
+ {
+ return log;
+ }
+
+ protected void doUpdateIndex(ChangesFilterListsWrapper changes)
+ {
+ ChangesKey changesKey = new ChangesKey(wsId, IdGenerator.generate());
+ cache.getAdvancedCache().withFlags(Flag.SKIP_LOCKING).put(changesKey, changes);
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,1248 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.AdvancedCache;
+import org.infinispan.Cache;
+import org.infinispan.config.Configuration;
+import org.infinispan.config.Configuration.CacheMode;
+import org.infinispan.context.Flag;
+import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.infinispan.util.concurrent.NotifyingFuture;
+import org.infinispan.util.concurrent.locks.LockManager;
+
+import java.security.PrivilegedAction;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.transaction.Status;
+import javax.transaction.TransactionManager;
+
+/**
+ * Decorator over the Infinispan Cache that stores changes in buffer, then sorts and applies it.
+ *
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: BufferedISPNCache.java 3514 2010-11-22 16:14:36Z nzamosenchuk $
+ *
+ */
+@SuppressWarnings("unchecked")
+public class BufferedISPNCache implements Cache<CacheKey, Object>
+{
+ /**
+ * Parent cache.
+ */
+ private final AdvancedCache<CacheKey, Object> parentCache;
+
+ private final ThreadLocal<CompressedISPNChangesBuffer> changesList = new ThreadLocal<CompressedISPNChangesBuffer>();
+
+ private ThreadLocal<Boolean> local = new ThreadLocal<Boolean>();
+
+ /**
+ * Allow to perform local cache changes.
+ */
+ private final Boolean allowLocalChanges;
+
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.BufferedISPNCache");
+
+ public static enum ChangesType {
+ REMOVE, PUT;
+ }
+
+ /**
+ * Container for changes
+ */
+ public static abstract class ChangesContainer implements Comparable<ChangesContainer>
+ {
+ protected final CacheKey key;
+
+ protected final ChangesType changesType;
+
+ protected final AdvancedCache<CacheKey, Object> cache;
+
+ protected final int historicalIndex;
+
+ protected final boolean localMode;
+
+ private final Boolean allowLocalChanges;
+
+ public ChangesContainer(CacheKey key, ChangesType changesType, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean localMode, Boolean allowLocalChanges)
+ {
+ this.key = key;
+ this.changesType = changesType;
+ this.cache = cache;
+ this.historicalIndex = historicalIndex;
+ this.localMode = localMode;
+ this.allowLocalChanges = allowLocalChanges;
+ }
+
+ /**
+ * @return the key
+ */
+ public CacheKey getKey()
+ {
+ return key;
+ }
+
+ /**
+ * @return the index of change in original sequence
+ */
+ public int getHistoricalIndex()
+ {
+ return historicalIndex;
+ }
+
+ /**
+ * @return the changesType
+ */
+ public ChangesType getChangesType()
+ {
+ return changesType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString()
+ {
+ return key.toString() + " type=" + changesType + " historysIndex=" + historicalIndex;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int compareTo(ChangesContainer o)
+ {
+ // We use the lock manager to sort the key in order to be able
+ // to use the lock stripping more details here https://issues.jboss.org/browse/ISPN-993
+ LockManager lm = cache.getLockManager();
+ int result = lm.getLockId(key) - lm.getLockId(o.getKey());
+ return result == 0 ? historicalIndex - o.getHistoricalIndex() : result;
+ }
+
+ protected AdvancedCache<CacheKey, Object> setCacheLocalMode()
+ {
+ if (localMode)
+ {
+ if (allowLocalChanges == null)
+ {
+ CacheMode cacheMode = cache.getConfiguration().getCacheMode();
+ if (cacheMode != CacheMode.DIST_ASYNC && cacheMode != CacheMode.DIST_SYNC)
+ {
+ return cache.withFlags(Flag.CACHE_MODE_LOCAL);
+ }
+ }
+ else if (allowLocalChanges)
+ {
+ return cache.withFlags(Flag.CACHE_MODE_LOCAL);
+ }
+ }
+ return cache;
+ }
+
+ public abstract void apply();
+
+ public boolean isTxRequired()
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Put object container;
+ */
+ public static class PutObjectContainer extends ChangesContainer
+ {
+ private final Object value;
+
+ public PutObjectContainer(CacheKey key, Object value, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.PUT, cache, historicalIndex, local, allowLocalChanges);
+
+ this.value = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).put(key, value);
+ }
+ }
+
+
+ /**
+ * Put object if absent container
+ */
+ public static class PutObjectIfAbsentContainer extends ChangesContainer
+ {
+ private final Object value;
+
+ public PutObjectIfAbsentContainer(CacheKey key, Object value, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.PUT, cache, historicalIndex, local, allowLocalChanges);
+
+ this.value = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).putIfAbsent(key, value);
+ }
+ }
+
+ /**
+ * It tries to get Set by given key. If it is Set then adds new value and puts new set back. If
+ * null found, then new Set created (ordinary cache does).
+ */
+ public static class AddToListContainer extends ChangesContainer
+ {
+ private final Object value;
+
+ private final boolean forceModify;
+
+ public AddToListContainer(CacheKey key, Object value, AdvancedCache<CacheKey, Object> cache,
+ boolean forceModify, int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.PUT, cache, historicalIndex, local, allowLocalChanges);
+ this.value = value;
+ this.forceModify = forceModify;
+ }
+
+ @Override
+ public void apply()
+ {
+ // force writeLock on next read
+ Object existingObject = cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);
+ Set<Object> newSet = new HashSet<Object>();
+
+ // if set found of null, perform add
+ if (existingObject instanceof Set || (existingObject == null && forceModify))
+ {
+ // set found
+ if (existingObject instanceof Set)
+ {
+ newSet.addAll((Set<Object>)existingObject);
+ }
+ newSet.add(value);
+
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).put(key, newSet);
+ }
+ else if (existingObject != null)
+ {
+ LOG.error("Unexpected object found by key " + key.toString() + ". Expected Set, but found:"
+ + existingObject.getClass().getName());
+ }
+ else if (!localMode && cache.getConfiguration().getCacheMode() != CacheMode.LOCAL
+ && cache.getCacheManager().getMembers().size() > 1)
+ {
+ // to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
+ // and we are in a non local mode, we clear the list in order to enforce other cluster nodes to reload it from the db
+ cache.withFlags(Flag.SKIP_REMOTE_LOOKUP).remove(key);
+ return;
+ }
+ }
+
+ @Override
+ public boolean isTxRequired()
+ {
+ return true;
+ }
+ }
+
+ /**
+ * It tries to get Map{filter, Set{itemIds}} by given key. If Map exists then adds itemDatas ID to all acceptable pattern lists.
+ */
+ public static class AddToPatternListContainer extends ChangesContainer
+ {
+ private final ItemData itemData;
+
+ public AddToPatternListContainer(CacheKey key, ItemData value, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.PUT, cache, historicalIndex, local, allowLocalChanges);
+ this.itemData = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ // force writeLock on next read
+ Object existingObject = cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);
+
+ // if Map found , perform add
+ if (existingObject instanceof Map)
+ {
+ Map<QPathEntryFilter, Set<String>> newMap =
+ new HashMap<QPathEntryFilter, Set<String>>((Map<QPathEntryFilter, Set<String>>)existingObject);
+
+ Iterator<QPathEntryFilter> iterator = newMap.keySet().iterator();
+ while (iterator.hasNext())
+ {
+ QPathEntryFilter pattern = iterator.next();
+ if (pattern.accept(itemData))
+ {
+ Set<String> newSet = newMap.get(pattern);
+ newSet.add(itemData.getIdentifier());
+ newMap.put(pattern, newSet);
+ }
+ }
+
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).put(key, newMap);
+ }
+ else if (existingObject != null)
+ {
+ LOG.error("Unexpected object found by key " + key.toString() + ". Expected Map, but found:"
+ + existingObject.getClass().getName());
+ }
+ else if (!localMode && cache.getConfiguration().getCacheMode() != CacheMode.LOCAL
+ && cache.getCacheManager().getMembers().size() > 1)
+ {
+ // to prevent consistency issue since we don't have the list in the local cache, we are in cluster env
+ // and we are in a non local mode, we remove all the patterns in order to enforce other cluster nodes to reload them from the db
+ cache.withFlags(Flag.SKIP_REMOTE_LOOKUP).remove(key);
+ }
+ }
+
+ @Override
+ public boolean isTxRequired()
+ {
+ return true;
+ }
+ }
+
+ /**
+ * It tries to get set by given key. If it is set then removes value and puts new modified set
+ * back.
+ */
+ public static class RemoveFromListContainer extends ChangesContainer
+ {
+ private final Object value;
+
+ public RemoveFromListContainer(CacheKey key, Object value, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.REMOVE, cache, historicalIndex, local, allowLocalChanges);
+ this.value = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ // force writeLock on next read
+ Object existingObject = cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);
+
+ // if found value is really set! add to it.
+ if (existingObject instanceof Set)
+ {
+ Set<Object> newSet = new HashSet<Object>((Set<Object>)existingObject);
+ newSet.remove(value);
+
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).put(key, newSet);
+ }
+ }
+
+ @Override
+ public boolean isTxRequired()
+ {
+ return true;
+ }
+ }
+
+ /**
+ * It tries to get Map{filter, Set{itemIds}} by given key. IfMap exists then removes item IDs from all acceptable pattern lists.
+ */
+ public static class RemoveFromPatternListContainer extends ChangesContainer
+ {
+ private final ItemData itemData;
+
+ public RemoveFromPatternListContainer(CacheKey key, ItemData value, AdvancedCache<CacheKey, Object> cache,
+ int historicalIndex, boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.REMOVE, cache, historicalIndex, local, allowLocalChanges);
+ this.itemData = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ // force writeLock on next read
+ Object existingObject = cache.withFlags(Flag.FORCE_WRITE_LOCK).get(key);
+
+ // if found value is really set! add to it.
+ if (existingObject instanceof Map)
+ {
+ Map<QPathEntryFilter, Set<String>> newMap =
+ new HashMap<QPathEntryFilter, Set<String>>((HashMap<QPathEntryFilter, Set<String>>)existingObject);
+
+ Iterator<QPathEntryFilter> patternInterator = newMap.keySet().iterator();
+ while (patternInterator.hasNext())
+ {
+ QPathEntryFilter pattern = patternInterator.next();
+ if (pattern.accept(itemData))
+ {
+ Set<String> newSet = new HashSet<String>(newMap.get(pattern));
+ newSet.remove(itemData.getIdentifier());
+ newMap.put(pattern, newSet);
+ }
+ }
+
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).put(key, newMap);
+ }
+ }
+
+ @Override
+ public boolean isTxRequired()
+ {
+ return true;
+ }
+ }
+
+ /**
+ * Remove container.
+ */
+ public static class RemoveObjectContainer extends ChangesContainer
+ {
+ public RemoveObjectContainer(CacheKey key, AdvancedCache<CacheKey, Object> cache, int historicalIndex,
+ boolean local, Boolean allowLocalChanges)
+ {
+ super(key, ChangesType.REMOVE, cache, historicalIndex, local, allowLocalChanges);
+ }
+
+ @Override
+ public void apply()
+ {
+ setCacheLocalMode().withFlags(Flag.SKIP_REMOTE_LOOKUP).remove(key);
+ }
+ }
+
+ public BufferedISPNCache(Cache<CacheKey, Object> parentCache, Boolean allowLocalChanges)
+ {
+ this.parentCache = parentCache.getAdvancedCache();
+ this.allowLocalChanges = allowLocalChanges;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Void> clearAsync()
+ {
+ return parentCache.clearAsync();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void compact()
+ {
+ parentCache.compact();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void endBatch(boolean successful)
+ {
+ parentCache.endBatch(successful);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<java.util.Map.Entry<CacheKey, Object>> entrySet()
+ {
+ return parentCache.entrySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void evict(CacheKey key)
+ {
+ parentCache.evict(key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public AdvancedCache<CacheKey, Object> getAdvancedCache()
+ {
+ return parentCache.getAdvancedCache();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public EmbeddedCacheManager getCacheManager()
+ {
+ return parentCache.getCacheManager();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Configuration getConfiguration()
+ {
+ return parentCache.getConfiguration();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName()
+ {
+ return parentCache.getName();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ComponentStatus getStatus()
+ {
+ return parentCache.getStatus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getVersion()
+ {
+ return parentCache.getVersion();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<CacheKey> keySet()
+ {
+ return parentCache.keySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object put(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.put(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object put(CacheKey key, Object value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime,
+ TimeUnit maxIdleTimeUnit)
+ {
+ return parentCache.put(key, value, lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void putAll(Map<? extends CacheKey, ? extends Object> map, long lifespan, TimeUnit unit)
+ {
+ parentCache.putAll(map, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void putAll(Map<? extends CacheKey, ? extends Object> map, long lifespan, TimeUnit lifespanUnit,
+ long maxIdleTime, TimeUnit maxIdleTimeUnit)
+ {
+ parentCache.putAll(map, lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Void> putAllAsync(Map<? extends CacheKey, ? extends Object> data)
+ {
+ return parentCache.putAllAsync(data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Void> putAllAsync(Map<? extends CacheKey, ? extends Object> data, long lifespan,
+ TimeUnit unit)
+ {
+ return parentCache.putAllAsync(data, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Void> putAllAsync(Map<? extends CacheKey, ? extends Object> data, long lifespan,
+ TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
+ {
+ return parentCache.putAllAsync(data, lifespan, lifespanUnit, maxIdle, maxIdleUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putAsync(CacheKey key, Object value)
+ {
+ return parentCache.putAsync(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putAsync(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.putAsync(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putAsync(CacheKey key, Object value, long lifespan, TimeUnit lifespanUnit,
+ long maxIdle, TimeUnit maxIdleUnit)
+ {
+ return parentCache.putAsync(key, value, lifespan, lifespanUnit, maxIdle, maxIdleUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void putForExternalRead(CacheKey key, Object value)
+ {
+ parentCache.putForExternalRead(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object putIfAbsent(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.putIfAbsent(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object putIfAbsent(CacheKey key, Object value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime,
+ TimeUnit maxIdleTimeUnit)
+ {
+ return parentCache.putIfAbsent(key, value, lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putIfAbsentAsync(CacheKey key, Object value)
+ {
+ return parentCache.putIfAbsentAsync(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putIfAbsentAsync(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.putIfAbsentAsync(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> putIfAbsentAsync(CacheKey key, Object value, long lifespan,
+ TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
+ {
+ return parentCache.putIfAbsentAsync(key, value, lifespan, lifespanUnit, maxIdle, maxIdleUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> removeAsync(Object key)
+ {
+ return parentCache.removeAsync(key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Boolean> removeAsync(Object key, Object value)
+ {
+ return parentCache.removeAsync(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object replace(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.replace(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean replace(CacheKey key, Object oldValue, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.replace(key, oldValue, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object replace(CacheKey key, Object value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime,
+ TimeUnit maxIdleTimeUnit)
+ {
+ return parentCache.replace(key, value, lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean replace(CacheKey key, Object oldValue, Object value, long lifespan, TimeUnit lifespanUnit,
+ long maxIdleTime, TimeUnit maxIdleTimeUnit)
+ {
+ return parentCache.replace(key, oldValue, value, lifespan, lifespanUnit, maxIdleTime, maxIdleTimeUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> replaceAsync(CacheKey key, Object value)
+ {
+ return parentCache.replaceAsync(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Boolean> replaceAsync(CacheKey key, Object oldValue, Object newValue)
+ {
+ return parentCache.replaceAsync(key, oldValue, newValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> replaceAsync(CacheKey key, Object value, long lifespan, TimeUnit unit)
+ {
+ return parentCache.replaceAsync(key, value, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Boolean> replaceAsync(CacheKey key, Object oldValue, Object newValue, long lifespan,
+ TimeUnit unit)
+ {
+ return parentCache.replaceAsync(key, oldValue, newValue, lifespan, unit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> replaceAsync(CacheKey key, Object value, long lifespan, TimeUnit lifespanUnit,
+ long maxIdle, TimeUnit maxIdleUnit)
+ {
+ return parentCache.replaceAsync(key, value, lifespan, lifespanUnit, maxIdle, maxIdleUnit);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Boolean> replaceAsync(CacheKey key, Object oldValue, Object newValue, long lifespan,
+ TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
+ {
+ return parentCache.replaceAsync(key, oldValue, newValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean startBatch()
+ {
+ return parentCache.startBatch();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<Object> values()
+ {
+ return parentCache.values();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object putIfAbsent(CacheKey key, Object value)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new PutObjectIfAbsentContainer(key, value, parentCache, changesContainer.getHistoryIndex(), local
+ .get(), allowLocalChanges));
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean remove(Object key, Object value)
+ {
+ return parentCache.remove(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object replace(CacheKey key, Object value)
+ {
+ return parentCache.replace(key, value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean replace(CacheKey key, Object oldValue, Object newValue)
+ {
+ return parentCache.replace(key, oldValue, newValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void clear()
+ {
+ parentCache.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean containsKey(Object key)
+ {
+ return parentCache.containsKey(key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean containsValue(Object value)
+ {
+ return parentCache.containsValue(value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object get(Object key)
+ {
+ return parentCache.get(key);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEmpty()
+ {
+ return parentCache.isEmpty();
+ }
+
+ /**
+ * Put object in cache.
+ *
+ * @param key
+ * cache key
+ * @param value
+ * cache value
+ * @return
+ * always returns null
+ */
+ public Object put(CacheKey key, Object value)
+ {
+ return put(key, value, false);
+ }
+
+ /**
+ * Put object in cache.
+ * @param key
+ * cache key
+ * @param value
+ * cache value
+ * @param withReturnValue
+ * indicates if a return value is expected
+ * @return <code>null</code> if <code>withReturnValue</code> has been set to <code>false</code>
+ * the previous value otherwise
+ */
+ public Object put(final CacheKey key, Object value, final boolean withReturnValue)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new PutObjectContainer(key, value, parentCache, changesContainer.getHistoryIndex(), local
+ .get(), allowLocalChanges));
+
+ return withReturnValue ? parentCache.get(key) : null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void putAll(Map<? extends CacheKey, ? extends Object> m)
+ {
+ parentCache.putAll(m);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object remove(Object key)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new RemoveObjectContainer((CacheKey)key, parentCache, changesContainer.getHistoryIndex(),
+ local.get(), allowLocalChanges));
+
+ // return null as we never used result
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int size()
+ {
+ return parentCache.size();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void start()
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ parentCache.start();
+ return null;
+ }
+ };
+ SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void stop()
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ parentCache.stop();
+ return null;
+ }
+ };
+ SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addListener(Object listener)
+ {
+ parentCache.addListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Set<Object> getListeners()
+ {
+ return parentCache.getListeners();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeListener(Object listener)
+ {
+ parentCache.removeListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public NotifyingFuture<Object> getAsync(CacheKey key)
+ {
+ return parentCache.getAsync(key);
+ }
+
+ /**
+ * Start buffering process.
+ */
+ public void beginTransaction()
+ {
+ changesList.set(new CompressedISPNChangesBuffer());
+ local.set(false);
+ }
+
+ /**
+ *
+ * @return status of the cache transaction
+ */
+ public boolean isTransactionActive()
+ {
+ return changesList.get() != null;
+ }
+
+ /**
+ * Sort changes and commit data to the cache.
+ */
+ public void commitTransaction()
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ final TransactionManager tm = getTransactionManager();
+ try
+ {
+ final List<ChangesContainer> containers = changesContainer.getSortedList();
+ commitChanges(tm, containers);
+ }
+ finally
+ {
+ changesList.set(null);
+ changesContainer = null;
+ }
+ }
+
+ /**
+ * @param tm
+ * @param containers
+ */
+ private void commitChanges(TransactionManager tm, List<ChangesContainer> containers)
+ {
+ for (ChangesContainer cacheChange : containers)
+ {
+ boolean isTxCreated = false;
+ try
+ {
+ if (cacheChange.isTxRequired() && tm != null && tm.getStatus() == Status.STATUS_NO_TRANSACTION)
+ {
+ // No tx exists so we create a new tx
+ if (LOG.isTraceEnabled())
+ LOG.trace("No Tx is active we then create a new tx");
+ tm.begin();
+ isTxCreated = true;
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.warn("Could not create a new tx", e);
+ }
+ try
+ {
+ cacheChange.apply();
+ }
+ catch (RuntimeException e)
+ {
+ if (isTxCreated)
+ {
+ try
+ {
+ if (LOG.isTraceEnabled())
+ LOG.trace("An error occurs the tx will be rollbacked");
+ tm.rollback();
+ }
+ catch (Exception e1)
+ {
+ LOG.warn("Could not rollback the tx", e1);
+ }
+ }
+ throw e;
+ }
+ if (isTxCreated)
+ {
+ try
+ {
+ if (LOG.isTraceEnabled())
+ LOG.trace("The tx will be committed");
+ tm.commit();
+ }
+ catch (Exception e)
+ {
+ LOG.warn("Could not commit the tx", e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Forget about changes
+ */
+ public void rollbackTransaction()
+ {
+ changesList.set(null);
+ }
+
+ /**
+ * Creates all ChangesBuffers with given parameter
+ *
+ * @param local
+ */
+ public void setLocal(boolean local)
+ {
+ // start local transaction
+ if (local && changesList.get() == null)
+ {
+ beginTransaction();
+ }
+ if (!local && this.local.get())
+ {
+
+ }
+ this.local.set(local);
+ }
+
+ /**
+ * Tries to get buffer and if it is null throws an exception otherwise returns buffer.
+ *
+ * @return
+ */
+ private CompressedISPNChangesBuffer getChangesBufferSafe()
+ {
+ CompressedISPNChangesBuffer changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ return changesContainer;
+ }
+
+ public TransactionManager getTransactionManager()
+ {
+ return parentCache.getTransactionManager();
+ }
+
+ /**
+ *
+ * @param key
+ * @param value
+ */
+ public void addToList(CacheKey key, Object value, boolean forceModify)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new AddToListContainer(key, value, parentCache, forceModify, changesContainer
+ .getHistoryIndex(), local.get(), allowLocalChanges));
+ }
+
+ /**
+ *
+ * @param string
+ * @param node
+ * @return
+ */
+ public Object putInBuffer(CacheKey key, Object value)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+
+ // take Object from buffer for first
+ Object prevObject = getObjectFromChangesContainer(changesContainer, key);
+
+ changesContainer.add(new PutObjectContainer(key, value, parentCache, changesContainer.getHistoryIndex(), local
+ .get(), allowLocalChanges));
+
+ if (prevObject != null)
+ {
+ return prevObject;
+ }
+ else
+ {
+ return parentCache.get(key);
+ }
+ }
+
+ private Object getObjectFromChangesContainer(CompressedISPNChangesBuffer changesContainer, CacheKey key)
+ {
+ List<ChangesContainer> changes = changesContainer.getSortedList();
+ Object object = null;
+
+ for (ChangesContainer change : changes)
+ {
+ if (change.getChangesType().equals(ChangesType.PUT) && change.getKey().equals(key))
+ {
+ object = ((PutObjectContainer)change).value;
+ }
+ }
+
+ return object;
+ }
+
+ /**
+ *
+ * @param key
+ * @param value
+ */
+ public void removeFromList(CacheKey key, Object value)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new RemoveFromListContainer(key, value, parentCache, changesContainer.getHistoryIndex(),
+ local.get(), allowLocalChanges));
+ }
+
+ public void removeFromPatternList(CacheKey key, ItemData value)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new RemoveFromPatternListContainer(key, value, parentCache, changesContainer
+ .getHistoryIndex(), local.get(), allowLocalChanges));
+ }
+
+ public void addToPatternList(CacheKey key, ItemData value)
+ {
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+ changesContainer.add(new AddToPatternListContainer(key, value, parentCache, changesContainer.getHistoryIndex(),
+ local.get(), allowLocalChanges));
+ }
+
+ public Object getFromBuffer(CacheKey key)
+ {
+ //look at buffer for first
+ CompressedISPNChangesBuffer changesContainer = getChangesBufferSafe();
+
+ Object objectFromBuffer = getObjectFromChangesContainer(changesContainer, key);
+
+ if (objectFromBuffer != null)
+ {
+ return objectFromBuffer;
+ }
+ else
+ {
+ return parentCache.get(key);
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+
+/**
+ *
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: CacheId.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CacheId extends CacheKey
+{
+
+ public CacheId()
+ {
+ super();
+ }
+
+ CacheId(String id)
+ {
+ super(id);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheId)
+ {
+ CacheId cacheId = (CacheId)obj;
+ return (cacheId.hash == hash && cacheId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheKey.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheKey.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+import org.exoplatform.services.jcr.impl.Constants;
+import org.infinispan.distribution.group.Group;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Base class for WorkspaceCache keys.<br/>
+ *
+ * Date: 10.06.2008<br/>
+ *
+ * @author <a href="mailto:anatoliy.bazko@exoplatform.com.ua">Anatoliy Bazko</a>
+ * @version $Id: CacheKey.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public abstract class CacheKey implements Externalizable, Comparable<CacheKey>
+{
+
+ protected String id;
+
+ protected int hash;
+
+ /**
+ * The value used in case, the grouping is enabled
+ */
+ protected String group;
+
+ public CacheKey()
+ {
+ }
+
+ public CacheKey(String id)
+ {
+ this(id, null);
+ }
+
+ public CacheKey(String id, String group)
+ {
+ this.id = id;
+ this.hash = id.hashCode();
+ this.group = group;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int hashCode()
+ {
+ return this.hash;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString()
+ {
+ return this.getClass().getSimpleName() + "-" + this.id + "-" + this.group;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int compareTo(CacheKey o)
+ {
+ int result = getClass().getName().compareTo(o.getClass().getName());
+ return result == 0 ? id.compareTo(o.id) : result;
+ }
+
+ /**
+ * This method is used for the grouping when its enabled. It will return
+ * the value of the group if it has been explicitly set otherwise it will
+ * return the value of the fullId
+ * @return the group
+ */
+ @Group
+ public String getGroup()
+ {
+ return group == null ? id : group;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ byte[] buf;
+ if (group == null)
+ {
+ out.writeInt(-1);
+ }
+ else
+ {
+ buf = group.getBytes(Constants.DEFAULT_ENCODING);
+ out.writeInt(buf.length);
+ out.write(buf);
+ }
+
+ buf = id.getBytes(Constants.DEFAULT_ENCODING);
+ out.writeInt(buf.length);
+ out.write(buf);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ byte[] buf;
+ int length = in.readInt();
+ if (length >= 0)
+ {
+ buf = new byte[length];
+ in.readFully(buf);
+ group = new String(buf, Constants.DEFAULT_ENCODING);
+ }
+
+ buf = new byte[in.readInt()];
+ in.readFully(buf);
+ id = new String(buf, Constants.DEFAULT_ENCODING);
+ hash = id.hashCode();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public abstract boolean equals(Object obj);
+}
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: CachePagedNodes.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class CacheNodesByPageId extends CacheKey
+{
+
+ public CacheNodesByPageId()
+ {
+ super();
+ }
+
+ CacheNodesByPageId(String id)
+ {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheNodesByPageId)
+ {
+ CacheNodesByPageId cacheNodesByPageId = (CacheNodesByPageId)obj;
+ return (cacheNodesByPageId.hash == hash && cacheNodesByPageId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheNodesId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS
+ *
+ * Date: 10.06.2008
+ *
+ * Cache record used to store item Id key.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: CacheNodesId.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CacheNodesId extends CacheKey
+{
+
+ public CacheNodesId()
+ {
+ super();
+ }
+
+ CacheNodesId(String id)
+ {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheNodesId)
+ {
+ CacheNodesId cacheNodesId = (CacheNodesId)obj;
+ return (cacheNodesId.hash == hash && cacheNodesId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternNodesId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternNodesId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternNodesId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: CachePatternNodesId.java 111 10.05.2011 serg $
+ */
+public class CachePatternNodesId extends CacheKey
+{
+
+ public CachePatternNodesId()
+ {
+ super();
+ }
+
+ CachePatternNodesId(String id)
+ {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CachePatternNodesId)
+ {
+ CachePatternNodesId cacheNodesId = (CachePatternNodesId)obj;
+ return (cacheNodesId.hash == hash && cacheNodesId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternPropsId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternPropsId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePatternPropsId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: CachePatternPropsId.java 111 28 ���. 2011 serg $
+ */
+public class CachePatternPropsId extends CacheKey
+{
+
+ public CachePatternPropsId()
+ {
+ super();
+ }
+
+ CachePatternPropsId(String parentId)
+ {
+ super(parentId);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CachePatternPropsId)
+ {
+ CachePatternPropsId cachePatternPropsId = (CachePatternPropsId)obj;
+ return (cachePatternPropsId.hash == hash && cachePatternPropsId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePropsId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePropsId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CachePropsId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS
+ *
+ * Date: 10.06.2008
+ *
+ * Cache record used to store item Id key.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: CachePropsId.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CachePropsId extends CacheKey
+{
+
+ public CachePropsId()
+ {
+ super();
+ }
+
+ CachePropsId(String id)
+ {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CachePropsId)
+ {
+ CachePropsId cachePropsId = (CachePropsId)obj;
+ return (cachePropsId.hash == hash && cachePropsId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheQPath.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheQPath.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheQPath.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+import org.exoplatform.services.jcr.datamodel.ItemType;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.impl.Constants;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ *
+ * Store QPath as key in cache.
+ *
+ * 15.06.07
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: CacheQPath.java 3393 2010-11-04 07:54:54Z tolusha $
+ */
+class CacheQPath extends CacheKey
+{
+ public CacheQPath()
+ {
+ super();
+ }
+
+ CacheQPath(String parentId, QPath path, ItemType itemType)
+ {
+ this(parentId, path.getEntries()[path.getEntries().length - 1], itemType);
+ }
+
+ CacheQPath(String parentId, QPathEntry name, ItemType itemType)
+ {
+ super(new StringBuilder().append(parentId != null ? parentId : Constants.ROOT_PARENT_UUID)
+ .append(name.getAsString(true)).append(itemType.toString()).toString(), parentId);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheQPath)
+ {
+ CacheQPath cacheQPath = (CacheQPath)obj;
+ return (cacheQPath.hash == hash && cacheQPath.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CacheRefsId.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ * Created by The eXo Platform SAS
+ *
+ * Date: 10.06.2008
+ *
+ * Cache record used to store item Id key.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: CachePropsId.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CacheRefsId extends CacheKey
+{
+ public CacheRefsId()
+ {
+ super();
+ }
+
+ CacheRefsId(String id)
+ {
+ super(id);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CacheRefsId)
+ {
+ CacheRefsId cachePropsId = (CacheRefsId)obj;
+ return (cachePropsId.hash == hash && cachePropsId.id.equals(id));
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CompressedISPNChangesBuffer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CompressedISPNChangesBuffer.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/CompressedISPNChangesBuffer.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.BufferedISPNCache.ChangesContainer;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Sorting cache modification
+ *
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: CompressedISPNChangesBuffer.java 2845 2010-07-30 13:29:37Z tolusha $
+ */
+public class CompressedISPNChangesBuffer
+{
+ private int historyIndex = 0;
+
+ List<ChangesContainer> changes = new ArrayList<ChangesContainer>();
+
+ /**
+ * Adds new modification container to buffer and performs optimization if needed. Optimization doesn't iterate
+ * over lists and uses HashMaps. So each optimization duration doesn't depend on list size.
+ *
+ * @param container
+ */
+ public void add(ChangesContainer container)
+ {
+ changes.add(container);
+ }
+
+ /**
+ * After each invocation of the method increments internal field.
+ * Designed to be used as history order index in each {@link ChangesContainer}
+ * @return
+ */
+ public int getHistoryIndex()
+ {
+ historyIndex++;
+ return historyIndex;
+ }
+
+ /**
+ * Builds single list of modifications from internal structures and sorts it.
+ *
+ * @return
+ */
+ public List<ChangesContainer> getSortedList()
+ {
+ List<ChangesContainer> changesContainers = new ArrayList<ChangesContainer>(changes);
+ Collections.sort(changesContainers);
+ return changesContainers;
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,1647 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.services.jcr.access.AccessControlList;
+import org.exoplatform.services.jcr.config.CacheEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.dataflow.ItemState;
+import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
+import org.exoplatform.services.jcr.datamodel.IllegalPathException;
+import org.exoplatform.services.jcr.datamodel.InternalQName;
+import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.ItemType;
+import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.datamodel.NullItemData;
+import org.exoplatform.services.jcr.datamodel.NullNodeData;
+import org.exoplatform.services.jcr.datamodel.NullPropertyData;
+import org.exoplatform.services.jcr.datamodel.PropertyData;
+import org.exoplatform.services.jcr.datamodel.QPath;
+import org.exoplatform.services.jcr.datamodel.QPathEntry;
+import org.exoplatform.services.jcr.datamodel.ValueData;
+import org.exoplatform.services.jcr.impl.Constants;
+import org.exoplatform.services.jcr.impl.backup.BackupException;
+import org.exoplatform.services.jcr.impl.backup.Backupable;
+import org.exoplatform.services.jcr.impl.backup.DataRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
+import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
+import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
+import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.ActionNonTxAware;
+import org.infinispan.Cache;
+import org.infinispan.lifecycle.ComponentStatus;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
+import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.transaction.TransactionManager;
+
+/**
+ * Created by The eXo Platform SAS.<p/>
+ *
+ * Cache based on Infinispan.<p/>
+ *
+ * <ul>
+ * <li>cache transparent: or item cached or not, we should not generate "not found" Exceptions </li>
+ *
+ * This cache implementation stores items by UUID and parent UUID with QPathEntry.
+ * Except this cache stores list of children UUID.
+ *
+ * <p/>
+ * Current state notes (subject of change):
+ * <ul>
+ * <li>cache implements WorkspaceStorageCache, without any stuff about references and locks</li>
+ * <li>transaction style implemented via batches, do with JTA (i.e. via exo's TransactionService + JBoss TM)</li>
+ * </ul>
+ *
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: ISPNCacheWorkspaceStorageCache.java 3514 2010-11-22 16:14:36Z nzamosenchuk $
+ */
+public class ISPNCacheWorkspaceStorageCache implements WorkspaceStorageCache, Backupable
+{
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.ISPNCacheWorkspaceStorageCache");
+
+ private final boolean enabled;
+
+ protected final BufferedISPNCache cache;
+
+ /**
+ * The list of all the listeners
+ */
+ private final List<WorkspaceStorageCacheListener> listeners = new CopyOnWriteArrayList<WorkspaceStorageCacheListener>();
+
+ private final CacheActionNonTxAware<Void, Void> commitTransaction = new CacheActionNonTxAware<Void, Void>()
+ {
+ @Override
+ protected Void execute(Void arg) throws RuntimeException
+ {
+ cache.commitTransaction();
+ return null;
+ }
+ };
+
+ private final CacheActionNonTxAware<ItemData, String> getFromCacheById =
+ new CacheActionNonTxAware<ItemData, String>()
+ {
+ @Override
+ protected ItemData execute(String id) throws RuntimeException
+ {
+ return id == null ? null : (ItemData)cache.get(new CacheId(id));
+ }
+ };
+
+ private final CacheActionNonTxAware<List<NodeData>, NodeData> getChildNodes =
+ new CacheActionNonTxAware<List<NodeData>, NodeData>()
+ {
+ @Override
+ protected List<NodeData> execute(NodeData parent) throws RuntimeException
+ {
+ // get list of children uuids
+ final Set<String> set = (Set<String>)cache.get(new CacheNodesId(parent.getIdentifier()));
+
+ if (set != null)
+ {
+ final List<NodeData> childs = new ArrayList<NodeData>();
+
+ for (String childId : set)
+ {
+ NodeData child = (NodeData)cache.get(new CacheId(childId));
+ if (child == null)
+ {
+ return null;
+ }
+
+ childs.add(child);
+ }
+
+ // order children by orderNumber, as HashSet returns children in other order
+ Collections.sort(childs, new NodesOrderComparator<NodeData>());
+ return childs;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ };
+
+ private final CacheActionNonTxAware<ItemData, Object> getFromCacheByPath =
+ new CacheActionNonTxAware<ItemData, Object>()
+ {
+ @Override
+ protected ItemData execute(Object... args) throws RuntimeException
+ {
+ String parentIdentifier = (String)args[0];
+ QPathEntry name = (QPathEntry)args[1];
+ ItemType itemType = (ItemType)args[2];
+ String itemId = null;
+
+ if (itemType == ItemType.UNKNOWN)
+ {
+ // Try as node first.
+ itemId = (String)cache.get(new CacheQPath(parentIdentifier, name, ItemType.NODE));
+
+ if (itemId == null || itemId.equals(NullItemData.NULL_ID))
+ {
+ // node with such a name is not found or marked as not-exist, so check the properties
+ String propId = (String)cache.get(new CacheQPath(parentIdentifier, name, ItemType.PROPERTY));
+ if (propId != null)
+ {
+ itemId = propId;
+ }
+ }
+ }
+ else if (itemType == ItemType.NODE)
+ {
+ itemId = (String)cache.get(new CacheQPath(parentIdentifier, name, ItemType.NODE));;
+ }
+ else
+ {
+ itemId = (String)cache.get(new CacheQPath(parentIdentifier, name, ItemType.PROPERTY));;
+ }
+
+ if (itemId != null)
+ {
+ if (itemId.equals(NullItemData.NULL_ID))
+ {
+ if (itemType == ItemType.UNKNOWN || itemType == ItemType.NODE)
+ {
+ return new NullNodeData();
+ }
+ else
+ {
+ return new NullPropertyData();
+ }
+ }
+ else
+ {
+ return get(itemId);
+ }
+ }
+ return null;
+ }
+ };
+
+ private final CacheActionNonTxAware<Integer, NodeData> getChildNodesCount =
+ new CacheActionNonTxAware<Integer, NodeData>()
+ {
+ @Override
+ protected Integer execute(NodeData parent) throws RuntimeException
+ {
+ Set<String> list = (Set<String>)cache.get(new CacheNodesId(parent.getIdentifier()));
+ return list != null ? list.size() : -1;
+ }
+ };
+
+ private final CacheActionNonTxAware<List<PropertyData>, Object> getChildProps =
+ new CacheActionNonTxAware<List<PropertyData>, Object>()
+ {
+ @Override
+ protected List<PropertyData> execute(Object... args) throws RuntimeException
+ {
+ String parentId = (String)args[0];
+ boolean withValue = (Boolean)args[1];
+ // get list of children uuids
+ final Set<String> set = (Set<String>)cache.get(new CachePropsId(parentId));
+ if (set != null)
+ {
+ final List<PropertyData> childs = new ArrayList<PropertyData>();
+
+ for (String childId : set)
+ {
+ PropertyData child = (PropertyData)cache.get(new CacheId(childId));
+
+ if (child == null)
+ {
+ return null;
+ }
+ if (withValue && child.getValues().size() <= 0)
+ {
+ return null;
+ }
+ childs.add(child);
+ }
+ return childs;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ };
+
+ private final CacheActionNonTxAware<List<PropertyData>, String> getReferencedProperties =
+ new CacheActionNonTxAware<List<PropertyData>, String>()
+ {
+ @Override
+ protected List<PropertyData> execute(String identifier) throws RuntimeException
+ {
+ // get list of children uuids
+ final Set<String> set = (Set<String>)cache.get(new CacheRefsId(identifier));
+ if (set != null)
+ {
+ final List<PropertyData> props = new ArrayList<PropertyData>();
+
+ for (String childId : set)
+ {
+ PropertyData prop = (PropertyData)cache.get(new CacheId(childId));
+
+ if (prop == null || prop instanceof NullItemData)
+ {
+ return null;
+ }
+ // add property as many times as has referenced values
+ List<ValueData> lData = prop.getValues();
+ for (int i = 0, length = lData.size(); i < length; i++)
+ {
+ ValueData vdata = lData.get(i);
+ try
+ {
+ if (new String(vdata.getAsByteArray(), Constants.DEFAULT_ENCODING).equals(identifier))
+ {
+ props.add(prop);
+ }
+ }
+ catch (IllegalStateException e)
+ {
+ // property was not added, force read from lower layer
+ return null;
+ }
+ catch (IOException e)
+ {
+ // property was not added, force read from lower layer
+ return null;
+ }
+ }
+ }
+ return props;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ };
+
+ private final CacheActionNonTxAware<Long, Void> getSize = new CacheActionNonTxAware<Long, Void>()
+ {
+ @Override
+ protected Long execute(Void arg) throws RuntimeException
+ {
+ return (long)cache.size();
+ }
+ };
+
+ /**
+ * Node order comparator for getChildNodes().
+ */
+ class NodesOrderComparator<N extends NodeData> implements Comparator<NodeData>
+ {
+ /**
+ * {@inheritDoc}
+ */
+ public int compare(NodeData n1, NodeData n2)
+ {
+ return n1.getOrderNumber() - n2.getOrderNumber();
+ }
+ }
+
+ class ChildItemsIterator<T extends ItemData> implements Iterator<T>
+ {
+
+ final Iterator<String> childs;
+
+ T next;
+
+ ChildItemsIterator(CacheKey key)
+ {
+ Set<String> set = (Set<String>)cache.get(key);
+ if (set != null)
+ {
+ childs = ((Set<String>)cache.get(key)).iterator();
+ fetchNext();
+ }
+ else
+ {
+ childs = null;
+ next = null;
+ }
+ }
+
+ protected void fetchNext()
+ {
+ if (childs.hasNext())
+ {
+ // traverse to the first existing or the end of children
+ T n = null;
+ do
+ {
+ n = (T)cache.get(new CacheId(childs.next()));
+ }
+ while (n == null && childs.hasNext());
+ next = n;
+ }
+ else
+ {
+ next = null;
+ }
+ }
+
+ public boolean hasNext()
+ {
+ return next != null;
+ }
+
+ public T next()
+ {
+ if (next == null)
+ {
+ throw new NoSuchElementException();
+ }
+
+ final T current = next;
+ fetchNext();
+ return current;
+ }
+
+ public void remove()
+ {
+ throw new IllegalArgumentException("Not implemented");
+ }
+ }
+
+ class ChildNodesIterator<N extends NodeData> extends ChildItemsIterator<N>
+ {
+ ChildNodesIterator(String parentId)
+ {
+ super(new CacheNodesId(parentId));
+ }
+
+ @Override
+ public N next()
+ {
+ return super.next();
+ }
+ }
+
+ class ChildPropertiesIterator<P extends PropertyData> extends ChildItemsIterator<P>
+ {
+
+ ChildPropertiesIterator(String parentId)
+ {
+ super(new CachePropsId(parentId));
+ }
+
+ @Override
+ public P next()
+ {
+ return super.next();
+ }
+ }
+
+ /**
+ * Cache constructor with eXo TransactionService support.
+ *
+ * @param wsConfig WorkspaceEntry workspace config
+ * @throws RepositoryException if error of initialization
+ * @throws RepositoryConfigurationException if error of configuration
+ */
+ public ISPNCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, ConfigurationManager cfm) throws RepositoryException,
+ RepositoryConfigurationException
+ {
+ if (wsConfig.getCache() == null)
+ {
+ throw new RepositoryConfigurationException("Cache configuration not found");
+ }
+ this.enabled = wsConfig.getCache().isEnabled();
+
+ // create cache using custom factory
+ ISPNCacheFactory<CacheKey, Object> factory = new ISPNCacheFactory<CacheKey, Object>(cfm);
+
+ // create parent Infinispan instance
+ CacheEntry cacheEntry = wsConfig.getCache();
+ Cache<CacheKey, Object> parentCache = factory.createCache("Data_" + wsConfig.getUniqueName(), cacheEntry);
+
+ Boolean allowLocalChanges = null;
+ try
+ {
+ allowLocalChanges = cacheEntry.getParameterBoolean("allow-local-changes");
+ }
+ catch (RepositoryConfigurationException e)
+ {
+ // do n't nothing
+ }
+ this.cache = new BufferedISPNCache(parentCache, allowLocalChanges);
+ cache.addListener(new CacheEventListener());
+ }
+
+ /**
+ * Return TransactionManager used by ISPN backing the JCR cache.
+ *
+ * @return TransactionManager
+ */
+ public TransactionManager getTransactionManager()
+ {
+ return cache.getTransactionManager();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void put(ItemData item)
+ {
+ // There is different commit processing for NullNodeData and ordinary ItemData.
+ if (item instanceof NullItemData)
+ {
+ putNullItem((NullItemData)item);
+ return;
+ }
+
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+ if (item.isNode())
+ {
+ putNode((NodeData)item, ModifyChildOption.NOT_MODIFY);
+ }
+ else
+ {
+ putProperty((PropertyData)item, ModifyChildOption.NOT_MODIFY);
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void remove(ItemData item)
+ {
+ removeItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void onSaveItems(final ItemStateChangesLog itemStates)
+ {
+ // if something happen we will rollback changes
+ boolean rollback = true;
+ try
+ {
+ cache.beginTransaction();
+ for (ItemState state : itemStates.getAllStates())
+ {
+ if (state.isAdded())
+ {
+ if (state.isPersisted())
+ {
+ putItem(state.getData());
+ }
+ }
+ else if (state.isUpdated())
+ {
+ if (state.isPersisted())
+ {
+ // There was a problem with removing a list of samename siblings in on transaction,
+ // so putItemInBufferedCache(..) and updateInBufferedCache(..) used instead put(..) and update (..) methods.
+ ItemData prevItem = putItemInBufferedCache(state.getData());
+ if (prevItem != null && state.isNode())
+ {
+ // nodes reordered, if previous is null it's InvalidItemState case
+ updateInBuffer((NodeData)state.getData(), (NodeData)prevItem);
+ }
+ }
+ }
+ else if (state.isDeleted())
+ {
+ removeItem(state.getData());
+ }
+ else if (state.isRenamed())
+ {
+ putItem(state.getData());
+ }
+ else if (state.isPathChanged())
+ {
+ updateTreePath(state.getOldPath(), state.getData().getQPath(), null);
+ }
+ else if (state.isMixinChanged())
+ {
+ if (state.isPersisted())
+ {
+ // update subtree ACLs
+ updateMixin((NodeData)state.getData());
+ }
+ }
+ }
+
+ cache.commitTransaction();
+ rollback = false;
+ }
+ finally
+ {
+ if (rollback)
+ {
+ cache.rollbackTransaction();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildNodesByPage(NodeData parent, List<NodeData> childs, int fromOrderNum)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+
+ cache.setLocal(true);
+
+ CacheNodesByPageId cacheId = new CacheNodesByPageId(parent.getIdentifier());
+ Map<Integer, Set<String>> pages = (Map<Integer, Set<String>>)cache.get(cacheId);
+ if (pages == null)
+ {
+ pages = new HashMap<Integer, Set<String>>();
+ }
+
+ if (childs.size() > 0)
+ {
+ Set<String> set = new HashSet<String>();
+ for (NodeData child : childs)
+ {
+ putNode(child, ModifyChildOption.NOT_MODIFY);
+ set.add(child.getIdentifier());
+ }
+
+ pages.put(fromOrderNum, set);
+ cache.put(cacheId, pages);
+ }
+ else
+ {
+ // cache fact of empty childs list
+ pages.put(fromOrderNum, new HashSet<String>());
+ cache.put(cacheId, pages);
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildNodes(NodeData parent, List<NodeData> childs)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+
+ cache.setLocal(true);
+ if (childs.size() > 0)
+ {
+ Set<Object> set = new HashSet<Object>();
+ for (NodeData child : childs)
+ {
+ putNode(child, ModifyChildOption.NOT_MODIFY);
+ set.add(child.getIdentifier());
+ }
+ cache.putIfAbsent(new CacheNodesId(parent.getIdentifier()), set);
+ }
+ else
+ {
+ // cache fact of empty childs list
+ cache.putIfAbsent(new CacheNodesId(parent.getIdentifier()), new HashSet<Object>());
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildNodes(NodeData parent, QPathEntryFilter pattern, List<NodeData> childs)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+
+ cache.setLocal(true);
+ Set<String> set = new HashSet<String>();
+
+ for (NodeData child : childs)
+ {
+ putNode(child, ModifyChildOption.NOT_MODIFY);
+ set.add(child.getIdentifier());
+ }
+
+ CachePatternNodesId cacheId = new CachePatternNodesId(parent.getIdentifier());
+ Map<QPathEntryFilter, Set<String>> patterns = (Map<QPathEntryFilter, Set<String>>)cache.get(cacheId);
+ if (patterns == null)
+ {
+ patterns = new HashMap<QPathEntryFilter, Set<String>>();
+ }
+ patterns.put(pattern, set);
+ cache.put(cacheId, patterns);
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildProperties(NodeData parent, List<PropertyData> childs)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+ if (childs.size() > 0)
+ {
+ // add all new
+ Set<Object> set = new HashSet<Object>();
+ for (PropertyData child : childs)
+ {
+ putProperty(child, ModifyChildOption.NOT_MODIFY);
+ set.add(child.getIdentifier());
+ }
+ cache.putIfAbsent(new CachePropsId(parent.getIdentifier()), set);
+
+ }
+ else
+ {
+ LOG.warn("Empty properties list cached " + (parent != null ? parent.getQPath().getAsString() : parent));
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildProperties(NodeData parent, QPathEntryFilter pattern, List<PropertyData> childs)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+ if (childs.size() > 0)
+ {
+ // add all new
+ Set<String> set = new HashSet<String>();
+ for (PropertyData child : childs)
+ {
+ putProperty(child, ModifyChildOption.NOT_MODIFY);
+ set.add(child.getIdentifier());
+ }
+
+ CachePatternPropsId cacheId = new CachePatternPropsId(parent.getIdentifier());
+ Map<QPathEntryFilter, Set<String>> patterns = (Map<QPathEntryFilter, Set<String>>)cache.get(cacheId);
+ if (patterns == null)
+ {
+ patterns = new HashMap<QPathEntryFilter, Set<String>>();
+ }
+ patterns.put(pattern, set);
+ cache.put(cacheId, patterns);
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addChildPropertiesList(NodeData parent, List<PropertyData> childProperties)
+ {
+ // TODO not implemented, will force read from DB
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData get(String parentId, QPathEntry name)
+ {
+ return get(parentId, name, ItemType.UNKNOWN);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData get(String parentIdentifier, QPathEntry name, ItemType itemType)
+ {
+ return getFromCacheByPath.run(parentIdentifier, name, itemType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ItemData get(String id)
+ {
+ return getFromCacheById.run(id);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodes(final NodeData parent)
+ {
+ return getChildNodes.run(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodesByPage(final NodeData parent, final int fromOrderNum)
+ {
+ // get list of children uuids
+ final Map<Integer, Set<String>> pages =
+ (Map<Integer, Set<String>>)cache.get(new CacheNodesByPageId(parent.getIdentifier()));
+
+ if (pages == null)
+ {
+ return null;
+ }
+
+ Set<String> set = pages.get(fromOrderNum);
+ if (set == null)
+ {
+ return null;
+ }
+
+ final List<NodeData> childs = new ArrayList<NodeData>();
+ for (String childId : set)
+ {
+ NodeData child = (NodeData)cache.get(new CacheId(childId));
+ if (child == null)
+ {
+ return null;
+ }
+
+ childs.add(child);
+ }
+
+ // order children by orderNumber, as HashSet returns children in other order
+ Collections.sort(childs, new NodesOrderComparator<NodeData>());
+ return childs;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<NodeData> getChildNodes(final NodeData parent, final QPathEntryFilter pattern)
+ {
+ // get list of children uuids
+ final Map<QPathEntryFilter, Set<String>> patterns =
+ (Map<QPathEntryFilter, Set<String>>)cache.get(new CachePatternNodesId(parent.getIdentifier()));
+
+ if (patterns == null)
+ {
+ return null;
+ }
+
+ Set<String> set = patterns.get(pattern);
+ if (set == null)
+ {
+ return null;
+ }
+
+ final List<NodeData> childs = new ArrayList<NodeData>();
+
+ for (String childId : set)
+ {
+ NodeData child = (NodeData)cache.get(new CacheId(childId));
+ if (child == null)
+ {
+ return null;
+ }
+
+ childs.add(child);
+ }
+
+ // order children by orderNumber, as HashSet returns children in other order
+ Collections.sort(childs, new NodesOrderComparator<NodeData>());
+ return childs;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getChildNodesCount(NodeData parent)
+ {
+ return getChildNodesCount.run(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getChildProperties(NodeData parent)
+ {
+ return getChildProps(parent.getIdentifier(), true);
+ }
+
+ public List<PropertyData> getChildProperties(NodeData parent, QPathEntryFilter pattern)
+ {
+ // get list of children uuids
+ final Map<QPathEntryFilter, Set<String>> patterns =
+ (Map<QPathEntryFilter, Set<String>>)cache.get(new CachePatternPropsId(parent.getIdentifier()));
+
+ if (patterns == null)
+ {
+ return null;
+ }
+
+ Set<String> set = patterns.get(pattern);
+ if (set == null)
+ {
+ return null;
+ }
+
+ final List<PropertyData> childs = new ArrayList<PropertyData>();
+
+ for (String childId : set)
+ {
+ PropertyData child = (PropertyData)cache.get(new CacheId(childId));
+
+ if (child == null)
+ {
+ return null;
+ }
+ if (child.getValues().size() <= 0)
+ {
+ return null;
+ }
+ childs.add(child);
+ }
+ return childs;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> listChildProperties(NodeData parent)
+ {
+ return getChildProps(parent.getIdentifier(), false);
+ }
+
+ /**
+ * Internal get child properties.
+ *
+ * @param parentId String
+ * @param withValue boolean, if true only "full" Propeties can be returned
+ * @return List of PropertyData
+ */
+ protected List<PropertyData> getChildProps(String parentId, boolean withValue)
+ {
+ return getChildProps.run(parentId, withValue);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public long getSize()
+ {
+ return getSize.run();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isPatternSupported()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isChildNodesByPageSupported()
+ {
+ return true;
+ }
+
+ /**
+ * Internal put Item.
+ *
+ * @param item ItemData, new data to put in the cache
+ * @return ItemData, previous data or null
+ */
+ protected ItemData putItem(ItemData item)
+ {
+ if (item.isNode())
+ {
+ return putNode((NodeData)item, ModifyChildOption.MODIFY);
+ }
+ else
+ {
+ return putProperty((PropertyData)item, ModifyChildOption.MODIFY);
+ }
+ }
+
+ protected ItemData putItemInBufferedCache(ItemData item)
+ {
+ if (item.isNode())
+ {
+ return putNodeInBufferedCache((NodeData)item, ModifyChildOption.MODIFY);
+ }
+ else
+ {
+ return putProperty((PropertyData)item, ModifyChildOption.MODIFY);
+ }
+
+ }
+
+ /**
+ * Internal put Node.
+ *
+ * @param node, NodeData, new data to put in the cache
+ * @return NodeData, previous data or null
+ */
+ protected ItemData putNode(NodeData node, ModifyChildOption modifyListsOfChild)
+ {
+ if (node.getParentIdentifier() != null)
+ {
+ if (modifyListsOfChild == ModifyChildOption.NOT_MODIFY)
+ {
+ cache.putIfAbsent(new CacheQPath(node.getParentIdentifier(), node.getQPath(), ItemType.NODE), node
+ .getIdentifier());
+ }
+ else
+ {
+ cache.put(new CacheQPath(node.getParentIdentifier(), node.getQPath(), ItemType.NODE), node.getIdentifier());
+ }
+
+ // if MODIFY and List present OR FORCE_MODIFY, then write
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
+ {
+ cache.addToPatternList(new CachePatternNodesId(node.getParentIdentifier()), node);
+ cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
+
+ cache.remove(new CacheNodesByPageId(node.getParentIdentifier()));
+ }
+ }
+
+ if (modifyListsOfChild == ModifyChildOption.NOT_MODIFY)
+ {
+ return (ItemData)cache.putIfAbsent(new CacheId(node.getIdentifier()), node);
+ }
+ else
+ {
+ return (ItemData)cache.put(new CacheId(node.getIdentifier()), node, true);
+ }
+ }
+
+ protected ItemData putNodeInBufferedCache(NodeData node, ModifyChildOption modifyListsOfChild)
+ {
+ if (node.getParentIdentifier() != null)
+ {
+ cache.put(new CacheQPath(node.getParentIdentifier(), node.getQPath(), ItemType.NODE), node.getIdentifier());
+
+ // if MODIFY and List present OR FORCE_MODIFY, then write
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
+ {
+ cache.addToList(new CacheNodesId(node.getParentIdentifier()), node.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
+ }
+ }
+
+ // NullNodeData must never be returned inside internal cache operations.
+ ItemData itemData = (ItemData)cache.putInBuffer(new CacheId(node.getIdentifier()), node);
+ return (itemData instanceof NullItemData) ? null : itemData;
+ }
+
+ /**
+ * Internal put NullNode.
+ *
+ * @param item, NullItemData, new data to put in the cache
+ */
+ protected void putNullItem(NullItemData item)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+
+ if (!item.getIdentifier().equals(NullItemData.NULL_ID))
+ {
+ cache.putIfAbsent(new CacheId(item.getIdentifier()), item);
+ }
+ else if (item.getName() != null && item.getParentIdentifier() != null)
+ {
+ cache.putIfAbsent(new CacheQPath(item.getParentIdentifier(), item.getName(), ItemType.getItemType(item)),
+ NullItemData.NULL_ID);
+ }
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * Internal put Property.
+ *
+ * @param node, PropertyData, new data to put in the cache
+ * @return PropertyData, previous data or null
+ */
+ protected PropertyData putProperty(PropertyData prop, ModifyChildOption modifyListsOfChild)
+ {
+ // if MODIFY and List present OR FORCE_MODIFY, then write
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY)
+ {
+ cache.addToPatternList(new CachePatternPropsId(prop.getParentIdentifier()), prop);
+ cache.addToList(new CachePropsId(prop.getParentIdentifier()), prop.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
+ }
+ if (modifyListsOfChild == ModifyChildOption.NOT_MODIFY)
+ {
+ cache.putIfAbsent(new CacheQPath(prop.getParentIdentifier(), prop.getQPath(), ItemType.PROPERTY), prop.getIdentifier());
+ }
+ else
+ {
+ cache.put(new CacheQPath(prop.getParentIdentifier(), prop.getQPath(), ItemType.PROPERTY), prop.getIdentifier());
+ }
+
+
+ // add referenced property
+ if (modifyListsOfChild != ModifyChildOption.NOT_MODIFY && prop.getType() == PropertyType.REFERENCE)
+ {
+ List<ValueData> lData = prop.getValues();
+ for (int i = 0, length = lData.size(); i < length; i++)
+ {
+ ValueData vdata = lData.get(i);
+ String nodeIdentifier = null;
+ try
+ {
+ nodeIdentifier = new String(vdata.getAsByteArray(), Constants.DEFAULT_ENCODING);
+ }
+ catch (IllegalStateException e)
+ {
+ // Do nothing. Never happens.
+ }
+ catch (IOException e)
+ {
+ // Do nothing. Never happens.
+ }
+ cache.addToList(new CacheRefsId(nodeIdentifier), prop.getIdentifier(),
+ modifyListsOfChild == ModifyChildOption.FORCE_MODIFY);
+ }
+ }
+ // NullItemData must never be returned inside internal cache operations.
+ PropertyData propData;
+ if (modifyListsOfChild == ModifyChildOption.NOT_MODIFY)
+ {
+ propData = (PropertyData)cache.putIfAbsent(new CacheId(prop.getIdentifier()), prop);
+ }
+ else
+ {
+ propData = (PropertyData)cache.put(new CacheId(prop.getIdentifier()), prop, true);
+ }
+
+ return (propData instanceof NullPropertyData) ? null : propData;
+ }
+
+ protected void removeItem(ItemData item)
+ {
+ cache.remove(new CacheId(item.getIdentifier()));
+ cache.remove(new CacheQPath(item.getParentIdentifier(), item.getQPath(), ItemType.getItemType(item)));
+
+ if (item.isNode())
+ {
+ if (item.getParentIdentifier() != null)
+ {
+ cache.removeFromPatternList(new CachePatternNodesId(item.getParentIdentifier()), item);
+ cache.removeFromList(new CacheNodesId(item.getParentIdentifier()), item.getIdentifier());
+ cache.remove(new CacheNodesByPageId(item.getParentIdentifier()));
+ }
+
+ cache.remove(new CacheNodesId(item.getIdentifier()));
+ cache.remove(new CachePropsId(item.getIdentifier()));
+ cache.remove(new CacheNodesByPageId(item.getIdentifier()));
+ cache.remove(new CachePatternNodesId(item.getIdentifier()));
+ cache.remove(new CachePatternPropsId(item.getIdentifier()));
+ cache.remove(new CacheRefsId(item.getIdentifier()));
+ }
+ else
+ {
+ cache.removeFromPatternList(new CachePatternPropsId(item.getParentIdentifier()), item);
+ cache.removeFromList(new CachePropsId(item.getParentIdentifier()), item.getIdentifier());
+ }
+ }
+
+ /**
+ * Update Node's mixin and ACL.
+ *
+ * @param node NodeData
+ */
+ protected void updateMixin(NodeData node)
+ {
+ NodeData prevData = (NodeData)cache.put(new CacheId(node.getIdentifier()), node, true);
+ // prevent update NullNodeData
+ if (!(prevData instanceof NullNodeData))
+ {
+ if (prevData != null)
+ {
+ // do update ACL if needed
+ if (prevData.getACL() == null || !prevData.getACL().equals(node.getACL()))
+ {
+ updateChildsACL(node.getIdentifier(), node.getACL());
+ }
+ }
+ else if (LOG.isDebugEnabled())
+ {
+ LOG.debug("Previous NodeData not found for mixin update " + node.getQPath().getAsString());
+ }
+ }
+ }
+
+ /**
+ * Update Node hierachy in case of same-name siblings reorder.
+ * Assumes the new (updated) nodes already putted in the cache. Previous name of updated nodes will be calculated
+ * and that node will be deleted (if has same id as the new node). Childs paths will be updated to a new node path.
+ *
+ * @param node NodeData
+ * @param prevNode NodeData
+ */
+ protected void updateInBuffer(final NodeData node, final NodeData prevNode)
+ {
+ // I expect that NullNodeData will never update existing NodeData.
+ CacheQPath prevKey = new CacheQPath(node.getParentIdentifier(), prevNode.getQPath(), ItemType.NODE);
+ if (node.getIdentifier().equals(cache.getFromBuffer(prevKey)))
+ {
+ cache.remove(prevKey);
+ }
+
+ // update childs paths if index changed
+ int nodeIndex = node.getQPath().getEntries()[node.getQPath().getEntries().length - 1].getIndex();
+ int prevNodeIndex = prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1].getIndex();
+ if (nodeIndex != prevNodeIndex)
+ {
+ // its a samename reordering
+ updateTreePath(prevNode.getQPath(), node.getQPath(), null); // don't change ACL, it's same parent
+ }
+ }
+
+ /**
+ * Check all items in cache - is it descendant of prevRootPath, and update path according newRootPath.
+ *
+ * @param prevRootPath
+ * @param newRootPath
+ * @param acl
+ */
+ protected void updateTreePath(final QPath prevRootPath, final QPath newRootPath, final AccessControlList acl)
+ {
+ boolean inheritACL = acl != null;
+
+ // check all ITEMS in cache
+ Iterator<CacheKey> keys = cache.keySet().iterator();
+
+ while (keys.hasNext())
+ {
+ CacheKey key = keys.next();
+ if (key instanceof CacheId)
+ {
+ ItemData data = (ItemData)cache.get(key);
+
+ if (data != null)
+ {
+ // check is this descendant of prevRootPath
+ QPath nodeQPath = data.getQPath();
+ if (nodeQPath != null && nodeQPath.isDescendantOf(prevRootPath))
+ {
+ //make relative path
+ QPathEntry[] relativePath = null;
+ try
+ {
+ relativePath = nodeQPath.getRelPath(nodeQPath.getDepth() - prevRootPath.getDepth());
+ }
+ catch (IllegalPathException e)
+ {
+ // Do nothing. Never happens.
+ }
+
+ // make new path - no matter node or property
+ QPath newPath = QPath.makeChildPath(newRootPath, relativePath);
+
+ if (data.isNode())
+ {
+ // update node
+ NodeData prevNode = (NodeData)data;
+
+ TransientNodeData newNode =
+ new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
+ prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
+ prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
+
+ // update this node
+ cache.put(new CacheId(newNode.getIdentifier()), newNode);
+ }
+ else
+ {
+ //update property
+ PropertyData prevProp = (PropertyData)data;
+
+ if (inheritACL
+ && (prevProp.getQPath().getName().equals(Constants.EXO_PERMISSIONS) || prevProp.getQPath()
+ .getName().equals(Constants.EXO_OWNER)))
+ {
+ inheritACL = false;
+ }
+
+ TransientPropertyData newProp =
+ new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(),
+ prevProp.getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp
+ .getValues());
+
+ // update this property
+ cache.put(new CacheId(newProp.getIdentifier()), newProp);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Update child Nodes ACLs.
+ *
+ * @param parentId String - root node id of JCR subtree.
+ * @param acl AccessControlList
+ */
+ protected void updateChildsACL(final String parentId, final AccessControlList acl)
+ {
+ loop: for (Iterator<NodeData> iter = new ChildNodesIterator<NodeData>(parentId); iter.hasNext();)
+ {
+ NodeData prevNode = iter.next();
+
+ // is ACL changes on this node (i.e. ACL inheritance brokes)
+ for (InternalQName mixin : prevNode.getMixinTypeNames())
+ {
+ if (mixin.equals(Constants.EXO_PRIVILEGEABLE) || mixin.equals(Constants.EXO_OWNEABLE))
+ {
+ continue loop;
+ }
+ }
+
+ // recreate with new path for child Nodes only
+ TransientNodeData newNode =
+ new TransientNodeData(prevNode.getQPath(), prevNode.getIdentifier(), prevNode.getPersistedVersion(),
+ prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(), prevNode
+ .getParentIdentifier(), acl);
+
+ // update this node
+ cache.put(new CacheId(newNode.getIdentifier()), newNode);
+
+ // update childs recursive
+ updateChildsACL(newNode.getIdentifier(), acl);
+ }
+ }
+
+ public void beginTransaction()
+ {
+ cache.beginTransaction();
+ }
+
+ public void commitTransaction()
+ {
+ cache.commitTransaction();
+ }
+
+ public void rollbackTransaction()
+ {
+ cache.rollbackTransaction();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isTXAware()
+ {
+ return true;
+ }
+
+ /**
+ * <li>NOT_MODIFY - node(property) is not added to the parent's list
+ * (no persistent changes performed, cache used as cache)</li>
+ * <li>MODIFY - node(property) is added to the parent's list if parent in the cache
+ * (new item is added to persistent, add to list if it is present)</li>
+ * <li>FORCE_MODIFY - node(property) is added to the parent's list anyway (when list is read from DB, forcing write)</li>
+ */
+ private enum ModifyChildOption {
+ NOT_MODIFY, MODIFY, FORCE_MODIFY
+ }
+
+ /**
+ * Allows to commit the cache changes in a dedicated XA Tx in order to avoid potential
+ * deadlocks
+ */
+ private void dedicatedTxCommit()
+ {
+ commitTransaction.run();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addReferencedProperties(String identifier, List<PropertyData> refProperties)
+ {
+ boolean inTransaction = cache.isTransactionActive();
+ try
+ {
+ if (!inTransaction)
+ {
+ cache.beginTransaction();
+ }
+ cache.setLocal(true);
+
+ Set<Object> set = new HashSet<Object>();
+ for (PropertyData prop : refProperties)
+ {
+ putProperty(prop, ModifyChildOption.NOT_MODIFY);
+ set.add(prop.getIdentifier());
+ }
+ cache.putIfAbsent(new CacheRefsId(identifier), set);
+ }
+ finally
+ {
+ cache.setLocal(false);
+ if (!inTransaction)
+ {
+ dedicatedTxCommit();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<PropertyData> getReferencedProperties(String identifier)
+ {
+ return getReferencedProperties.run(identifier);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void backup(File storageDir) throws BackupException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Managed
+ @ManagedDescription("Remove all the existing items from the cache")
+ public void clean() throws BackupException
+ {
+ if (cache.getStatus() == ComponentStatus.RUNNING)
+ {
+ cache.clear();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
+ {
+ return new DataRestore()
+ {
+ /**
+ * {@inheritDoc}
+ */
+ public void clean() throws BackupException
+ {
+ cache.clear();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void restore() throws BackupException
+ {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void commit() throws BackupException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback() throws BackupException
+ {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void close() throws BackupException
+ {
+ }
+ };
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void addListener(WorkspaceStorageCacheListener listener)
+ {
+ listeners.add(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeListener(WorkspaceStorageCacheListener listener)
+ {
+ listeners.remove(listener);
+ }
+
+ /**
+ * Called when a cache entry corresponding to the given node has item updated
+ * @param data the item corresponding to the updated cache entry
+ */
+ private void onCacheEntryUpdated(ItemData data)
+ {
+ if (data == null || data instanceof NullItemData)
+ {
+ return;
+ }
+ for (WorkspaceStorageCacheListener listener : listeners)
+ {
+ try
+ {
+ listener.onCacheEntryUpdated(data);
+ }
+ catch (Exception e)
+ {
+ LOG.warn("The method onCacheEntryUpdated fails for the listener " + listener.getClass(), e);
+ }
+ }
+ }
+
+ /**
+ * Actions that are not supposed to be called within a transaction
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 21 janv. 2010
+ */
+ protected abstract class CacheActionNonTxAware<R, A> extends ActionNonTxAware<R, A, RuntimeException>
+ {
+ /**
+ * {@inheritDoc}
+ */
+ protected TransactionManager getTransactionManager()
+ {
+ return ISPNCacheWorkspaceStorageCache.this.getTransactionManager();
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Listener
+ public class CacheEventListener
+ {
+
+ @CacheEntryModified
+ public void cacheEntryModified(CacheEntryModifiedEvent evt)
+ {
+ if (!evt.isPre() && evt.getKey() instanceof CacheId)
+ {
+ final ItemData value = (ItemData)evt.getValue();
+ onCacheEntryUpdated(value);
+ }
+ }
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,262 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.infinispan;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.Cache;
+import org.infinispan.config.Configuration;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.jmx.MBeanServerLookup;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedExceptionAction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.management.MBeanServer;
+
+/**
+ * Factory that creates and starts pre-configured instances of Infinispan.
+ * Path to Infinispan configuration or template and cache name should be
+ * provided as "infinispan-configuration" and "infinispan-cache-name" properties
+ * in parameterEntry instance respectively.
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: InfinispanCacheFactory.java 3001 2010-08-30 06:56:05Z tolusha $
+ *
+ */
+public class ISPNCacheFactory<K, V>
+{
+
+ public static final String INFINISPAN_CONFIG = "infinispan-configuration";
+
+ private final ConfigurationManager configurationManager;
+
+ private final TemplateConfigurationHelper configurationHelper;
+
+ private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.InfinispanCacheFactory");
+
+ /**
+ * A Map that contains all the registered CacheManager order by {@link ExoContainer}
+ * instances and {@link GlobalConfiguration}.
+ */
+ private static Map<GlobalConfiguration, EmbeddedCacheManager> CACHE_MANAGERS =
+ new HashMap<GlobalConfiguration, EmbeddedCacheManager>();
+
+ private static final MBeanServerLookup MBEAN_SERVER_LOOKUP = new MBeanServerLookup()
+ {
+ public MBeanServer getMBeanServer(Properties properties)
+ {
+ return ExoContainerContext.getTopContainer().getMBeanServer();
+ }
+ };
+
+ /**
+ * Creates InfinispanCacheFactory with provided configuration transaction managers.
+ * Transaction manager will later be injected to cache instance.
+ *
+ * @param configurationManager
+ */
+ public ISPNCacheFactory(ConfigurationManager configurationManager)
+ {
+ this.configurationManager = configurationManager;
+ this.configurationHelper = new ISPNCacheHelper(configurationManager);
+ }
+
+ /**
+ * Factory that creates and starts pre-configured instances of Infinispan.
+ * Path to Infinispan configuration or template should be provided as
+ * "infinispan-configuration" property in parameterEntry instance.
+ * <br>
+ *
+ * @param regionId the unique id of the cache region to create
+ * @param parameterEntry
+ * @return
+ * @throws RepositoryConfigurationException
+ */
+ public Cache<K, V> createCache(final String regionId, MappedParametrizedObjectEntry parameterEntry)
+ throws RepositoryConfigurationException
+ {
+ // get Infinispan configuration file path
+ final String configurationPath = parameterEntry.getParameterValue(INFINISPAN_CONFIG);
+ log.info("Infinispan Cache configuration used: " + configurationPath);
+ // avoid dashes in cache name. Some SQL servers doesn't allow dashes in table names
+ final String regionIdEscaped = regionId.replace("-", "_");
+ // prepare configuration
+ final InputStream configStream;
+ try
+ {
+ // fill template
+ configStream = configurationHelper.fillTemplate(configurationPath, parameterEntry.getParameters());
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+
+ // create cache
+ final EmbeddedCacheManager manager;
+ try
+ {
+ // creating new CacheManager using SecurityHelper
+
+ manager = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
+ {
+ public EmbeddedCacheManager run() throws IOException
+ {
+ DefaultCacheManager manager = new DefaultCacheManager(configStream, false);
+ loadJGroupsConfig(manager);
+ return getUniqueInstance(regionIdEscaped, manager);
+ }
+ });
+
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+
+ PrivilegedAction<Cache<K, V>> action = new PrivilegedAction<Cache<K, V>>()
+ {
+ public Cache<K, V> run()
+ {
+ return manager.getCache(regionIdEscaped);
+ }
+ };
+ Cache<K, V> cache = SecurityHelper.doPrivilegedAction(action);
+
+ return cache;
+ }
+
+ /**
+ * This method is used to load the file corresponding to the path set on the property
+ * <tt>configurationFile</tt> using the configuration manager, then set the XML content
+ * as value of the property <tt>configurationXml</tt>.
+ * @param manager the manager from which we extract the transport properties in which
+ * we will find the path of the JGroups configuration
+ * @throws IOException if the configuration file cannot be read
+ */
+ private void loadJGroupsConfig(DefaultCacheManager manager) throws IOException
+ {
+ Properties p = manager.getGlobalConfiguration().getTransportProperties();
+ if (p != null && p.containsKey("configurationFile"))
+ {
+ URL jgroupsConfigURL = null;
+ InputStream jgroupsConfigInputStream = null;
+ try
+ {
+ // Trying to get the configuration from the configuration manager
+ String configurationFile = p.getProperty("configurationFile");
+ jgroupsConfigInputStream = configurationManager.getInputStream(configurationFile);
+ jgroupsConfigURL = configurationManager.getResource(configurationFile);
+ }
+ catch (Exception e)
+ {
+ // ignore me
+ }
+ if (jgroupsConfigInputStream != null)
+ {
+ try
+ {
+ log.info("Custom JGroups configuration set: " + jgroupsConfigURL);
+
+ // Read stream content into StringWriter
+ StringWriter sw = new StringWriter();
+ InputStreamReader in = new InputStreamReader(jgroupsConfigInputStream);
+
+ char[] buffer = new char[1024];
+ int n = 0;
+ while (-1 != (n = in.read(buffer)))
+ {
+ sw.write(buffer, 0, n);
+ }
+
+ p.setProperty("configurationXml", sw.toString());
+ p.remove("configurationFile");
+ }
+ finally
+ {
+ jgroupsConfigInputStream.close();
+ }
+ }
+ }
+ }
+
+ /**
+ * Try to find if a {@link EmbeddedCacheManager} of the same type (i.e. their {@link GlobalConfiguration} are equals)
+ * has already been registered for the same current container.
+ * If no cache manager has been registered, we register the given cache manager otherwise we
+ * use the previously registered cache manager and we define a dedicated region for the related cache.
+ * @param regionId the unique id of the cache region to create
+ * @param manager the current cache manager of the cache to create
+ * @return the given cache manager if it has not been registered otherwise the cache manager of the same
+ * type that has already been registered..
+ */
+ private static synchronized EmbeddedCacheManager getUniqueInstance(String regionId, EmbeddedCacheManager manager)
+ {
+ GlobalConfiguration gc = manager.getGlobalConfiguration();
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ // Ensure that the cluster name won't be used between 2 ExoContainers
+ gc.fluent().transport().clusterName(gc.getClusterName() + "_" + container.getContext().getName())
+ .globalJmxStatistics().cacheManagerName(gc.getCacheManagerName() + "_" + container.getContext().getName()).
+ // Configure the MBeanServerLookup
+ mBeanServerLookup(MBEAN_SERVER_LOOKUP);
+ Configuration conf = manager.getDefaultConfiguration();
+ if (CACHE_MANAGERS.containsKey(gc))
+ {
+ manager = CACHE_MANAGERS.get(gc);
+ }
+ else
+ {
+ // Reset the manager before storing it into the map since the default config is used as
+ // template to define a new configuration
+ manager = new DefaultCacheManager(gc);
+ CACHE_MANAGERS.put(gc, manager);
+ if (log.isInfoEnabled())
+ {
+ log.info("A new ISPN Cache Manager instance has been registered for the region " + regionId
+ + " and the container " + container.getContext().getName());
+ }
+ }
+ // Define the configuration of the cache
+ manager.defineConfiguration(regionId, conf);
+ if (log.isInfoEnabled())
+ {
+ log.info("The region " + regionId + " has been registered for the container "
+ + container.getContext().getName());
+ }
+ return manager;
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheHelper.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheHelper.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.infinispan;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
+
+/**
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: ISPNCacheHelper.java 111 2010-11-11 11:11:11Z tolusha $
+ *
+ */
+public class ISPNCacheHelper extends TemplateConfigurationHelper
+{
+
+ /**
+ * Creates configuration cache helper with pre-configured for Infinispan cache parameters,<br>
+ * including: "infinispan-*" and "jgroups-configuration", and excluding "infinispan-configuration"
+ *
+ * @param cfm
+ * instance for looking up resources
+ */
+ public ISPNCacheHelper(ConfigurationManager cfm)
+ {
+ super(new String[]{"^jgroups-configuration", "^infinispan-.*"}, new String[]{"^infinispan-configuration"}, cfm);
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/PrivilegedISPNCacheHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/PrivilegedISPNCacheHelper.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/infinispan/PrivilegedISPNCacheHelper.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.infinispan;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.infinispan.Cache;
+
+import java.io.Serializable;
+import java.security.PrivilegedAction;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: PrivilegedCacheHelper.java 111 2010-11-11 11:11:11Z tolusha $
+ *
+ */
+public class PrivilegedISPNCacheHelper
+{
+
+ /**
+ * Start Infinispan cache in privileged mode.
+ *
+ * @param cache
+ */
+ public static void start(final Cache<Serializable, Object> cache)
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ cache.start();
+ return null;
+ }
+ };
+ SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * Stop Infinispan cache in privileged mode.
+ *
+ * @param cache
+ */
+ public static void stop(final Cache<Serializable, Object> cache)
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ cache.stop();
+ return null;
+ }
+ };
+ SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * Put in Infinispan cache in privileged mode.
+ *
+ * @param cache
+ */
+ public static Object putIfAbsent(final Cache<Serializable, Object> cache, final Serializable key, final Object value)
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ return cache.putIfAbsent(key, value);
+ }
+ };
+ return SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * Put in Infinispan cache in privileged mode.
+ *
+ * @param cache
+ */
+ public static Object put(final Cache<Serializable, Object> cache, final Serializable key, final Object value)
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ return cache.put(key, value);
+ }
+ };
+ return SecurityHelper.doPrivilegedAction(action);
+ }
+
+ /**
+ * Put in Infinispan cache in privileged mode.
+ *
+ * @param cache
+ */
+ public static Object put(final Cache<Serializable, Object> cache, final Serializable key, final Object value,
+ final long lifespan, final TimeUnit unit)
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ return cache.put(key, value, lifespan, unit);
+ }
+ };
+ return SecurityHelper.doPrivilegedAction(action);
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.transaction.infinispan;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.services.transaction.impl.AbstractTransactionService;
+import org.infinispan.transaction.lookup.TransactionManagerLookup;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="mailto:dmitry.kataev@exoplatform.com">Dmytro Katayev</a>
+ * @version $Id: GenericTransactionService.java -1 $
+ */
+public class GenericTransactionService extends AbstractTransactionService
+{
+
+ /**
+ * TransactionManagerLookup.
+ */
+ protected final TransactionManagerLookup tmLookup;
+
+ /**
+ * JBossTransactionManagerLookup constructor.
+ *
+ * @param tmLookup TransactionManagerLookup
+ */
+ public GenericTransactionService(TransactionManagerLookup tmLookup)
+ {
+ this(tmLookup, null);
+ }
+
+ public GenericTransactionService(TransactionManagerLookup tmLookup, InitParams params)
+ {
+ super(params);
+ this.tmLookup = tmLookup;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TransactionManager findTransactionManager() throws Exception
+ {
+ return tmLookup.getTransactionManager();
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossStandaloneJTAManagerLookup.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.transaction.infinispan;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.TransactionService;
+import org.infinispan.transaction.lookup.TransactionManagerLookup;
+
+import java.lang.reflect.Method;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+/**
+ * This class is used to replace the one provided by default in ISPN 5.0 since
+ * it implicitly requires that ISPN is initialized before the rest which is actually
+ * the exact opposite. Indeed Arjuna accessors are initialized in the init method which is
+ * called at ISPN initialization but we expect to get the {@link TransactionManager}
+ * from it through the {@link TransactionService} before initializing the JCR so before
+ * initializing ISPN.
+ *
+ * The code below is a simple copy/paste of the code of
+ * {@link org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup} of ISPN 4.
+ *
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class JBossStandaloneJTAManagerLookup implements TransactionManagerLookup
+{
+ /**
+ * The logger
+ */
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.impl.infinispan.v5.JBossStandaloneJTAManagerLookup");
+
+ private Method manager, user;
+
+ public JBossStandaloneJTAManagerLookup()
+ {
+ try
+ {
+ manager = loadClassStrict("com.arjuna.ats.jta.TransactionManager").getMethod("transactionManager");
+ user = loadClassStrict("com.arjuna.ats.jta.UserTransaction").getMethod("userTransaction");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public TransactionManager getTransactionManager() throws Exception
+ {
+ TransactionManager tm = (TransactionManager)manager.invoke(null);
+ if (tm == null && LOG.isWarnEnabled())
+ {
+ LOG.warn("The transaction manager could not be found");
+ }
+ return tm;
+ }
+
+ public UserTransaction getUserTransaction() throws Exception
+ {
+ UserTransaction ut = (UserTransaction)user.invoke(null);
+ if (ut == null && LOG.isWarnEnabled())
+ {
+ LOG.warn("The user transaction could not be found");
+ }
+ return ut;
+ }
+
+ /**
+ * Loads the specified class using this class's classloader, or, if it is <code>null</code> (i.e. this class was
+ * loaded by the bootstrap classloader), the system classloader. <p/> If loadtime instrumentation via
+ * GenerateInstrumentedClassLoader is used, this class may be loaded by the bootstrap classloader. <p/>
+ *
+ * @param classname name of the class to load
+ * @return the class
+ * @throws ClassNotFoundException
+ */
+ private static Class<?> loadClassStrict(String classname) throws ClassNotFoundException
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ if (cl == null)
+ cl = ClassLoader.getSystemClassLoader();
+ return cl.loadClass(classname);
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.transaction.infinispan;
+
+import org.exoplatform.container.xml.InitParams;
+import org.infinispan.transaction.lookup.TransactionManagerLookup;
+
+import javax.transaction.UserTransaction;
+
+/**
+ * Add the specific part for Arjuna
+ *
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class JBossTransactionsService extends GenericTransactionService
+{
+
+ public JBossTransactionsService(TransactionManagerLookup tmLookup)
+ {
+ super(tmLookup);
+ }
+
+ public JBossTransactionsService(TransactionManagerLookup tmLookup, InitParams params)
+ {
+ super(tmLookup, params);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected UserTransaction findUserTransaction() throws Exception
+ {
+ return com.arjuna.ats.jta.UserTransaction.userTransaction();
+ }
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-data.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+ <expiration wakeUpInterval="5000"/>
+ </default>
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-indexer.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-indexer.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-indexer.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="NONE"/>
+
+ <loaders passivation="false" shared="false" preload="false">
+ <loader class="${infinispan-cachestore-classname}" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <async enabled="false"/>
+ </loader>
+ </loaders>
+ </default>
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-lock.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/cluster/infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="NONE"/>
+
+ <loaders passivation="false" shared="true" preload="true">
+ <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
+ <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
+ <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
+ <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
+ <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
+ <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
+ <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
+ <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
+ <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
+ <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
+ <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
+ </properties>
+ <async enabled="false"/>
+ </loader>
+ </loaders>
+ </default>
+
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,214 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<repository-service default-repository="repository">
+ <repositories>
+ <repository name="repository" system-workspace="production" default-workspace="production">
+ <security-domain>exo-domain</security-domain>
+ <access-control>optional</access-control>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="production">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/production" />
+ </properties>
+ <value-storages>
+ <value-storage id="production" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/production" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/production" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="backup">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/backup" />
+ </properties>
+ <value-storages>
+ <value-storage id="backup" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/backup" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/backup" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="digital-assets">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/digital-assets" />
+ </properties>
+ <value-storages>
+ <value-storage id="digital-assets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/digital-assets" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:folder" />
+ </properties>
+ </initializer>
+ <cache enabled="true"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/digital-assets" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCache.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.dataflow.persistent.cache.infinispan;
+
+import org.exoplatform.container.configuration.ConfigurationManagerImpl;
+import org.exoplatform.services.jcr.config.CacheEntry;
+import org.exoplatform.services.jcr.config.SimpleParameterEntry;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.cache.jbosscache.TestJBossCacheWorkspaceStorageCache;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache;
+
+import java.util.ArrayList;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TestISPNCacheWorkspaceStorageCache.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestISPNCacheWorkspaceStorageCache extends TestJBossCacheWorkspaceStorageCache
+{
+ @Override
+ public WorkspaceStorageCache getCacheImpl() throws Exception
+ {
+ ArrayList<SimpleParameterEntry> list = new ArrayList<SimpleParameterEntry>();
+ list.add(new SimpleParameterEntry("infinispan-configuration", "jar:/conf/standalone/test-infinispan-config.xml"));
+
+ CacheEntry entry = new CacheEntry(list);
+ entry.setEnabled(true);
+ WorkspaceEntry workspaceEntry = new WorkspaceEntry();
+ workspaceEntry.setUniqueName("WS_UUID");
+ workspaceEntry.setCache(entry);
+ return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new ConfigurationManagerImpl());
+ }
+}
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCacheInClusterMode.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/infinispan/TestISPNCacheWorkspaceStorageCacheInClusterMode.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.cache.infinispan;
+
+import org.exoplatform.container.configuration.ConfigurationManagerImpl;
+import org.exoplatform.services.jcr.config.CacheEntry;
+import org.exoplatform.services.jcr.config.SimpleParameterEntry;
+import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.TestWorkspaceStorageCacheInClusterMode;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.TesterISPNCacheWorkspaceStorageCache;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache;
+import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class TestISPNCacheWorkspaceStorageCacheInClusterMode extends TestWorkspaceStorageCacheInClusterMode<ISPNCacheWorkspaceStorageCache>
+{
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ public ISPNCacheWorkspaceStorageCache getCacheImpl() throws Exception
+ {
+ // Clear the Cache Factory to avoid getting several times the same cache
+ Field singletonField = ISPNCacheFactory.class.getDeclaredField("CACHE_MANAGERS");
+ singletonField.setAccessible(true);
+ Map map = (Map)singletonField.get(null);
+ Map backupMap = new HashMap(map);
+ map.clear();
+ ArrayList<SimpleParameterEntry> list = new ArrayList<SimpleParameterEntry>();
+ list.add(new SimpleParameterEntry(ISPNCacheFactory.INFINISPAN_CONFIG,
+ "jar:/conf/standalone/cluster/test-infinispan-config.xml"));
+ list.add(new SimpleParameterEntry("infinispan-cluster-name", "TestISPNCacheWorkspaceStorageCacheInClusterMode"));
+ list.add(new SimpleParameterEntry("jgroups-configuration", "classpath:/flush-udp.xml"));
+
+ CacheEntry entry = new CacheEntry(list);
+ entry.setEnabled(true);
+ WorkspaceEntry workspaceEntry = new WorkspaceEntry();
+ workspaceEntry.setCache(entry);
+ workspaceEntry.setUniqueName("MyWorkspace");
+ try
+ {
+ return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new ConfigurationManagerImpl());
+ }
+ finally
+ {
+ map.clear();
+ map.putAll(backupMap);
+ }
+ }
+
+ protected void finalize(ISPNCacheWorkspaceStorageCache cache)
+ {
+ TesterISPNCacheWorkspaceStorageCache.stop(cache);
+ }
+}
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/TesterISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/TesterISPNCacheWorkspaceStorageCache.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/TesterISPNCacheWorkspaceStorageCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan;
+
+/**
+ *
+ * @author <a href="mailto:azavizionov@exoplatform.com">Alexey Zavizionov</a>
+ * @version $Id: TesterISPNCacheWorkspaceStorageCache.java 34360 2009-07-22 23:58:59Z zavizionov $
+ *
+ */
+public class TesterISPNCacheWorkspaceStorageCache
+{
+
+ public static void stop(ISPNCacheWorkspaceStorageCache cache)
+ {
+ cache.cache.stop();
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/java/org/exoplatform/services/jcr/lab/infinispan/TestISPNCache.java 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.jcr.lab.infinispan;
+
+import junit.framework.TestCase;
+
+import org.infinispan.Cache;
+import org.infinispan.config.Configuration;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author <a href="anatoliy.bazko(a)exoplatform.org">Anatoliy Bazko</a>
+ * @version $Id: TestINSPCache.java 111 2010-11-11 11:11:11Z tolusha $
+ *
+ */
+public class TestISPNCache extends TestCase
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+ }
+
+ /**
+ * Test default cache and base operation.
+ *
+ * @throws Exception
+ */
+ public void testGetCache() throws Exception
+ {
+ // Create cache manager
+ GlobalConfiguration myGlobalConfig = new GlobalConfiguration();
+ EmbeddedCacheManager manager = new DefaultCacheManager(myGlobalConfig);
+
+ // Create a cache
+ Configuration config = new Configuration();
+ manager.defineConfiguration("cache", config);
+ Cache cache = manager.getCache("cache");
+
+ cache.put("key", "value");
+ assertTrue(cache.size() == 1);
+ assertTrue(cache.containsKey("key"));
+
+ String value = (String)cache.remove("key");
+ assertTrue(value.equals("value"));
+ assertTrue(cache.isEmpty());
+
+ cache.put("key", "value");
+ cache.putIfAbsent("key", "newValue");
+ assertTrue("value".equals(cache.get("key")));
+
+ cache.clear();
+ assertTrue(cache.isEmpty());
+
+ cache.put("key", "value", 2, TimeUnit.SECONDS);
+ assertTrue(cache.containsKey("key"));
+ Thread.sleep(2000 + 500);
+ assertFalse(cache.containsKey("key"));
+ }
+
+ /**
+ * Test cluster cache and base operation.
+ *
+ * @throws Exception
+ */
+ public void testGetClusterCache() throws Exception
+ {
+ // Create cache manager
+ EmbeddedCacheManager manager = new DefaultCacheManager(GlobalConfiguration.getClusteredDefault());
+
+ // Create a cache
+ Cache cache = manager.getCache();
+
+ cache.put("key", "value");
+ assertTrue(cache.size() == 1);
+ assertTrue(cache.containsKey("key"));
+
+ String value = (String)cache.remove("key");
+ assertTrue(value.equals("value"));
+ assertTrue(cache.isEmpty());
+
+ cache.put("key", "value");
+ cache.putIfAbsent("key", "newValue");
+ assertTrue("value".equals(cache.get("key")));
+
+ cache.clear();
+ assertTrue(cache.isEmpty());
+
+ cache.put("key", "value", 2, TimeUnit.SECONDS);
+ assertTrue(cache.containsKey("key"));
+ Thread.sleep(2000 + 500);
+ assertFalse(cache.containsKey("key"));
+ }
+
+}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,683 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/cluster/test-jcr-config.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <component>
+ <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.rpc.RPCService</key>
+ <type>org.exoplatform.services.rpc.jgv3.RPCServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>jgroups-configuration</name>
+ <value>jar:/conf/standalone/cluster/udp-mux.xml</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-cluster-name</name>
+ <value>RPCService-Cluster</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-default-timeout</name>
+ <value>0</value>
+ </value-param>
+ </init-params>
+ </component>
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
+ <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
+ <property name="username" value="${jdbcjcr.username:sa}"/>
+ <property name="password" value="${jdbcjcr.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1.url:jdbc:hsqldb:file:target/temp/data/jcr}"/>
+ <property name="username" value="${jdbcjcr1.username:sa}"/>
+ <property name="password" value="${jdbcjcr1.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr2.url:jdbc:hsqldb:file:target/temp/data/jcr2}"/>
+ <property name="username" value="${jdbcjcr2.username:sa}"/>
+ <property name="password" value="${jdbcjcr2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr3.url:jdbc:hsqldb:file:target/temp/data/jcr3}"/>
+ <property name="username" value="${jdbcjcr3.username:sa}"/>
+ <property name="password" value="${jdbcjcr3.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtest</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrdb2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
+ <property name="username" value="${jdbcjcrdb2.username:sa}"/>
+ <property name="password" value="${jdbcjcrdb2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1db2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1db2.url:jdbc:hsqldb:file:target/temp/data/jcrdb2}"/>
+ <property name="username" value="${jdbcjcr1db2.username:sa}"/>
+ <property name="password" value="${jdbcjcr1db2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
+ <property name="username" value="${jdbcjcrtck.username:sa}"/>
+ <property name="password" value="${jdbcjcrtck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1tck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1tck.url:jdbc:hsqldb:file:target/temp/data/jcrtck}"/>
+ <property name="username" value="${jdbcjcr1tck.username:sa}"/>
+ <property name="password" value="${jdbcjcr1tck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2tck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr2tck.url:jdbc:hsqldb:file:target/temp/data/jcr2tck}"/>
+ <property name="username" value="${jdbcjcr2tck.username:sa}"/>
+ <property name="password" value="${jdbcjcr2tck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>testdbcleaner</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
+ <property name="username" value="${testdbcleaner.username:sa}"/>
+ <property name="password" value="${testdbcleaner.password:}"/>
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+ <expiration wakeUpInterval="5000"/>
+ </default>
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-indexer.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="NONE"/>
+
+ <loaders passivation="false" shared="false" preload="false">
+ <loader class="${infinispan-cachestore-classname}" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <async enabled="false"/>
+ </loader>
+ </loaders>
+ </default>
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="${infinispan-cluster-name}" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${jgroups-configuration}"/>
+ </properties>
+ </transport>
+ </global>
+
+ <default>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync replTimeout="20000"/>
+ </clustering>
+
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="NONE"/>
+
+ <loaders passivation="false" shared="true" preload="true">
+ <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
+ <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
+ <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
+ <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
+ <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
+ <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
+ <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
+ <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
+ <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
+ <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
+ <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
+ </properties>
+ <async enabled="false"/>
+ </loader>
+ </loaders>
+ </default>
+
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,695 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+ <!--
+
+ Copyright (C) 2009 eXo Platform SAS. 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.
+ -->
+<repository-service default-repository="db1">
+ <repositories>
+ <repository name="db1" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type"
+ value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1/ws1" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2" lazy-read-threshold="1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1/ws2" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws3">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr3" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws3" />
+ </properties>
+ <value-storages>
+ <!--
+ This storage is used to check whether properties are removed correctly from each value-storage
+ (TestRemoveFromValueStorage.java)
+ -->
+ <value-storage id="ws3_big"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1024K" />
+ </filters>
+ </value-storage>
+ <value-storage id="ws3"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type"
+ value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1/ws3" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr3" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+ <repository name="db2" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrdb2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wsdb2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db2/ws" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1db2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1db2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db2/ws1" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1db2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+ <repository name="db1tck" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wstck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1tck/ws" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1tck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1tck/ws1" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1tck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2tck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2"
+ class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}"
+ class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="max-volatile-time" value="60" />
+ <property name="index-dir" value="target/temp/index/db1tck/ws2" />
+ <property name="synonymprovider-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class"
+ value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
+ <property name="extractorPoolSize" value="2" />
+ <property name="extractorTimeout" value="10" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
+ <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="infinispan-cluster-name" value="JCR-cluster" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2tck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,74 @@
+
+<!--
+ Default stack using IP multicasting. It is similar to the "udp"
+ stack in stacks.xml, but doesn't use streaming state transfer and flushing
+ author: Bela Ban
+-->
+
+<config xmlns="urn:org:jgroups"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+ <UDP
+ singleton_name="JCR-cluster"
+ mcast_port="${jgroups.udp.mcast_port:45588}"
+ tos="8"
+ ucast_recv_buf_size="20M"
+ ucast_send_buf_size="640K"
+ mcast_recv_buf_size="25M"
+ mcast_send_buf_size="640K"
+ loopback="true"
+ discard_incompatible_packets="true"
+ max_bundle_size="64K"
+ max_bundle_timeout="30"
+ ip_ttl="${jgroups.udp.ip_ttl:8}"
+ enable_bundling="true"
+ enable_diagnostics="true"
+ thread_naming_pattern="cl"
+
+ timer_type="new"
+ timer.min_threads="4"
+ timer.max_threads="10"
+ timer.keep_alive_time="3000"
+ timer.queue_max_size="500"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="2"
+ thread_pool.max_threads="8"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="10000"
+ thread_pool.rejection_policy="discard"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="Run"/>
+
+ <PING timeout="2000"
+ num_initial_members="3"/>
+ <MERGE2 max_interval="30000"
+ min_interval="10000"/>
+ <FD_SOCK/>
+ <FD_ALL/>
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK exponential_backoff="300"
+ xmit_stagger_timeout="200"
+ use_mcast_xmit="false"
+ discard_delivered_msgs="true"/>
+ <UNICAST />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="4M"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ view_bundling="true"/>
+ <UFC max_credits="2M"
+ min_threshold="0.4"/>
+ <MFC max_credits="2M"
+ min_threshold="0.4"/>
+ <FRAG2 frag_size="60K" />
+ <pbcast.STATE_TRANSFER />
+ <!-- pbcast.FLUSH /-->
+</config>
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration-sjdbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,504 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config-sjdbc.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <component>
+ <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
+ <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
+ <property name="username" value="${jdbcjcr.username:sa}"/>
+ <property name="password" value="${jdbcjcr.password:}"/>
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtest</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrdb2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
+ <property name="username" value="${jdbcjcrdb2.username:sa}"/>
+ <property name="password" value="${jdbcjcrdb2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
+ <property name="username" value="${jdbcjcrtck.username:sa}"/>
+ <property name="password" value="${jdbcjcrtck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>testdbcleaner</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
+ <property name="username" value="${testdbcleaner.username:sa}"/>
+ <property name="password" value="${testdbcleaner.password:}"/>
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-configuration.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,665 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout, file"/>
+
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"/>
+
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
+ <property name="log4j.appender.file.File" value="target/jcr.log"/>
+
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
+ <property name="log4j.appender.file.layout.ConversionPattern"
+ value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n"/>
+
+ <!-- property name="log4j.category.jcr.FileCleaner" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
+ <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
+
+ <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
+ <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
+ </properties-param>
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>SimpleLog properties</description>
+ <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
+ <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
+ </properties-param -->
+
+ <!-- value-param>
+ <name>logger</name>
+ <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>jdk1.4 Logger properties</description>
+ <property name="handlers" value="java.util.logging.ConsoleHandler"/>
+ <property name=".level" value="FINE"/>
+ <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
+ </properties-param -->
+
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.RepositoryService</key>
+ <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
+ <component-plugins>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="test" value="http://www.apache.org/jackrabbit/test"/>
+ <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
+ <property name="rma" value="http://www.rma.com/jcr/"/>
+ <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
+ <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
+ <property name="publication" value="http://www.exoplatform.com/jcr/publication/1.1/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/test/nodetypes-tck.xml</value>
+ <value>jar:/conf/test/nodetypes-impl.xml</value>
+ <value>jar:/conf/test/nodetypes-usecase.xml</value>
+ <value>jar:/conf/test/nodetypes-config.xml</value>
+ <value>jar:/conf/test/nodetypes-config-extended.xml</value>
+ <value>jar:/conf/test/wcm-nodetypes.xml</value>
+ <value>jar:/conf/test/nodetypes-publication-config.xml</value>
+ <value>jar:/conf/test/publication-plugins-nodetypes-config.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepository</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepository
+ </description>
+ <value>jar:/conf/test/nodetypes-test.xml</value>
+ </values-param>
+
+ <values-param>
+ <name>testInitNodeTypesRepositoryTest2</name>
+ <description>
+ Node types configuration file for repository with name testInitNodeTypesRepositoryTest2
+ </description>
+ <value>jar:/conf/test/nodetypes-test2.xml</value>
+ </values-param>
+
+ <!--values-param>
+ <name>testInitNodeTypesRepositoryTest3</name>
+ <description>Node types from ext. Needed bacause core starup earlie than ext</description>
+ <value>jar:/conf/test/nodetypes-test3_ext.xml</value>
+ </values-param-->
+
+ </init-params>
+ </component-plugin>
+ </component-plugins>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
+ <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
+ <init-params>
+ <value-param>
+ <name>conf-path</name>
+ <description>JCR configuration file</description>
+ <value>jar:/conf/standalone/test-jcr-config.xml</value>
+ </value-param>
+ <properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="dialect" value="auto" />
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.organization.impl.mock.DummyOrganizationService</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
+ </component>
+
+ <component>
+ <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
+ </component>
+
+ <component>
+ <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <!-- component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</value>
+ </value-param>
+ </init-params>
+ </component -->
+
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <!-- MVCC configured to prevent possible deadlocks when a global Tx is active -->
+ <property name="url" value="${jdbcjcr.url:jdbc:hsqldb:file:target/temp/data/portal;hsqldb.tx=mvcc}"/>
+ <property name="username" value="${jdbcjcr.username:sa}"/>
+ <property name="password" value="${jdbcjcr.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1.url:jdbc:hsqldb:file:target/temp/data/jcr}"/>
+ <property name="username" value="${jdbcjcr1.username:sa}"/>
+ <property name="password" value="${jdbcjcr1.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr2.url:jdbc:hsqldb:file:target/temp/data/jcr2}"/>
+ <property name="username" value="${jdbcjcr2.username:sa}"/>
+ <property name="password" value="${jdbcjcr2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr3.url:jdbc:hsqldb:file:target/temp/data/jcr3}"/>
+ <property name="username" value="${jdbcjcr3.username:sa}"/>
+ <property name="password" value="${jdbcjcr3.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtest</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jcrtest"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ <property name="maxActive" value="100" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrdb2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrdb2.url:jdbc:hsqldb:file:target/temp/data/portaldb2}"/>
+ <property name="username" value="${jdbcjcrdb2.username:sa}"/>
+ <property name="password" value="${jdbcjcrdb2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1db2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1db2.url:jdbc:hsqldb:file:target/temp/data/jcrdb2}"/>
+ <property name="username" value="${jdbcjcr1db2.username:sa}"/>
+ <property name="password" value="${jdbcjcr1db2.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcrtck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcrtck.url:jdbc:hsqldb:file:target/temp/data/portaltck}"/>
+ <property name="username" value="${jdbcjcrtck.username:sa}"/>
+ <property name="password" value="${jdbcjcrtck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr1tck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr1tck.url:jdbc:hsqldb:file:target/temp/data/jcrtck}"/>
+ <property name="username" value="${jdbcjcr1tck.username:sa}"/>
+ <property name="password" value="${jdbcjcr1tck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2tck</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${jdbcjcr2tck.url:jdbc:hsqldb:file:target/temp/data/jcr2tck}"/>
+ <property name="username" value="${jdbcjcr2tck.username:sa}"/>
+ <property name="password" value="${jdbcjcr2tck.password:}"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export1</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export1"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export2"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr2export3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr2export3"/>
+ <property name="username" value="sa"/>
+ <property name="password" value=""/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>testdbcleaner</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="${all.driverClassName:org.hsqldb.jdbcDriver}"/>
+ <property name="url" value="${testdbcleaner.url:jdbc:hsqldb:file:target/temp/data/testdbcleaner}"/>
+ <property name="username" value="${testdbcleaner.username:sa}"/>
+ <property name="password" value="${testdbcleaner.password:}"/>
+ <property name="maxActive" value="20" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>repo</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.impl.jndi.BindableRepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="repositoryName" value="db1"/>
+ <!-- property name="containerConfig" value="exo-configuration.xml"/ -->
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>rmi.jcr</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>rmirepository</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.jcr.Repository</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.exoplatform.services.jcr.rmi.RepositoryFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="url" value="//localhost:9999/repository"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <remove-configuration>org.exoplatform.services.scheduler.JobSchedulerService</remove-configuration>
+ <!--<import>jar:/conf/database-configuration.hsql.xml</import> -->
+</configuration>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+ </global>
+
+ <default>
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="LRU" threadPolicy="DEFAULT" maxEntries="1000000"/>
+ <expiration wakeUpInterval="5000"/>
+ </default>
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-lock.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-infinispan-lock.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+
+ <global>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+ </global>
+
+ <default>
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false"/>
+ <transaction transactionManagerLookupClass="org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
+ <jmxStatistics enabled="true"/>
+ <eviction strategy="NONE"/>
+
+ <loaders passivation="false" shared="true" preload="true">
+ <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ <property name="stringsTableNamePrefix" value="${infinispan-cl-cache.jdbc.table.name}"/>
+ <property name="idColumnName" value="${infinispan-cl-cache.jdbc.id.column}"/>
+ <property name="dataColumnName" value="${infinispan-cl-cache.jdbc.data.column}"/>
+ <property name="timestampColumnName" value="${infinispan-cl-cache.jdbc.timestamp.column}"/>
+ <property name="idColumnType" value="${infinispan-cl-cache.jdbc.id.type}"/>
+ <property name="dataColumnType" value="${infinispan-cl-cache.jdbc.data.type}"/>
+ <property name="timestampColumnType" value="${infinispan-cl-cache.jdbc.timestamp.type}"/>
+ <property name="dropTableOnExit" value="${infinispan-cl-cache.jdbc.table.drop}"/>
+ <property name="createTableOnStart" value="${infinispan-cl-cache.jdbc.table.create}"/>
+ <property name="connectionFactoryClass" value="${infinispan-cl-cache.jdbc.connectionFactory}"/>
+ <property name="datasourceJndiLocation" value="${infinispan-cl-cache.jdbc.datasource}"/>
+ </properties>
+ <async enabled="false"/>
+ </loader>
+ </loaders>
+ </default>
+
+</infinispan>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,589 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<repository-service default-repository="db1">
+ <repositories>
+ <repository name="db1" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws1" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2" lazy-read-threshold="1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws2" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws3">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws3" />
+ </properties>
+ <value-storages>
+ <!--
+ This storage is used to check whether properties are removed
+ correctly from each value-storage
+ (TestRemoveFromValueStorage.java)
+ -->
+ <value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1024K" />
+ </filters>
+ </value-storage>
+ <value-storage id="ws3" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws3" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+ <repository name="db2" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrdb2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wsdb2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db2/ws" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrdb2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1db2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db2/ws1" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+
+ <repository name="db1tck" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wstck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws1" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="false" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws2" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt"/>
+ <property name="extractorPoolSize" value="2"/>
+ <property name="extractorTimeout" value="10"/>
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/test-jcr-config.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,589 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<repository-service default-repository="db1">
+ <repositories>
+ <repository name="db1" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="jdbc-dialect" value="auto" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws1" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2" lazy-read-threshold="1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws2" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws3">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr3" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws3" />
+ </properties>
+ <value-storages>
+ <!--
+ This storage is used to check whether properties are removed
+ correctly from each value-storage
+ (TestRemoveFromValueStorage.java)
+ -->
+ <value-storage id="ws3_big" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3_big" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="1024K" />
+ </filters>
+ </value-storage>
+ <value-storage id="ws3" class="org.exoplatform.services.jcr.impl.storage.value.fs.CASableTreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws3" />
+ <property name="digest-algo" value="MD5" />
+ <property name="vcas-type" value="org.exoplatform.services.jcr.impl.storage.value.cas.JDBCValueContentAddressStorageImpl" />
+ <property name="jdbc-source-name" value="jdbcjcr" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1/ws3" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr3" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+ <repository name="db2" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrdb2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wsdb2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wsdb2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db2/ws" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrdb2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1db2" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1db2" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1db2" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;any add_node;any set_property;any remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db2/ws1" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1db2" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+
+
+ <repository name="db1tck" system-workspace="ws" default-workspace="ws">
+ <security-domain>exo-domain</security-domain>
+ <!-- access-control>optional</access-control -->
+ <!-- access-control>disable</access-control -->
+ <session-max-age>1h</session-max-age>
+ <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
+ <workspaces>
+ <workspace name="ws">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/wstck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/wstck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcrtck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1tck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws1tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws1" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws1tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws1" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr1tck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2tck" />
+ <property name="dialect" value="auto" />
+ <property name="multi-db" value="true" />
+ <property name="update-storage" value="false" />
+ <property name="max-buffer-size" value="200k" />
+ <property name="swap-directory" value="target/temp/swap/ws2tck" />
+ </properties>
+ <value-storages>
+ <value-storage id="ws2" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path" value="target/temp/values/ws2tck" />
+ <property name="enabled" value="${value-storage-enabled}" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" min-value-size="100K" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype" value="nt:unstructured" />
+ <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove" />
+ </properties>
+ </initializer>
+ <cache enabled="${cache-enabled}" class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
+ <properties>
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-config.xml" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="target/temp/index/db1tck/ws2" />
+ <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
+ <property name="synonymprovider-config-path" value="../../synonyms.properties" />
+ <property name="support-highlighting" value="true" />
+ <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
+ <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
+ <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
+ <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt"/>
+ <property name="extractorPoolSize" value="2"/>
+ <property name="extractorTimeout" value="10"/>
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="infinispan-configuration" value="conf/standalone/test-infinispan-lock.xml" />
+ <property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
+ <property name="infinispan-cl-cache.jdbc.table.create" value="true" />
+ <property name="infinispan-cl-cache.jdbc.table.drop" value="false" />
+ <property name="infinispan-cl-cache.jdbc.id.column" value="id" />
+ <property name="infinispan-cl-cache.jdbc.data.column" value="data" />
+ <property name="infinispan-cl-cache.jdbc.timestamp.column" value="timestamp" />
+ <property name="infinispan-cl-cache.jdbc.datasource" value="jdbcjcr2tck" />
+ <property name="infinispan-cl-cache.jdbc.connectionFactory" value="org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory" />
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/test.policy
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/test.policy (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/test.policy 2011-12-15 16:53:39 UTC (rev 5332)
@@ -0,0 +1,19 @@
+grant codeBase "@MAVEN_REPO@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@TEST_CLASSES@-"{
+ permission java.lang.RuntimePermission "createSystemSession";
+ permission java.lang.RuntimePermission "createDynamicSession";
+ permission java.lang.RuntimePermission "manageRepository";
+ permission java.lang.RuntimePermission "accessRPCService";
+ permission java.lang.RuntimePermission "invokeInternalAPI";
+};
+
+grant codeBase "@MAIN_CLASSES@../../../exo.jcr.component.core/-"{
+ permission java.security.AllPermission;
+};
\ No newline at end of file
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2011-12-15 16:30:03 UTC (rev 5331)
+++ jcr/trunk/pom.xml 2011-12-15 16:53:39 UTC (rev 5332)
@@ -82,6 +82,11 @@
<version>${org.exoplatform.kernel.version}</version>
</dependency>
<dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.ext.rpc.impl.jgroups.v3</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.core</groupId>
<artifactId>exo.core.component.database</artifactId>
<version>${org.exoplatform.core.version}</version>
@@ -387,12 +392,12 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
- <version>5.0.1.FINAL</version>
+ <version>5.1.0.CR1</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-cachestore-jdbc</artifactId>
- <version>5.0.1.FINAL</version>
+ <version>5.1.0.CR1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -464,6 +469,7 @@
</build>
<modules>
<module>exo.jcr.component.core</module>
+ <module>exo.jcr.component.core.impl.infinispan.v5</module>
<module>exo.jcr.component.statistics</module>
<module>exo.jcr.component.ext</module>
<module>exo.jcr.component.ftp</module>
12 years, 5 months
exo-jcr SVN: r5331 - in kernel/trunk: exo.kernel.component.ext.cache.impl.infinispan.v5 and 13 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-12-15 11:30:03 -0500 (Thu, 15 Dec 2011)
New Revision: 5331
Added:
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/AbstractMapper.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/Utils.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/configuration.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/test.policy
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/tsm-excludes.properties
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/util/TestTemplateConfigurationHelper.java
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/generic/GenericExoCacheCreator.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/TestAbstractExoCache.java
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/test-configuration.xml
kernel/trunk/pom.xml
Log:
EXOJCR-1682: Improve ISPN integration to support properly the distribution mode (kernel part)
* Upgrade to ISPN 5.1.0.CR1
* Propose a distributed eXo cache based on ISPN that is enabled when distributed is set to true in the eXo Cache Config, this cache is shared to be able to extend the capacity of the cache using external JVM in standalone mode
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/pom.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -1,19 +1,9 @@
- <!--
-
- Copyright (C) 2009 eXo Platform SAS. 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.
- -->
+<!-- Copyright (C) 2009 eXo Platform SAS. 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. -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -27,6 +17,10 @@
<dependencies>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons.test</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.component.cache</artifactId>
</dependency>
<dependency>
@@ -36,7 +30,7 @@
<dependency>
<groupId>org.jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.12.1.3.Final</version>
+ <version>3.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -49,25 +43,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <argLine>${env.MAVEN_OPTS} -Djava.security.manager=org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=${project.build.directory}/test-classes/test.policy</argLine>
<systemProperties>
- <!--
- We add this system property due to some incompatibility between
- IPv6 and some JVM of Linux distributions such as Ubuntu and
- Fedora
- -->
+ <!-- We add this system property due to some incompatibility between IPv6 and some JVM of Linux distributions such as Ubuntu and Fedora -->
<property>
<name>java.net.preferIPv4Stack</name>
<value>true</value>
</property>
<!-- Avoid the firewall -->
<property>
- <name>bind.address</name>
+ <name>jgroups.bind_addr</name>
<value>127.0.0.1</value>
</property>
- <property>
- <name>jgroups.stack</name>
- <value>udp</value>
- </property>
</systemProperties>
</configuration>
</plugin>
@@ -79,6 +66,43 @@
<target>1.6</target>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-test-policy</id>
+ <phase>process-test-resources</phase>
+ <configuration>
+ <tasks>
+ <echo>Creating Access Policy for tests</echo>
+ <makeurl file="${settings.localRepository}" property="localRepositoryURL" />
+ <makeurl file="${project.build.outputDirectory}" property="outputDirectoryURL" />
+ <makeurl file="${project.build.testOutputDirectory}" property="testOutputDirectoryURL" />
+ <copy todir="${project.build.testOutputDirectory}" overwrite="true">
+ <fileset dir="${project.basedir}/src/test/resources/">
+ <include name="test.policy" />
+ </fileset>
+ <filterset>
+ <filter token="MAVEN_REPO" value="${localRepositoryURL}" />
+ <filter token="MAIN_CLASSES" value="${outputDirectoryURL}" />
+ <filter token="TEST_CLASSES" value="${testOutputDirectoryURL}" />
+ </filterset>
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</project>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.cache.impl.infinispan;
+import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.cache.CacheInfo;
import org.exoplatform.services.cache.CacheListener;
import org.exoplatform.services.cache.CacheListenerContext;
@@ -39,6 +40,7 @@
import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
import java.io.Serializable;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -219,13 +221,22 @@
/**
* {@inheritDoc}
*/
- public void put(K key, V value) throws NullPointerException
+ public void put(final K key, final V value) throws NullPointerException
{
if (key == null)
{
throw new NullPointerException("No null cache key accepted");
- }
- putOnly(key, value);
+ }
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+
+ @Override
+ public Void run()
+ {
+ putOnly(key, value);
+ return null;
+ }
+ });
onPut(key, value);
}
@@ -240,7 +251,7 @@
/**
* {@inheritDoc}
*/
- public void putMap(Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ public void putMap(final Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
{
if (objs == null)
{
@@ -253,39 +264,56 @@
throw new IllegalArgumentException("No null cache key accepted");
}
}
- cache.startBatch();
- try
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
- // Start transaction
- for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
+
+ @Override
+ public Void run()
{
- putOnly(entry.getKey(), entry.getValue());
+ cache.startBatch();
+ try
+ {
+ // Start transaction
+ for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
+ {
+ putOnly(entry.getKey(), entry.getValue());
+ }
+ cache.endBatch(true);
+ // End transaction
+ for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
+ {
+ onPut(entry.getKey(), entry.getValue());
+ }
+ }
+ catch (Exception e)
+ {
+ cache.endBatch(false);
+ LOG.warn("An error occurs while executing the putMap method", e);
+ }
+ return null;
}
- cache.endBatch(true);
- // End transaction
- for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
- {
- onPut(entry.getKey(), entry.getValue());
- }
- }
- catch (Exception e)
- {
- cache.endBatch(false);
- LOG.warn("An error occurs while executing the putMap method", e);
- }
+ });
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public V remove(Serializable name) throws NullPointerException
+ public V remove(final Serializable name) throws NullPointerException
{
if (name == null)
{
throw new NullPointerException("No null cache key accepted");
}
- V result = cache.remove(name);
+ V result = SecurityHelper.doPrivilegedAction(new PrivilegedAction<V>()
+ {
+
+ @Override
+ public V run()
+ {
+ return cache.remove(name);
+ }
+ });
onRemove((K)name, result);
return result;
}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/ExoCacheFactoryImpl.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.cache.impl.infinispan;
+import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
@@ -26,7 +27,10 @@
import org.exoplatform.services.cache.ExoCacheConfig;
import org.exoplatform.services.cache.ExoCacheFactory;
import org.exoplatform.services.cache.ExoCacheInitException;
+import org.exoplatform.services.cache.impl.infinispan.distributed.DistributedExoCache;
import org.exoplatform.services.cache.impl.infinispan.generic.GenericExoCacheCreator;
+import org.exoplatform.services.ispn.DistributedCacheManager;
+import org.exoplatform.services.ispn.Utils;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.infinispan.Cache;
@@ -36,12 +40,11 @@
import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.jmx.MBeanServerLookup;
import org.infinispan.manager.DefaultCacheManager;
-import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
-import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
-import java.net.URL;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -64,8 +67,8 @@
/**
* The logger
*/
- private static final Log LOG =
- ExoLogger.getLogger("exo.kernel.component.ext.cache.impl.infinispan.v5.ExoCacheFactoryImpl");
+ private static final Log LOG = ExoLogger
+ .getLogger("exo.kernel.component.ext.cache.impl.infinispan.v5.ExoCacheFactoryImpl");
/**
* The initial parameter key that defines the full path of the configuration template
@@ -73,10 +76,15 @@
private static final String CACHE_CONFIG_TEMPLATE_KEY = "cache.config.template";
/**
+ * The cache manager for the distributed cache
+ */
+ private final DistributedCacheManager distributedCacheManager;
+
+ /**
* The current {@link ExoContainerContext}
*/
private final ExoContainerContext ctx;
-
+
/**
* The configuration manager that allows us to retrieve a configuration file in several different
* manners
@@ -103,35 +111,48 @@
* The mapping between the cache names and the configuration paths
*/
private final Map<String, String> mappingCacheNameConfig = new HashMap<String, String>();
-
+
/**
* The mapping between the global configuration and the cache managers
- */
- private final Map<GlobalConfiguration, DefaultCacheManager> mappingGlobalConfigCacheManager =
- new HashMap<GlobalConfiguration, DefaultCacheManager>();
+ */
+ private final Map<GlobalConfiguration, DefaultCacheManager> mappingGlobalConfigCacheManager =
+ new HashMap<GlobalConfiguration, DefaultCacheManager>();
/**
* The default creator
*/
private final ExoCacheCreator defaultCreator = new GenericExoCacheCreator();
-
+
private static final MBeanServerLookup MBEAN_SERVER_LOOKUP = new MBeanServerLookup()
{
public MBeanServer getMBeanServer(Properties properties)
{
return ExoContainerContext.getTopContainer().getMBeanServer();
- }
+ }
};
public ExoCacheFactoryImpl(ExoContainerContext ctx, InitParams params, ConfigurationManager configManager)
throws ExoCacheInitException
{
- this(ctx, getValueParam(params, CACHE_CONFIG_TEMPLATE_KEY), configManager);
+ this(ctx, params, configManager, null);
}
ExoCacheFactoryImpl(ExoContainerContext ctx, String cacheConfigTemplate, ConfigurationManager configManager)
throws ExoCacheInitException
{
+ this(ctx, cacheConfigTemplate, configManager, null);
+ }
+
+ public ExoCacheFactoryImpl(ExoContainerContext ctx, InitParams params, ConfigurationManager configManager,
+ DistributedCacheManager dcm) throws ExoCacheInitException
+ {
+ this(ctx, getValueParam(params, CACHE_CONFIG_TEMPLATE_KEY), configManager, dcm);
+ }
+
+ public ExoCacheFactoryImpl(ExoContainerContext ctx, String cacheConfigTemplate, ConfigurationManager configManager,
+ DistributedCacheManager dcm) throws ExoCacheInitException
+ {
+ this.distributedCacheManager = dcm;
this.ctx = ctx;
this.configManager = configManager;
if (cacheConfigTemplate == null)
@@ -148,42 +169,62 @@
* Initializes the {@link DefaultCacheManager}
* @throws ExoCacheInitException if the cache manager cannot be initialized
*/
- private DefaultCacheManager initCacheManager(String cacheConfigTemplate)
- throws ExoCacheInitException
+ private DefaultCacheManager initCacheManager(final String cacheConfigTemplate) throws ExoCacheInitException
{
- InputStream is = null;
try
{
- // Read the configuration file of the cache
- is = configManager.getInputStream(cacheConfigTemplate);
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<DefaultCacheManager>()
+ {
+ public DefaultCacheManager run() throws Exception
+ {
+ InputStream is = null;
+ try
+ {
+ // Read the configuration file of the cache
+ is = configManager.getInputStream(cacheConfigTemplate);
+ }
+ catch (Exception e)
+ {
+ throw new ExoCacheInitException("The configuration of the CacheManager cannot be loaded from '"
+ + cacheConfigTemplate + "'", e);
+ }
+ if (is == null)
+ {
+ throw new ExoCacheInitException("The configuration of the CacheManager cannot be found at '"
+ + cacheConfigTemplate + "'");
+ }
+ DefaultCacheManager cacheManager = null;
+ try
+ {
+ // Create the CacheManager from the input stream
+ cacheManager = new DefaultCacheManager(is, false);
+ }
+ catch (Exception e)
+ {
+ throw new ExoCacheInitException("Cannot initialize the CacheManager corresponding to the configuration '"
+ + cacheConfigTemplate + "'", e);
+ }
+
+ GlobalConfiguration config = cacheManager.getGlobalConfiguration();
+
+ configureCacheManager(config);
+ cacheManager.start();
+ return cacheManager;
+ }
+ });
}
- catch (Exception e)
+ catch (PrivilegedActionException e)
{
- throw new ExoCacheInitException("The configuration of the CacheManager cannot be loaded from '"
- + cacheConfigTemplate + "'", e);
- }
- if (is == null)
- {
- throw new ExoCacheInitException("The configuration of the CacheManager cannot be found at '"
- + cacheConfigTemplate + "'");
- }
- DefaultCacheManager cacheManager = null;
- try
- {
- // Create the CacheManager from the input stream
- cacheManager = new DefaultCacheManager(is, false);
- }
- catch (Exception e)
- {
- throw new ExoCacheInitException("Cannot initialize the CacheManager corresponding to the configuration '"
- + cacheConfigTemplate + "'", e);
- }
-
- GlobalConfiguration config = cacheManager.getGlobalConfiguration();
-
- configureCacheManager(config);
- cacheManager.start();
- return cacheManager;
+ Throwable cause = e.getCause();
+ if (cause instanceof ExoCacheInitException)
+ {
+ throw (ExoCacheInitException)cause;
+ }
+ else
+ {
+ throw new ExoCacheInitException(e);
+ }
+ }
}
/**
@@ -199,7 +240,7 @@
// Configure the name of the cache manager
config.fluent().globalJmxStatistics().cacheManagerName(config.getCacheManagerName() + "_" + ctx.getName()).
// Configure the MBeanServerLookup
- mBeanServerLookup(MBEAN_SERVER_LOOKUP);
+ mBeanServerLookup(MBEAN_SERVER_LOOKUP);
}
/**
@@ -227,75 +268,10 @@
*/
private boolean loadJGroupsConfig(GlobalConfiguration config) throws ExoCacheInitException
{
- Properties properties = config.getTransportProperties();
- if (properties == null || !properties.containsKey(JGroupsTransport.CONFIGURATION_FILE))
- {
- return false;
- }
- InputStream is;
- String jgroupsFileLocation = properties.getProperty(JGroupsTransport.CONFIGURATION_FILE);
- try
- {
- // Read the jgroups configuration file
- URL url = configManager.getURL(jgroupsFileLocation);
- is = url == null ? null : url.openStream();
- }
- catch (Exception e)
- {
- throw new ExoCacheInitException("The jgroups configuration cannot be loaded from '" + jgroupsFileLocation
- + "'", e);
- }
- if (is != null)
- {
- try
- {
- // Set the jgroups configuration as XML
- properties.setProperty(JGroupsTransport.CONFIGURATION_XML, readStream(is));
- }
- catch (IOException e)
- {
- throw new ExoCacheInitException("The jgroups configuration cannot be read from '" + jgroupsFileLocation
- + "'");
- }
- // Remove the property corresponding to the configuration file
- properties.remove(JGroupsTransport.CONFIGURATION_FILE);
- }
- return true;
+ return Utils.loadJGroupsConfig(configManager, config);
}
/**
- * Reads bytes from input stream and builds a string from them
- *
- * @param inputStream
- * @return
- * @throws IOException
- */
- protected String readStream(InputStream inputStream) throws IOException
- {
- StringBuilder out = new StringBuilder(4096);
- byte[] b = new byte[4096];
- try
- {
- for (int length; (length = inputStream.read(b)) != -1;)
- {
- out.append(new String(b, 0, length));
- }
- }
- finally
- {
- try
- {
- inputStream.close();
- }
- catch (Exception e)
- {
- LOG.debug("Cannot close stream", e);
- }
- }
- return out.toString();
- }
-
- /**
* To create a new cache instance according to the given configuration, we follow the steps below:
*
* We first try to find if a specific location of the cache configuration has been defined thanks
@@ -303,7 +279,8 @@
* configuration defined in this file otherwise we use the default cache configuration defined in
* "${CACHE_CONFIG_TEMPLATE_KEY}"
*/
- public ExoCache<Serializable, Object> createCache(ExoCacheConfig config) throws ExoCacheInitException
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ public ExoCache<Serializable, Object> createCache(final ExoCacheConfig config) throws ExoCacheInitException
{
final String region = config.getName();
final String customConfig = mappingCacheNameConfig.get(region);
@@ -314,29 +291,63 @@
final Configuration conf;
if (customConfig != null)
{
- // A custom configuration has been set
- if (LOG.isInfoEnabled())
- LOG.info("A custom configuration has been set for the cache '" + region + "'.");
- // Create the CacheManager by loading the configuration
- DefaultCacheManager customCacheManager = new DefaultCacheManager(configManager.getInputStream(customConfig), false);
- GlobalConfiguration gc = customCacheManager.getGlobalConfiguration();
- // Configure JGroups and JMX since it could affect the state of the Global Config
- configureCacheManager(gc);
- // Check if a CacheManager with the same GlobalConfiguration exists
- DefaultCacheManager currentCacheManager = mappingGlobalConfigCacheManager.get(gc);
- if (currentCacheManager == null)
+ try
{
- // No cache manager has been defined so far for this Cache Configuration
- currentCacheManager = customCacheManager;
- // Use a different cache manager name to prevent naming conflict
- gc.fluent().globalJmxStatistics().cacheManagerName(gc.getCacheManagerName() + "_" + region + "_" + ctx.getName());
- currentCacheManager.start();
- // We register this new cache manager
- mappingGlobalConfigCacheManager.put(gc, customCacheManager);
+ cacheManager = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<DefaultCacheManager>()
+ {
+ public DefaultCacheManager run() throws Exception
+ {
+ // A custom configuration has been set
+ if (LOG.isInfoEnabled())
+ LOG.info("A custom configuration has been set for the cache '" + region + "'.");
+ // Create the CacheManager by loading the configuration
+ DefaultCacheManager customCacheManager =
+ new DefaultCacheManager(configManager.getInputStream(customConfig), false);
+ GlobalConfiguration gc = customCacheManager.getGlobalConfiguration();
+ // Configure JGroups and JMX since it could affect the state of the Global Config
+ configureCacheManager(gc);
+ // Check if a CacheManager with the same GlobalConfiguration exists
+ DefaultCacheManager currentCacheManager = mappingGlobalConfigCacheManager.get(gc);
+ if (currentCacheManager == null)
+ {
+ // No cache manager has been defined so far for this Cache Configuration
+ currentCacheManager = customCacheManager;
+ // Use a different cache manager name to prevent naming conflict
+ gc.fluent().globalJmxStatistics()
+ .cacheManagerName(gc.getCacheManagerName() + "_" + region + "_" + ctx.getName());
+ currentCacheManager.start();
+ // We register this new cache manager
+ mappingGlobalConfigCacheManager.put(gc, customCacheManager);
+ }
+ return currentCacheManager;
+ }
+ });
}
- conf = currentCacheManager.getDefaultConfiguration().clone();
- cacheManager = currentCacheManager;
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause instanceof Exception)
+ {
+ throw (Exception)cause;
+ }
+ else
+ {
+ throw new Exception(e);
+ }
+ }
+ conf = cacheManager.getDefaultConfiguration().clone();
}
+ else if (config.isDistributed())
+ {
+ // We expect a distributed cache
+ if (distributedCacheManager == null)
+ {
+ throw new NullPointerException("The DistributedCacheManager has not been defined in the configuration,"
+ + " please configure it at root container level if you want to use a distributed cache.");
+ }
+ return new DistributedExoCache(ctx, config,
+ distributedCacheManager.getCache(DistributedExoCache.CACHE_NAME));
+ }
else
{
cacheManager = this.cacheManager;
@@ -344,7 +355,7 @@
if (LOG.isInfoEnabled())
LOG.info("The configuration template will be used for the the cache '" + region + "'.");
conf = cacheManager.getDefaultConfiguration().clone();
- if (!config.isDistributed() && !config.isRepicated())
+ if (!config.isRepicated())
{
// The cache is local
conf.fluent().clustering().mode(CacheMode.LOCAL);
@@ -359,10 +370,31 @@
@Override
public Cache<Serializable, Object> call() throws Exception
{
- // Define the configuration
- cacheManager.defineConfiguration(region, conf);
- // create and start the cache
- return cacheManager.getCache(region);
+ try
+ {
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Cache<Serializable, Object>>()
+ {
+ public Cache<Serializable, Object> run() throws Exception
+ {
+ // Define the configuration
+ cacheManager.defineConfiguration(region, conf);
+ // create and start the cache
+ return cacheManager.getCache(region);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ if (cause instanceof Exception)
+ {
+ throw (Exception)cause;
+ }
+ else
+ {
+ throw new Exception(e);
+ }
+ }
}
});
}
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/distributed/DistributedExoCache.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,1180 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.cache.impl.infinispan.distributed;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.management.annotations.ManagedName;
+import org.exoplatform.services.cache.CacheInfo;
+import org.exoplatform.services.cache.CacheListener;
+import org.exoplatform.services.cache.CacheListenerContext;
+import org.exoplatform.services.cache.CachedObjectSelector;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.cache.ExoCacheConfig;
+import org.exoplatform.services.cache.ObjectCacheInfo;
+import org.exoplatform.services.ispn.AbstractMapper;
+import org.exoplatform.services.ispn.DistributedCacheManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.AdvancedCache;
+import org.infinispan.Cache;
+import org.infinispan.context.Flag;
+import org.infinispan.distexec.mapreduce.Collector;
+import org.infinispan.distexec.mapreduce.MapReduceTask;
+import org.infinispan.distexec.mapreduce.Reducer;
+import org.infinispan.notifications.Listener;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntriesEvicted;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
+import org.infinispan.notifications.cachelistener.annotation.CacheEntryRemoved;
+import org.infinispan.notifications.cachelistener.event.CacheEntriesEvictedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
+import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
+import org.infinispan.util.concurrent.locks.LockManager;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.Serializable;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class DistributedExoCache<K extends Serializable, V> implements ExoCache<K, V>
+{
+
+ /**
+ * Logger.
+ */
+ private static final Log LOG = ExoLogger
+ .getLogger("exo.kernel.component.ext.cache.impl.infinispan.v5.DistributedExoCache");
+
+ public static final String CACHE_NAME = "eXoCache";
+
+ private final AtomicInteger hits = new AtomicInteger(0);
+
+ private final AtomicInteger misses = new AtomicInteger(0);
+
+ private String label;
+
+ private String name;
+
+ private final String fullName;
+
+ private boolean distributed;
+
+ private boolean replicated;
+
+ private boolean logEnabled;
+
+ @SuppressWarnings("rawtypes")
+ private static final ConcurrentMap<Cache, ConcurrentMap<String, List<ListenerContext>>> ALL_LISTENERS =
+ new ConcurrentHashMap<Cache, ConcurrentMap<String, List<ListenerContext>>>();
+
+ protected final AdvancedCache<CacheKey<K>, V> cache;
+
+ @SuppressWarnings("unchecked")
+ public DistributedExoCache(ExoContainerContext ctx, ExoCacheConfig config, Cache<K, V> cache)
+ {
+ this.fullName = ctx.getName() + "-" + config.getName();
+ this.cache = (AdvancedCache<CacheKey<K>, V>)cache.getAdvancedCache();
+ setDistributed(config.isDistributed());
+ setLabel(config.getLabel());
+ setName(config.getName());
+ setLogEnabled(config.isLogEnabled());
+ setReplicated(config.isRepicated());
+ }
+
+ AdvancedCache<CacheKey<K>, V> getCache()
+ {
+ return cache;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("rawtypes")
+ public void addCacheListener(CacheListener<? super K, ? super V> listener)
+ {
+ if (listener == null)
+ {
+ throw new NullPointerException();
+ }
+ List<ListenerContext> lListeners = getListeners(fullName);
+ if (lListeners == null)
+ {
+ lListeners = new CopyOnWriteArrayList<ListenerContext>();
+ boolean alreadyAdded = false;
+ ConcurrentMap<String, List<ListenerContext>> listeners = getOrCreateListeners();
+ if (listeners.isEmpty())
+ {
+ synchronized (listeners)
+ {
+ if (listeners.isEmpty())
+ {
+ // Ensure that the listener is added only once
+ cache.addListener(new CacheEventListener());
+ listeners.put(fullName, lListeners);
+ alreadyAdded = true;
+ }
+ }
+ }
+ if (!alreadyAdded)
+ {
+ List<ListenerContext> oldValue = listeners.putIfAbsent(fullName, lListeners);
+ if (oldValue != null)
+ {
+ lListeners = oldValue;
+ }
+ }
+ }
+ lListeners.add(new ListenerContext<K, V>(listener, this));
+ }
+
+ @SuppressWarnings("rawtypes")
+ private ConcurrentMap<String, List<ListenerContext>> getOrCreateListeners()
+ {
+ ConcurrentMap<String, List<ListenerContext>> listeners = ALL_LISTENERS.get(cache);
+ if (listeners == null)
+ {
+ listeners = new ConcurrentHashMap<String, List<ListenerContext>>();
+ ConcurrentMap<String, List<ListenerContext>> oldValue = ALL_LISTENERS.putIfAbsent(cache, listeners);
+ if (oldValue != null)
+ {
+ listeners = oldValue;
+ }
+ }
+ return listeners;
+ }
+
+ @SuppressWarnings("rawtypes")
+ private List<ListenerContext> getListeners(String fullName)
+ {
+ ConcurrentMap<String, List<ListenerContext>> listeners = ALL_LISTENERS.get(cache);
+ return listeners == null ? null : listeners.get(fullName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void clearCache()
+ {
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+
+ @Override
+ public Void run()
+ {
+ MapReduceTask<CacheKey<K>, V, String, CacheKey<K>> task = new MapReduceTask<CacheKey<K>, V, String, CacheKey<K>>(cache);
+ task.mappedWith(new ClearCacheMapper<K, V>(fullName)).reducedWith(new ClearCacheReducer<String, V, K>());
+ task.execute();
+ return null;
+ }
+
+ });
+ onClearCache();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public V get(Serializable name)
+ {
+ if (name == null)
+ {
+ return null;
+ }
+ @SuppressWarnings("rawtypes")
+ final CacheKey key = new CacheKey<Serializable>(fullName, name);
+ final V result = SecurityHelper.doPrivilegedAction(new PrivilegedAction<V>()
+ {
+
+ @Override
+ public V run()
+ {
+ return cache.get(key);
+ }
+
+ });
+ if (result == null)
+ {
+ misses.incrementAndGet();
+ }
+ else
+ {
+ hits.incrementAndGet();
+ }
+ onGet(key, result);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getCacheHit()
+ {
+ return hits.get();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getCacheMiss()
+ {
+ return misses.get();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getCacheSize()
+ {
+ Map<String, Integer> map = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Map<String, Integer>>()
+ {
+
+ @Override
+ public Map<String, Integer> run()
+ {
+ MapReduceTask<CacheKey<K>, V, String, Integer> task = new MapReduceTask<CacheKey<K>, V, String, Integer>(cache);
+ task.mappedWith(new GetSizeMapper<K, V>(fullName)).reducedWith(new GetSizeReducer<String>());
+ return task.execute();
+ }
+
+ });
+ int sum = 0;
+ for (Integer i : map.values())
+ {
+ sum += i;
+ }
+ return sum;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<V> getCachedObjects()
+ {
+ Map<String, List<V>> map = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Map<String, List<V>>>()
+ {
+
+ @Override
+ public Map<String, List<V>> run()
+ {
+ MapReduceTask<CacheKey<K>, V, String, List<V>> task = new MapReduceTask<CacheKey<K>, V, String, List<V>>(cache);
+ task.mappedWith(new GetCachedObjectsMapper<K, V>(fullName)).reducedWith(new GetCachedObjectsReducer<String, V>());
+ return task.execute();
+ }
+
+ });
+ List<V> result = new ArrayList<V>();
+ for (List<V> vals : map.values())
+ {
+ result.addAll(vals);
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabel()
+ {
+ return label;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isDistributed()
+ {
+ return distributed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLogEnabled()
+ {
+ return logEnabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isReplicated()
+ {
+ return replicated;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void put(final K key, final V value) throws NullPointerException
+ {
+ if (key == null)
+ {
+ throw new NullPointerException("No null cache key accepted");
+ }
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+
+ @Override
+ public Void run()
+ {
+ putOnly(key, value);
+ return null;
+ }
+
+ });
+ onPut(key, value);
+ }
+
+ /**
+ * Only puts the data into the cache nothing more
+ */
+ protected void putOnly(K key, V value)
+ {
+ cache.withFlags(Flag.SKIP_REMOTE_LOOKUP).put(new CacheKey<K>(fullName, key), value);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void putMap(final Map<? extends K, ? extends V> objs) throws NullPointerException, IllegalArgumentException
+ {
+ if (objs == null)
+ {
+ throw new NullPointerException("No null map accepted");
+ }
+ for (Serializable name : objs.keySet())
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null cache key accepted");
+ }
+ }
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+
+ @Override
+ public Void run()
+ {
+ cache.startBatch();
+ try
+ {
+ // Start transaction
+ for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
+ {
+ putOnly(entry.getKey(), entry.getValue());
+ }
+ cache.endBatch(true);
+ // End transaction
+ for (Map.Entry<? extends K, ? extends V> entry : objs.entrySet())
+ {
+ onPut(entry.getKey(), entry.getValue());
+ }
+ }
+ catch (Exception e)
+ {
+ cache.endBatch(false);
+ LOG.warn("An error occurs while executing the putMap method", e);
+ }
+ return null;
+ }
+ });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public V remove(Serializable name) throws NullPointerException
+ {
+ if (name == null)
+ {
+ throw new NullPointerException("No null cache key accepted");
+ }
+ @SuppressWarnings("rawtypes")
+ CacheKey key = new CacheKey<Serializable>(fullName, name);
+ V result = cache.remove(key);
+ onRemove(key, result);
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<V> removeCachedObjects()
+ {
+ final List<V> list = getCachedObjects();
+ clearCache();
+ return list;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void select(CachedObjectSelector<? super K, ? super V> selector) throws Exception
+ {
+ if (selector == null)
+ {
+ throw new IllegalArgumentException("No null selector");
+ }
+ Map<K, V> map = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Map<K, V>>()
+ {
+
+ @Override
+ public Map<K, V> run()
+ {
+ MapReduceTask<CacheKey<K>, V, K, V> task = new MapReduceTask<CacheKey<K>, V, K, V>(cache);
+ task.mappedWith(new GetEntriesMapper<K, V>(fullName)).reducedWith(new GetEntriesReducer<K, V>());
+ return task.execute();
+ }
+
+ });
+
+ for (K key : map.keySet())
+ {
+ if (key == null)
+ {
+ continue;
+ }
+ final V value = map.get(key);
+ ObjectCacheInfo<V> info = new ObjectCacheInfo<V>()
+ {
+ public V get()
+ {
+ return value;
+ }
+
+ public long getExpireTime()
+ {
+ // Cannot know: The expire time is managed by Infinispan itself
+ return -1;
+ }
+ };
+ if (selector.select(key, info))
+ {
+ selector.onSelect(this, key, info);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDistributed(boolean distributed)
+ {
+ this.distributed = distributed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setLabel(String label)
+ {
+ this.label = label;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setLogEnabled(boolean logEnabled)
+ {
+ this.logEnabled = logEnabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setReplicated(boolean replicated)
+ {
+ this.replicated = replicated;
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ void onExpire(CacheKey<K> key, V obj)
+ {
+ List<ListenerContext> listeners = getListeners(key.getFullName());
+ if (listeners == null || listeners.isEmpty())
+ {
+ return;
+ }
+ for (ListenerContext context : listeners)
+ {
+ try
+ {
+ context.onExpire(key.getKey(), obj);
+ }
+ catch (Exception e)
+ {
+ if (LOG.isWarnEnabled())
+ LOG.warn("Cannot execute the CacheListener properly", e);
+ }
+ }
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ void onRemove(CacheKey<K> key, V obj)
+ {
+ List<ListenerContext> listeners = getListeners(key.getFullName());
+ if (listeners == null || listeners.isEmpty())
+ {
+ return;
+ }
+ for (ListenerContext context : listeners)
+ {
+ try
+ {
+ context.onRemove(key, obj);
+ }
+ catch (Exception e)
+ {
+ if (LOG.isWarnEnabled())
+ LOG.warn("Cannot execute the CacheListener properly", e);
+ }
+ }
+ }
+
+ void onPut(CacheKey<K> key, V obj)
+ {
+ onPut(key.getFullName(), key.getKey(), obj);
+ }
+
+ void onPut(K key, V obj)
+ {
+ onPut(fullName, key, obj);
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ void onPut(String fullName, K key, V obj)
+ {
+ List<ListenerContext> listeners = getListeners(fullName);
+ if (listeners == null || listeners.isEmpty())
+ {
+ return;
+ }
+ for (ListenerContext context : listeners)
+ {
+ try
+ {
+ context.onPut(key, obj);
+ }
+ catch (Exception e)
+ {
+ if (LOG.isWarnEnabled())
+ LOG.warn("Cannot execute the CacheListener properly", e);
+ }
+ }
+ }
+
+ @SuppressWarnings({"rawtypes", "unchecked"})
+ void onGet(CacheKey<K> key, V obj)
+ {
+ List<ListenerContext> listeners = getListeners(key.getFullName());
+ if (listeners == null || listeners.isEmpty())
+ {
+ return;
+ }
+ for (ListenerContext context : listeners)
+ {
+ try
+ {
+ context.onGet(key, obj);
+ }
+ catch (Exception e)
+ {
+ if (LOG.isWarnEnabled())
+ LOG.warn("Cannot execute the CacheListener properly", e);
+ }
+ }
+ }
+
+ @SuppressWarnings("rawtypes")
+ void onClearCache()
+ {
+ List<ListenerContext> listeners = getListeners(fullName);
+ if (listeners == null || listeners.isEmpty())
+ {
+ return;
+ }
+ for (ListenerContext context : listeners)
+ {
+ try
+ {
+ context.onClearCache();
+ }
+ catch (Exception e)
+ {
+ if (LOG.isWarnEnabled())
+ LOG.warn("Cannot execute the CacheListener properly", e);
+ }
+ }
+ }
+
+ @Listener
+ public class CacheEventListener
+ {
+ /**
+ * Warning Infinispan triggers a <code>CacheEntryEvictedEvent</code> only at explicit eviction
+ * that is done lazily which is not exactly what we expect, we still use it to be
+ * able to use it with <code>avoidValueReplication</code> set to <code>true</code>.
+ */
+ @CacheEntriesEvicted
+ public void cacheEntryEvicted(CacheEntriesEvictedEvent<CacheKey<K>, V> evt)
+ {
+ if (evt.isPre())
+ {
+ for (Map.Entry<CacheKey<K>, V> entry : evt.getEntries().entrySet())
+ {
+ onExpire(entry.getKey(), entry.getValue());
+ }
+ }
+ }
+
+ @CacheEntryRemoved
+ public void cacheEntryRemoved(CacheEntryRemovedEvent<CacheKey<K>, V> evt)
+ {
+ if (evt.isPre() && !evt.isOriginLocal())
+ {
+ final CacheKey<K> key = evt.getKey();
+ final V value = evt.getValue();
+ onRemove(key, value);
+ }
+ }
+
+ @CacheEntryModified
+ public void cacheEntryModified(CacheEntryModifiedEvent<CacheKey<K>, V> evt)
+ {
+ if (!evt.isOriginLocal() && !evt.isPre())
+ {
+ final CacheKey<K> key = evt.getKey();
+ final V value = evt.getValue();
+ onPut(key, value);
+ }
+ }
+ }
+
+ private static class ListenerContext<K extends Serializable, V> implements CacheListenerContext, CacheInfo
+ {
+
+ /** . */
+ private final ExoCache<K, V> cache;
+
+ /** . */
+ final CacheListener<? super K, ? super V> listener;
+
+ public ListenerContext(CacheListener<? super K, ? super V> listener, ExoCache<K, V> cache)
+ {
+ this.listener = listener;
+ this.cache = cache;
+ }
+
+ public CacheInfo getCacheInfo()
+ {
+ return this;
+ }
+
+ public String getName()
+ {
+ return cache.getName();
+ }
+
+ public int getMaxSize()
+ {
+ return cache.getMaxSize();
+ }
+
+ public long getLiveTime()
+ {
+ return cache.getLiveTime();
+ }
+
+ public int getSize()
+ {
+ return cache.getCacheSize();
+ }
+
+ void onExpire(K key, V obj) throws Exception
+ {
+ listener.onExpire(this, key, obj);
+ }
+
+ void onRemove(K key, V obj) throws Exception
+ {
+ listener.onRemove(this, key, obj);
+ }
+
+ void onPut(K key, V obj) throws Exception
+ {
+ listener.onPut(this, key, obj);
+ }
+
+ void onGet(K key, V obj) throws Exception
+ {
+ listener.onGet(this, key, obj);
+ }
+
+ void onClearCache() throws Exception
+ {
+ listener.onClearCache(this);
+ }
+ }
+
+ public void setMaxSize(int max)
+ {
+ throw new UnsupportedOperationException("The configuration of the cache cannot not be modified");
+ }
+
+ public void setLiveTime(long period)
+ {
+ throw new UnsupportedOperationException("The configuration of the cache cannot not be modified");
+ }
+
+ @ManagedName("MaxEntries")
+ @ManagedDescription("Maximum number of entries in a cache instance. -1 means no limit.")
+ public int getMaxSize()
+ {
+ return cache.getConfiguration().getEvictionMaxEntries();
+ }
+
+ @ManagedName("Lifespan")
+ @ManagedDescription("Maximum lifespan of a cache entry, after which the entry is expired cluster-wide."
+ + " -1 means the entries never expire.")
+ public long getLiveTime()
+ {
+ return cache.getConfiguration().getExpirationLifespan();
+ }
+
+ @Managed
+ @ManagedName("MaxIdle")
+ @ManagedDescription("Maximum idle time a cache entry will be maintained in the cache. "
+ + "If the idle time is exceeded, the entry will be expired cluster-wide. -1 means the entries never expire.")
+ public long getMaxIdle()
+ {
+ return cache.getConfiguration().getExpirationMaxIdle();
+ }
+
+ @Managed
+ @ManagedName("WakeUpInterval")
+ @ManagedDescription("Interval between subsequent eviction runs. If you wish to disable the periodic eviction "
+ + "process altogether, set wakeupInterval to -1.")
+ public long getWakeUpInterval()
+ {
+ return cache.getConfiguration().getExpirationWakeUpInterval();
+ }
+
+ public static class CacheKey<K> implements Externalizable
+ {
+ private K key;
+
+ private String fullName;
+
+ public CacheKey() {}
+ public CacheKey(String fullName, K key)
+ {
+ this.fullName = fullName;
+ this.key = key;
+ }
+
+ /**
+ * @return the nested key
+ */
+ K getKey()
+ {
+ return key;
+ }
+
+ /**
+ * @return the fullName
+ */
+ String getFullName()
+ {
+ return fullName;
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
+ result = prime * result + ((key == null) ? 0 : key.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ @SuppressWarnings("rawtypes")
+ CacheKey other = (CacheKey)obj;
+ if (fullName == null)
+ {
+ if (other.fullName != null)
+ return false;
+ }
+ else if (!fullName.equals(other.fullName))
+ return false;
+ if (key == null)
+ {
+ if (other.key != null)
+ return false;
+ }
+ else if (!key.equals(other.key))
+ return false;
+ return true;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "CacheKey [fullName=" + fullName + ", key=" + key + "]";
+ }
+
+ /**
+ * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ byte[] buf = fullName.getBytes("UTF-8");
+ out.writeInt(buf.length);
+ out.write(buf);
+ out.writeObject(key);
+ }
+
+ /**
+ * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
+ */
+ @SuppressWarnings("unchecked")
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ byte[] buf = new byte[in.readInt()];
+ in.readFully(buf);
+ fullName = new String(buf, "UTF-8");
+ key = (K)in.readObject();
+ }
+ }
+
+ private abstract static class AbstractExoCacheMapper<K, V, KOut, VOut> extends AbstractMapper<CacheKey<K>, V, KOut, VOut> implements Externalizable
+ {
+ /**
+ * The full name of the cache instance
+ */
+ private String fullName;
+
+ public AbstractExoCacheMapper() {}
+
+ public AbstractExoCacheMapper(String fullName)
+ {
+ this.fullName = fullName;
+ }
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = 7962676854308932222L;
+
+
+ /**
+ * @see org.exoplatform.services.ispn.AbstractMapper#isValid(java.lang.Object)
+ */
+ @Override
+ protected boolean isValid(CacheKey<K> key)
+ {
+ return fullName.equals(key.getFullName());
+ }
+
+ /**
+ * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
+ */
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ byte[] buf = fullName.getBytes("UTF-8");
+ out.writeInt(buf.length);
+ out.write(buf);
+ }
+
+ /**
+ * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
+ */
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ byte[] buf = new byte[in.readInt()];
+ in.readFully(buf);
+ fullName = new String(buf, "UTF-8");
+ }
+ }
+
+ public static class GetSizeMapper<K, V> extends AbstractExoCacheMapper<K, V, String, Integer>
+ {
+
+ public GetSizeMapper() {}
+
+ public GetSizeMapper(String fullName)
+ {
+ super(fullName);
+ }
+
+
+ /**
+ * @see org.exoplatform.services.ispn.AbstractMapper#_map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ @Override
+ protected void _map(CacheKey<K> key, V value, Collector<String, Integer> collector)
+ {
+ collector.emit("total", Integer.valueOf(1));
+ }
+
+ }
+
+ public static class GetSizeReducer<K> implements Reducer<K, Integer>
+ {
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = -5264142863835473112L;
+
+ /**
+ * @see org.infinispan.distexec.mapreduce.Reducer#reduce(java.lang.Object, java.util.Iterator)
+ */
+ @Override
+ public Integer reduce(K reducedKey, Iterator<Integer> iter)
+ {
+ int sum = 0;
+ while (iter.hasNext())
+ {
+ Integer i = iter.next();
+ sum += i;
+ }
+ return sum;
+ }
+ }
+
+ public static class GetCachedObjectsMapper<K, V> extends AbstractExoCacheMapper<K, V, String, List<V>>
+ {
+
+ public GetCachedObjectsMapper() {}
+
+ public GetCachedObjectsMapper(String fullName)
+ {
+ super(fullName);
+ }
+
+
+ /**
+ * @see org.exoplatform.services.ispn.AbstractMapper#_map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ @Override
+ protected void _map(CacheKey<K> key, V value, Collector<String, List<V>> collector)
+ {
+ collector.emit("values", Collections.singletonList(value));
+ }
+
+ }
+
+ public static class GetCachedObjectsReducer<K, V> implements Reducer<K, List<V>>
+ {
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = 8069024420056440405L;
+
+ /**
+ * @see org.infinispan.distexec.mapreduce.Reducer#reduce(java.lang.Object, java.util.Iterator)
+ */
+ @Override
+ public List<V> reduce(K reducedKey, Iterator<List<V>> iter)
+ {
+ List<V> values = new ArrayList<V>();
+ while (iter.hasNext())
+ {
+ List<V> vals = iter.next();
+ values.addAll(vals);
+ }
+ return values;
+ }
+ }
+
+ public static class ClearCacheMapper<K, V> extends AbstractExoCacheMapper<K, V, String, CacheKey<K>>
+ {
+
+ public ClearCacheMapper() {}
+
+ public ClearCacheMapper(String fullName)
+ {
+ super(fullName);
+ }
+
+
+ /**
+ * @see org.exoplatform.services.ispn.AbstractMapper#_map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ @Override
+ protected void _map(CacheKey<K> key, V value, Collector<String, CacheKey<K>> collector)
+ {
+ collector.emit("keys", key);
+ }
+
+ }
+
+ public static class ClearCacheReducer<K, V, KIn> implements Reducer<K, CacheKey<KIn>>
+ {
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = -8111087186325793256L;
+
+ /**
+ * @see org.infinispan.distexec.mapreduce.Reducer#reduce(java.lang.Object, java.util.Iterator)
+ */
+ @Override
+ public CacheKey<KIn> reduce(K reducedKey, Iterator<CacheKey<KIn>> iter)
+ {
+ CacheKey<KIn> firstKey;
+ if (iter == null || !iter.hasNext() || (firstKey = iter.next()) == null)
+ {
+ return null;
+ }
+ ExoContainer container = ExoContainerContext.getTopContainer();
+ if (container == null)
+ {
+ LOG.error("The top container could not be found");
+ return null;
+ }
+ DistributedCacheManager dcm = (DistributedCacheManager)container.getComponentInstanceOfType(DistributedCacheManager.class);
+ if (dcm == null)
+ {
+ LOG.error("The DistributedCacheManager could not be found at top container level, please configure it.");
+ return null;
+ }
+ Cache<CacheKey<K>, V> cache = dcm.getCache(CACHE_NAME);
+ final LockManager lm = cache.getAdvancedCache().getLockManager();
+ // Sort the keys to prevent deadlocks
+ Set<CacheKey<KIn>> keys = new TreeSet<CacheKey<KIn>>(new Comparator<CacheKey<KIn>>()
+ {
+ public int compare(CacheKey<KIn> o1, CacheKey<KIn> o2)
+ {
+ int result = lm.getLockId(o1) - lm.getLockId(o2);
+ return result == 0 ? System.identityHashCode(o1) - System.identityHashCode(o2) : result;
+ }
+ });
+ keys.add(firstKey);
+ while (iter.hasNext())
+ {
+ keys.add(iter.next());
+ }
+ for (CacheKey<KIn> key : keys)
+ {
+ cache.getAdvancedCache().withFlags(Flag.SKIP_REMOTE_LOOKUP, Flag.FAIL_SILENTLY).remove(key);
+ }
+ return null;
+ }
+ }
+
+ public static class GetEntriesMapper<K, V> extends AbstractExoCacheMapper<K, V, K, V>
+ {
+ public GetEntriesMapper() {}
+
+ public GetEntriesMapper(String fullName)
+ {
+ super(fullName);
+ }
+
+
+ /**
+ * @see org.exoplatform.services.ispn.AbstractMapper#_map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ @Override
+ protected void _map(CacheKey<K> key, V value, Collector<K, V> collector)
+ {
+ collector.emit(key.getKey(), value);
+ }
+ }
+
+ public static class GetEntriesReducer<K, V> implements Reducer<K, V>
+ {
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = 5153826700048219537L;
+
+ /**
+ * @see org.infinispan.distexec.mapreduce.Reducer#reduce(java.lang.Object, java.util.Iterator)
+ */
+ @Override
+ public V reduce(K reducedKey, Iterator<V> iter)
+ {
+ return iter == null || !iter.hasNext() ? null : iter.next();
+ }
+ }
+}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/generic/GenericExoCacheCreator.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/generic/GenericExoCacheCreator.java 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/cache/impl/infinispan/generic/GenericExoCacheCreator.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -152,11 +152,13 @@
cacheConfig.fluent().expiration().lifespan(period);
}
+ @Managed
public void setMaxIdle(long maxIdle)
{
cacheConfig.fluent().expiration().maxIdle(maxIdle);
}
+ @Managed
public void setWakeUpInterval(long wakeUpInterval)
{
cacheConfig.fluent().expiration().wakeUpInterval(wakeUpInterval);
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/AbstractMapper.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/AbstractMapper.java (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/AbstractMapper.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.ispn;
+
+import org.infinispan.distexec.mapreduce.Collector;
+import org.infinispan.distexec.mapreduce.Mapper;
+
+/**
+ * The main class of all the mappers.
+ *
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public abstract class AbstractMapper<KIn, VIn, KOut, VOut> implements Mapper<KIn, VIn, KOut, VOut>
+{
+
+ /**
+ * The serial version UID
+ */
+ private static final long serialVersionUID = 7118530772747505976L;
+
+ /**
+ * @see org.infinispan.distexec.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ @Override
+ public void map(KIn key, VIn value, Collector<KOut, VOut> collector)
+ {
+ if (isValid(key))
+ {
+ _map(key, value, collector);
+ }
+ }
+
+ /**
+ * This method is in fact an internal mapping
+ *
+ * @see org.infinispan.distexec.mapreduce.Mapper#map(java.lang.Object, java.lang.Object, org.infinispan.distexec.mapreduce.Collector)
+ */
+ protected abstract void _map(KIn key, VIn value, Collector<KOut, VOut> collector);
+
+ /**
+ * Indicates if the given key matches with the current context, indeed as the cache instances are
+ * shared it is needed to check each key to know if it is part of the targeted scope or not.
+ *
+ * @param key the key to check
+ * @return <code>true</code> if the key matches with the scope, <code>false</code> otherwise.
+ */
+ protected abstract boolean isValid(KIn key);
+
+}
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/DistributedCacheManager.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.ispn;
+
+import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.util.TemplateConfigurationHelper;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.Cache;
+import org.infinispan.manager.DefaultCacheManager;
+import org.infinispan.manager.EmbeddedCacheManager;
+import org.picocontainer.Startable;
+
+import java.security.PrivilegedExceptionAction;
+import java.util.Map;
+
+/**
+ * This class is used to allow to use infinispan in distribution mode with
+ * the ability to launch infinispan instances in standalone mode, in other
+ * words outside an application server. To make it possible we will need to share
+ * the same cache instance whatever the related {@link ExoContainer} because
+ * to be able to launch ispn instances in standalone mode we need to have a static
+ * configuration file.
+ *
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class DistributedCacheManager implements Startable
+{
+ /**
+ * The logger
+ */
+ private static final Log LOG = ExoLogger
+ .getLogger("exo.kernel.component.ext.cache.impl.infinispan.v5.DistributedCacheManager");
+
+ /**
+ * The parameter name corresponding to the infinispan configuration
+ */
+ private static final String CONFIG_FILE_PARAMETER_NAME = "infinispan-configuration";
+
+ /**
+ * The parameter name corresponding to the parameters to inject
+ * into the infinispan configuration file
+ */
+ private static final String PARAMS_PARAMETER_NAME = "parameters";
+
+ /**
+ * The infinispan cache manager
+ */
+ protected final EmbeddedCacheManager manager;
+
+ /**
+ * Default constructor
+ */
+ public DistributedCacheManager(String configurationFile, Map<String, String> parameters,
+ ConfigurationManager configManager)
+ {
+ this.manager = init(configurationFile, parameters, configManager);
+ }
+
+ /**
+ * Default constructor
+ */
+ public DistributedCacheManager(InitParams params, ConfigurationManager configManager)
+ {
+ ValueParam vp;
+ final String result;
+ if (params != null && (vp = params.getValueParam(CONFIG_FILE_PARAMETER_NAME)) != null
+ && (result = vp.getValue()) != null && !result.isEmpty())
+ {
+ PropertiesParam pp = params.getPropertiesParam(PARAMS_PARAMETER_NAME);
+ this.manager = init(result, pp == null ? null : pp.getProperties(), configManager);
+ }
+ else
+ {
+ throw new IllegalArgumentException("The parameter '" + CONFIG_FILE_PARAMETER_NAME + "' must be set");
+ }
+ }
+
+ /**
+ * Initializes and created the CacheManager
+ * @param configurationFile the path of the configuration file
+ * @param parameters the parameters to inject into the configuration file
+ * @param configManager the configuration manager used to get the configuration file
+ * @return the CacheManager initialized
+ */
+ private EmbeddedCacheManager init(final String configurationFile, final Map<String, String> parameters,
+ final ConfigurationManager configManager)
+ {
+ try
+ {
+ if (configurationFile == null || configurationFile.isEmpty())
+ {
+ throw new IllegalArgumentException("The parameter 'configurationFile' must be set");
+ }
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("The configuration file of the DistributedCacheManager will be loaded from " + configurationFile);
+ }
+ final TemplateConfigurationHelper helper =
+ new TemplateConfigurationHelper(new String[]{"^jgroups-configuration", "^infinispan-.*"},
+ new String[]{"^infinispan-configuration"}, configManager);
+ if (LOG.isDebugEnabled() && parameters != null && !parameters.isEmpty())
+ {
+ LOG.debug("The parameters to use while processing the configuration file are " + parameters);
+ }
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
+ {
+
+ @Override
+ public EmbeddedCacheManager run() throws Exception
+ {
+ EmbeddedCacheManager manager =
+ new DefaultCacheManager(helper.fillTemplate(configurationFile, parameters), false);
+ Utils.loadJGroupsConfig(configManager, manager.getGlobalConfiguration());
+ manager.start();
+ for (String cacheName : manager.getCacheNames())
+ {
+ manager.getCache(cacheName);
+ }
+ return manager;
+ }
+ });
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Could not initialize the cache manager corresponding to the configuration file "
+ + configurationFile, e);
+ }
+ }
+
+ /**
+ * Gives the cache corresponding to the given name if it doesn't exist
+ * a {@link NullPointerException} will be thrown
+ */
+ public <K, V> Cache<K, V> getCache(String cacheName)
+ {
+ Cache<K, V> cache = manager.getCache(cacheName, false);
+ if (cache == null)
+ {
+ throw new NullPointerException("The expected cache named '" + cacheName
+ + "' has not been defined in the configuration of infinispan as named cache.");
+ }
+ return cache;
+ }
+
+ /**
+ * @see org.picocontainer.Startable#start()
+ */
+ @Override
+ public void start()
+ {
+ }
+
+ /**
+ * @see org.picocontainer.Startable#stop()
+ */
+ @Override
+ public void stop()
+ {
+ manager.stop();
+ }
+}
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/Utils.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/Utils.java (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/java/org/exoplatform/services/ispn/Utils.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.ispn;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.util.TemplateConfigurationHelper;
+import org.exoplatform.services.cache.ExoCacheInitException;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.infinispan.config.GlobalConfiguration;
+import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class Utils
+{
+
+ /**
+ * The logger
+ */
+ private static final Log LOG = ExoLogger
+ .getLogger("exo.kernel.component.ext.cache.impl.infinispan.v5.Utils");
+
+ private Utils() {}
+
+
+ /**
+ * Load the JGroups configuration file thanks to the {@link ConfigurationManager}
+ * @param config the global configuration from which the JGroups config will be extracted
+ * @return <code>true</code> if the JGoups config could be loaded successfully,
+ * <code>false</code> if there were no JGroups config to load
+ * @throws IllegalStateException if the JGroups config could not be loaded
+ */
+ public static boolean loadJGroupsConfig(ConfigurationManager cfm, GlobalConfiguration config) throws ExoCacheInitException
+ {
+ Properties properties = config.getTransportProperties();
+ if (properties == null || !properties.containsKey(JGroupsTransport.CONFIGURATION_FILE))
+ {
+ return false;
+ }
+ String filename = properties.getProperty(JGroupsTransport.CONFIGURATION_FILE);
+ InputStream inputStream = TemplateConfigurationHelper.getInputStream(cfm, filename);
+
+ // inputStream still remains null, so file was not opened
+ if (inputStream == null)
+ {
+ throw new IllegalStateException("The jgroups configuration cannot be loaded from '" + filename
+ + "'");
+ }
+ try
+ {
+ // Set the jgroups configuration as XML
+ properties.setProperty(JGroupsTransport.CONFIGURATION_XML, readStream(inputStream));
+ }
+ catch (IOException e)
+ {
+ throw new IllegalStateException("The jgroups configuration cannot be read from '" + filename
+ + "'");
+ }
+ // Remove the property corresponding to the configuration file
+ properties.remove(JGroupsTransport.CONFIGURATION_FILE);
+ return true;
+ }
+
+
+ /**
+ * Reads bytes from input stream and builds a string from them
+ *
+ * @param inputStream
+ * @return
+ * @throws IOException
+ */
+ private static String readStream(InputStream inputStream) throws IOException
+ {
+ StringBuilder out = new StringBuilder(4096);
+ byte[] b = new byte[4096];
+ try
+ {
+ for (int length; (length = inputStream.read(b)) != -1;)
+ {
+ out.append(new String(b, 0, length));
+ }
+ }
+ finally
+ {
+ try
+ {
+ inputStream.close();
+ }
+ catch (Exception e)
+ {
+ LOG.debug("Cannot close stream", e);
+ }
+ }
+ return out.toString();
+ }
+}
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/main/resources/conf/portal/cache-configuration-template.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -19,8 +19,8 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
<global>
<asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
@@ -47,14 +47,14 @@
<globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
<transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="eXoCache-cluster" distributedSyncTimeout="20000">
<properties>
- <property name="configurationFile" value="flush-udp.xml"/>
+ <property name="configurationFile" value="udp.xml"/>
</properties>
</transport>
<shutdown hookBehavior="DEFAULT"/>
</global>
<default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" writeSkewCheck="false" concurrencyLevel="500"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="false" syncCommitPhase="false"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="true"/>
<invocationBatching enabled="true"/>
<clustering mode="replication">
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/TestAbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/TestAbstractExoCache.java 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/TestAbstractExoCache.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -549,13 +549,13 @@
config.setMaxSize(5);
config.setLiveTime(1);
config.setImplementation("LRU");
- config.setDistributed(true);
+ config.setReplicated(true);
ExoCacheConfig config2 = new ExoCacheConfig();
config2.setName("MyCacheDistributed2");
config2.setMaxSize(5);
config2.setLiveTime(1);
config2.setImplementation("LRU");
- config2.setDistributed(true);
+ config2.setReplicated(true);
AbstractExoCache<Serializable, Object> cache1 =
(AbstractExoCache<Serializable, Object>)getExoCacheFactoryInstance().createCache(config);
MyCacheListener listener1 = new MyCacheListener();
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/java/org/exoplatform/services/cache/impl/infinispan/distributed/TestDistributedExoCache.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,701 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.services.cache.impl.infinispan.distributed;
+
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.services.cache.CacheListener;
+import org.exoplatform.services.cache.CacheListenerContext;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.CachedObjectSelector;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.cache.ExoCacheConfig;
+import org.exoplatform.services.cache.ExoCacheFactory;
+import org.exoplatform.services.cache.ObjectCacheInfo;
+import org.exoplatform.services.cache.impl.infinispan.ExoCacheFactoryImpl;
+import org.exoplatform.services.ispn.DistributedCacheManager;
+import org.exoplatform.test.BasicTestCase;
+import org.infinispan.distribution.DistributionManager;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class TestDistributedExoCache extends BasicTestCase
+{
+
+ CacheService service;
+
+ DistributedExoCache<Serializable, Object> cache;
+
+ DistributedExoCache<Serializable, Object> cache2;
+
+ public TestDistributedExoCache(String name)
+ {
+ super(name);
+ }
+
+ public void setUp() throws Exception
+ {
+ this.service = (CacheService)PortalContainer.getInstance().getComponentInstanceOfType(CacheService.class);
+ this.cache = (DistributedExoCache<Serializable, Object>)service.getCacheInstance("cache-distributed");
+ this.cache2 = (DistributedExoCache<Serializable, Object>)service.getCacheInstance("cache-distributed2");
+ cache2.put(new MyKey("a"), "a");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ cache.clearCache();
+ cache2.clearCache();
+ }
+
+ public void testPut() throws Exception
+ {
+ cache.put(new MyKey("a"), "a");
+ cache.put(new MyKey("b"), "b");
+ cache.put(new MyKey("c"), "c");
+ assertEquals(3, cache.getCacheSize());
+ cache.put(new MyKey("a"), "c");
+ assertEquals(3, cache.getCacheSize());
+ cache.put(new MyKey("d"), "c");
+ assertEquals(4, cache.getCacheSize());
+ }
+
+ public void testClearCache() throws Exception
+ {
+ cache.put(new MyKey("a"), "a");
+ cache.put(new MyKey("b"), "b");
+ cache.put(new MyKey("c"), "c");
+ assertTrue(cache.getCacheSize() > 0);
+ cache.clearCache();
+ assertTrue(cache.getCacheSize() == 0);
+ }
+
+ public void testGet() throws Exception
+ {
+ cache.put(new MyKey("a"), "a");
+ assertEquals("a", cache.get(new MyKey("a")));
+ cache.put(new MyKey("a"), "c");
+ assertEquals("c", cache.get(new MyKey("a")));
+ cache.remove(new MyKey("a"));
+ assertEquals(null, cache.get(new MyKey("a")));
+ assertEquals(null, cache.get(new MyKey("x")));
+ }
+
+ public void testRemove() throws Exception
+ {
+ cache.put(new MyKey("a"), 1);
+ cache.put(new MyKey("b"), 2);
+ cache.put(new MyKey("c"), 3);
+ assertEquals(3, cache.getCacheSize());
+ assertEquals(1, cache.remove(new MyKey("a")));
+ assertEquals(2, cache.getCacheSize());
+ assertEquals(2, cache.remove(new MyKey("b")));
+ assertEquals(1, cache.getCacheSize());
+ assertEquals(null, cache.remove(new MyKey("x")));
+ assertEquals(1, cache.getCacheSize());
+ }
+
+ public void testPutMap() throws Exception
+ {
+ Map<Serializable, Object> values = new HashMap<Serializable, Object>();
+ values.put(new MyKey("a"), "a");
+ values.put(new MyKey("b"), "b");
+ assertEquals(0, cache.getCacheSize());
+ cache.putMap(values);
+ assertEquals(2, cache.getCacheSize());
+ values = new HashMap<Serializable, Object>()
+ {
+ private static final long serialVersionUID = 1L;
+
+ public Set<Entry<Serializable, Object>> entrySet()
+ {
+ Set<Entry<Serializable, Object>> set = new LinkedHashSet<Entry<Serializable, Object>>(super.entrySet());
+ set.add(new Entry<Serializable, Object>()
+ {
+
+ public Object setValue(Object paramV)
+ {
+ return null;
+ }
+
+ public Object getValue()
+ {
+ throw new RuntimeException("An exception");
+ }
+
+ public Serializable getKey()
+ {
+ return "c";
+ }
+ });
+ return set;
+ }
+ };
+ values.put(new MyKey("e"), "e");
+ values.put(new MyKey("d"), "d");
+ cache.putMap(values);
+ assertEquals(2, cache.getCacheSize());
+ }
+
+ public void testGetCachedObjects() throws Exception
+ {
+ cache.put(new MyKey("a"), "a");
+ cache.put(new MyKey("b"), "b");
+ cache.put(new MyKey("c"), "c");
+ cache.put(new MyKey("d"), null);
+ assertEquals(3, cache.getCacheSize());
+ List<Object> values = cache.getCachedObjects();
+ assertEquals(3, values.size());
+ assertTrue(values.contains("a"));
+ assertTrue(values.contains("b"));
+ assertTrue(values.contains("c"));
+ }
+
+ public void testRemoveCachedObjects() throws Exception
+ {
+ cache.put(new MyKey("a"), "a");
+ cache.put(new MyKey("b"), "b");
+ cache.put(new MyKey("c"), "c");
+ cache.put(new MyKey("d"), null);
+ assertEquals(3, cache.getCacheSize());
+ List<Object> values = cache.removeCachedObjects();
+ assertEquals(3, values.size());
+ assertTrue(values.contains("a"));
+ assertTrue(values.contains("b"));
+ assertTrue(values.contains("c"));
+ assertEquals(0, cache.getCacheSize());
+ }
+
+ public void testSelect() throws Exception
+ {
+ cache.put(new MyKey("a"), 1);
+ cache.put(new MyKey("b"), 2);
+ cache.put(new MyKey("c"), 3);
+ final AtomicInteger count = new AtomicInteger();
+ CachedObjectSelector<Serializable, Object> selector = new CachedObjectSelector<Serializable, Object>()
+ {
+
+ public void onSelect(ExoCache<? extends Serializable, ? extends Object> cache, Serializable key,
+ ObjectCacheInfo<? extends Object> ocinfo) throws Exception
+ {
+ assertTrue(key.equals(new MyKey("a")) || key.equals(new MyKey("b")) || key.equals(new MyKey("c")));
+ assertTrue(ocinfo.get().equals(1) || ocinfo.get().equals(2) || ocinfo.get().equals(3));
+ count.incrementAndGet();
+ }
+
+ public boolean select(Serializable key, ObjectCacheInfo<? extends Object> ocinfo)
+ {
+ return true;
+ }
+ };
+ cache.select(selector);
+ assertEquals(3, count.intValue());
+ }
+
+ public void testGetHitsNMisses() throws Exception
+ {
+ int hits = cache.getCacheHit();
+ int misses = cache.getCacheMiss();
+ cache.put(new MyKey("a"), "a");
+ cache.get(new MyKey("a"));
+ cache.remove(new MyKey("a"));
+ cache.get(new MyKey("a"));
+ cache.get(new MyKey("z"));
+ assertEquals(1, cache.getCacheHit() - hits);
+ assertEquals(2, cache.getCacheMiss() - misses);
+ }
+
+ public void testMultiThreading() throws Exception
+ {
+ long time = System.currentTimeMillis();
+ final int totalElement = 100;
+ final int totalTimes = 20;
+ int reader = 20;
+ int writer = 10;
+ int remover = 5;
+ int cleaner = 1;
+ final CountDownLatch startSignalWriter = new CountDownLatch(1);
+ final CountDownLatch startSignalOthers = new CountDownLatch(1);
+ final CountDownLatch doneSignal = new CountDownLatch(reader + writer + remover);
+ final List<Exception> errors = Collections.synchronizedList(new ArrayList<Exception>());
+ for (int i = 0; i < writer; i++)
+ {
+ final int index = i;
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignalWriter.await();
+ for (int j = 0; j < totalTimes; j++)
+ {
+ for (int i = 0; i < totalElement; i++)
+ {
+ cache.put(new MyKey("key" + i), "value" + i);
+ }
+ if (index == 0 && j == 0)
+ {
+ // The cache is full, we can launch the others
+ startSignalOthers.countDown();
+ }
+ sleep(50);
+ }
+ }
+ catch (Exception e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ startSignalWriter.countDown();
+ for (int i = 0; i < reader; i++)
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignalOthers.await();
+ for (int j = 0; j < totalTimes; j++)
+ {
+ for (int i = 0; i < totalElement; i++)
+ {
+ cache.get(new MyKey("key" + i));
+ }
+ sleep(50);
+ }
+ }
+ catch (Exception e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ for (int i = 0; i < remover; i++)
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignalOthers.await();
+ for (int j = 0; j < totalTimes; j++)
+ {
+ for (int i = 0; i < totalElement; i++)
+ {
+ cache.remove(new MyKey("key" + i));
+ }
+ sleep(50);
+ }
+ }
+ catch (Exception e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ doneSignal.await();
+ for (int i = 0; i < totalElement; i++)
+ {
+ cache.put(new MyKey("key" + i), "value" + i);
+ }
+ assertEquals(totalElement, cache.getCacheSize());
+ final CountDownLatch startSignal = new CountDownLatch(1);
+ final CountDownLatch doneSignal2 = new CountDownLatch(writer + cleaner);
+ for (int i = 0; i < writer; i++)
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ for (int j = 0; j < totalTimes; j++)
+ {
+ for (int i = 0; i < totalElement; i++)
+ {
+ cache.put(new MyKey("key" + i), "value" + i);
+ }
+ sleep(50);
+ }
+ }
+ catch (Exception e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal2.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ for (int i = 0; i < cleaner; i++)
+ {
+ Thread thread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ for (int j = 0; j < totalTimes; j++)
+ {
+ sleep(150);
+ cache.clearCache();
+ }
+ }
+ catch (Exception e)
+ {
+ errors.add(e);
+ }
+ finally
+ {
+ doneSignal2.countDown();
+ }
+ }
+ };
+ thread.start();
+ }
+ cache.clearCache();
+ assertEquals(0, cache.getCacheSize());
+ if (!errors.isEmpty())
+ {
+ for (Exception e : errors)
+ {
+ e.printStackTrace();
+ }
+ throw errors.get(0);
+ }
+ System.out.println("Total Time = " + (System.currentTimeMillis() - time));
+ }
+
+ public static class MyCacheListener implements CacheListener<Serializable, Object>
+ {
+
+ public int clearCache;
+
+ public int expire;
+
+ public int get;
+
+ public int put;
+
+ public int remove;
+
+ public void onClearCache(CacheListenerContext context) throws Exception
+ {
+ clearCache++;
+ }
+
+ public void onExpire(CacheListenerContext context, Serializable key, Object obj) throws Exception
+ {
+ expire++;
+ }
+
+ public void onGet(CacheListenerContext context, Serializable key, Object obj) throws Exception
+ {
+ get++;
+ }
+
+ public void onPut(CacheListenerContext context, Serializable key, Object obj) throws Exception
+ {
+ put++;
+ }
+
+ public void onRemove(CacheListenerContext context, Serializable key, Object obj) throws Exception
+ {
+ remove++;
+ }
+ }
+
+ public static class MyKey implements Serializable
+ {
+ private static final long serialVersionUID = 1L;
+
+ public String value;
+ public MyKey(){}
+ public MyKey(String value)
+ {
+ this.value = value;
+ }
+
+ @Override
+ public boolean equals(Object paramObject)
+ {
+ return paramObject instanceof MyKey && ((MyKey)paramObject).value.endsWith(value);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return value;
+ }
+ }
+
+ public void testDistributedCache() throws Exception
+ {
+ PortalContainer pc = PortalContainer.getInstance();
+ System.out
+ .println("WARNING: For Linux distributions the following JVM parameter must be set to true, java.net.preferIPv4Stack = "
+ + System.getProperty("java.net.preferIPv4Stack"));
+ ExoCacheConfig config = new ExoCacheConfig();
+ config.setName("MyCacheDistributed");
+ config.setMaxSize(5);
+ config.setLiveTime(1);
+ config.setImplementation("LRU");
+ config.setDistributed(true);
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("infinispan-num-owners", "1");
+ ConfigurationManager cm = (ConfigurationManager)pc.getComponentInstanceOfType(ConfigurationManager.class);
+ DistributedCacheManager dcm2 =
+ new DistributedCacheManager("jar:/conf/portal/distributed-cache-configuration.xml", params, cm);
+
+ @SuppressWarnings("unchecked")
+ DistributedExoCache<Serializable, Object> cache1 =
+ (DistributedExoCache<Serializable, Object>)((ExoCacheFactory)pc
+ .getComponentInstanceOfType(ExoCacheFactory.class)).createCache(config);
+ DistributionManager dm = cache1.getCache().getDistributionManager();
+ MyCacheListener listener1 = new MyCacheListener();
+ cache1.addCacheListener(listener1);
+ DistributedExoCache<Serializable, Object> cache2 =
+ (DistributedExoCache<Serializable, Object>)new ExoCacheFactoryImpl(
+ (ExoContainerContext)pc.getComponentInstanceOfType(ExoContainerContext.class),
+ "jar:/conf/portal/cache-configuration-template.xml", cm, dcm2).createCache(config);
+ MyCacheListener listener2 = new MyCacheListener();
+ cache2.addCacheListener(listener2);
+ try
+ {
+ MyKey key;
+ cache1.put(key = new MyKey("a"), "b");
+ assertEquals(1, cache1.getCacheSize());
+ assertEquals("b", cache2.get(new MyKey("a")));
+ assertEquals(1, cache2.getCacheSize());
+
+// int put1 = 1;
+// int put2 = dm.getLocality(key).isLocal() ? 0 : 1;
+//
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(0, listener1.get);
+ assertEquals(1, listener2.get);
+
+ MyKey key2;
+ cache2.put(key2 = new MyKey("b"), "c");
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+ assertEquals("c", cache1.get(new MyKey("b")));
+
+// put1 += dm.getLocality(key2).isLocal() ? 1 : 0;
+// put2++;
+//
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(1, listener1.get);
+ assertEquals(1, listener2.get);
+
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(1, listener1.get);
+ assertEquals(1, listener2.get);
+
+ cache2.put(key = new MyKey("a"), "a");
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+ assertEquals("a", cache1.get(new MyKey("a")));
+
+// put1 += dm.getLocality(key).isLocal() ? 1 : 0;
+// put2++;
+//
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(2, listener1.get);
+ assertEquals(1, listener2.get);
+
+ cache2.remove(key = new MyKey("a"));
+ assertEquals(1, cache1.getCacheSize());
+ assertEquals(1, cache2.getCacheSize());
+
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(2, listener1.get);
+ assertEquals(1, listener2.get);
+
+// int remove1 = dm.getLocality(key).isLocal() ? 1 : 0;
+// int remove2 = 1;
+//
+// assertEquals(remove1, listener1.remove);
+// assertEquals(remove2, listener2.remove);
+
+ cache1.put(key = new MyKey("c"), "c");
+ cache1.clearCache();
+ assertEquals(0, cache1.getCacheSize());
+ assertNull(cache1.get(new MyKey("b")));
+ assertNull(cache2.get(new MyKey("b")));
+ assertNull(cache2.get(new MyKey("c")));
+ assertEquals(0, cache2.getCacheSize());
+
+// put1++;
+// put2 += dm.getLocality(key).isLocal() ? 0 : 1;
+
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(3, listener1.get);
+ assertEquals(3, listener2.get);
+
+// assertEquals(remove1, listener1.remove);
+// assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ Map<Serializable, Object> values = new HashMap<Serializable, Object>();
+ values.put(key = new MyKey("a"), "a");
+ values.put(key2 = new MyKey("b"), "b");
+ cache1.putMap(values);
+ assertEquals(2, cache1.getCacheSize());
+ Thread.sleep(40);
+ assertEquals("a", cache2.get(new MyKey("a")));
+ assertEquals("b", cache2.get(new MyKey("b")));
+ assertEquals(2, cache2.getCacheSize());
+
+// put1 += 2;
+// put2 += (dm.getLocality(key).isLocal() ? 0 : 1) + (dm.getLocality(key2).isLocal() ? 0 : 1);
+//
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(3, listener1.get);
+ assertEquals(5, listener2.get);
+
+// assertEquals(remove1, listener1.remove);
+// assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ values = new HashMap<Serializable, Object>()
+ {
+ private static final long serialVersionUID = 1L;
+
+ public Set<Entry<Serializable, Object>> entrySet()
+ {
+ Set<Entry<Serializable, Object>> set = new LinkedHashSet<Entry<Serializable, Object>>(super.entrySet());
+ set.add(new Entry<Serializable, Object>()
+ {
+
+ public Object setValue(Object paramV)
+ {
+ return null;
+ }
+
+ public Object getValue()
+ {
+ throw new RuntimeException("An exception");
+ }
+
+ public Serializable getKey()
+ {
+ return "c";
+ }
+ });
+ return set;
+ }
+ };
+ values.put(new MyKey("e"), "e");
+ values.put(new MyKey("d"), "d");
+ cache1.putMap(values);
+ assertEquals(2, cache1.getCacheSize());
+ assertEquals(2, cache2.getCacheSize());
+
+// assertEquals(put1, listener1.put);
+// assertEquals(put2, listener2.put);
+
+ assertEquals(3, listener1.get);
+ assertEquals(5, listener2.get);
+
+// assertEquals(remove1, listener1.remove);
+// assertEquals(remove2, listener2.remove);
+
+ assertEquals(1, listener1.clearCache);
+ assertEquals(0, listener2.clearCache);
+
+ assertEquals(0, listener1.expire);
+ assertEquals(0, listener2.expire);
+
+ }
+ finally
+ {
+ dcm2.stop();
+ }
+ }
+}
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/configuration.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/configuration.xml (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/configuration.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.services.ispn.DistributedCacheManager</type>
+ <init-params>
+ <value-param>
+ <name>infinispan-configuration</name>
+ <value>jar:/conf/portal/distributed-cache-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>parameters</name>
+ <description>The parameters of the configuration</description>
+ <property name="infinispan-num-owners" value="1"></property>
+ </properties-param>
+ </init-params>
+ </component>
+</configuration>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/cache-configuration-template.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -19,8 +19,8 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
<global>
<asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
@@ -47,14 +47,14 @@
<globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true" />
<transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="Infinispan-cluster" distributedSyncTimeout="20000">
<properties>
- <property name="configurationFile" value="flush-udp.xml"/>
+ <property name="configurationFile" value="udp.xml"/>
</properties>
</transport>
<shutdown hookBehavior="DEFAULT"/>
</global>
<default>
<locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="10000" writeSkewCheck="false" concurrencyLevel="500"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="false" syncCommitPhase="false"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="true"/>
<clustering mode="replication">
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration-template.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -19,8 +19,8 @@
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
- xmlns="urn:infinispan:config:5.0">
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
<global>
<asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
<properties>
@@ -47,14 +47,14 @@
<globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
<transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="Infinispan-cluster" distributedSyncTimeout="20000">
<properties>
- <property name="configurationFile" value="flush-udp.xml"/>
+ <property name="configurationFile" value="udp.xml"/>
</properties>
</transport>
<shutdown hookBehavior="DEFAULT"/>
</global>
<default>
- <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500"/>
- <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="false" syncCommitPhase="false"/>
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="true"/>
<clustering mode="replication">
<stateRetrieval timeout="20000" fetchInMemoryState="false"/>
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/distributed-cache-configuration.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2010 eXo Platform SAS.
+
+ 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.
+
+-->
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+ <global>
+ <asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <properties>
+ <property name="maxThreads" value="1"/>
+ <property name="queueSize" value="100000"/>
+ <property name="threadNamePrefix" value="AsyncListenerThread"/>
+ </properties>
+ </asyncListenerExecutor>
+ <asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="AsyncSerializationThread"/>
+ </properties>
+ </asyncTransportExecutor>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+ <replicationQueueScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="ReplicationQueueThread"/>
+ </properties>
+ </replicationQueueScheduledExecutor>
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="Infinispan-cluster" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="udp.xml"/>
+ </properties>
+ </transport>
+ <shutdown hookBehavior="DEFAULT"/>
+ </global>
+ <namedCache name="eXoCache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="20000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true"/>
+ <jmxStatistics enabled="true"/>
+ <clustering mode="distribution">
+ <l1 enabled="false"/>
+ <hash numOwners="${infinispan-num-owners}" rehashRpcTimeout="120000" />
+ <sync/>
+ </clustering>
+ <invocationBatching enabled="true"/>
+ </namedCache>
+</infinispan>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/test-configuration.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/test-configuration.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/conf/portal/test-configuration.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -37,6 +37,25 @@
</object>
</object-param>
<object-param>
+ <name>cache-distributed</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>cache-distributed</string></field>
+ <field name="maxSize"><int>5</int></field>
+ <field name="liveTime"><long>2</long></field>
+ <field name="distributed"><boolean>true</boolean></field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>cache-distributed2</name>
+ <description>The default cache configuration</description>
+ <object type="org.exoplatform.services.cache.ExoCacheConfig">
+ <field name="name"><string>cache-distributed2</string></field>
+ <field name="maxSize"><int>5</int></field>
+ <field name="liveTime"><long>2</long></field>
+ <field name="distributed"><boolean>true</boolean></field>
+ </object>
+ </object-param> <object-param>
<name>test-multi-threading</name>
<description>The default cache configuration</description>
<object type="org.exoplatform.services.cache.impl.infinispan.generic.GenericExoCacheConfig">
@@ -53,7 +72,7 @@
<field name="name"><string>cacheDistributed</string></field>
<field name="maxSize"><int>5</int></field>
<field name="liveTime"><long>2</long></field>
- <field name="distributed"><boolean>true</boolean></field>
+ <field name="replicated"><boolean>true</boolean></field>
</object>
</object-param>
<object-param>
@@ -148,7 +167,6 @@
<!-- </object-param> -->
</init-params>
</component>
-
<component>
<key>org.exoplatform.services.cache.ExoCacheFactory</key>
<type>org.exoplatform.services.cache.impl.infinispan.ExoCacheFactoryImpl</type>
@@ -158,7 +176,7 @@
<value>jar:/conf/portal/cache-configuration-template.xml</value>
</value-param>
</init-params>
- </component>
+ </component>
<external-component-plugins>
<target-component>org.exoplatform.services.cache.ExoCacheFactory</target-component>
@@ -205,6 +223,9 @@
<string>LRU</string>
</value>
<value>
+ <string>LRU_OLD</string>
+ </value>
+ <value>
<string>UNORDERED</string>
</value>
<value>
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/test.policy
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/test.policy (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/test.policy 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,26 @@
+grant codeBase "@MAVEN_REPO@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@TEST_CLASSES@-"{
+};
+
+grant codeBase "@MAIN_CLASSES@../../../exo.kernel.commons.test/-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@../../../exo.kernel.commons/-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@../../../exo.kernel.container/-"{
+ permission java.security.AllPermission;
+};
+
+grant codeBase "@MAIN_CLASSES@../../../exo.kernel.component.cache/-"{
+ permission java.security.AllPermission;
+};
Added: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/tsm-excludes.properties
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/tsm-excludes.properties (rev 0)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v5/src/test/resources/tsm-excludes.properties 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1 @@
+org.exoplatform.services.cache.impl.infinispan.distributed.TestDistributedExoCache.testDistributedCache=stop
\ No newline at end of file
Copied: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java (from rev 5271, jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java)
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/util/TemplateConfigurationHelper.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.container.util;
+
+import org.exoplatform.commons.utils.PrivilegedFileHelper;
+import org.exoplatform.container.configuration.ConfigurationManager;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+/**
+ * Builds configuration from template using map of template-variables <--> value.
+ * Class provides extra functionality for filtering parameters by pattern, excluding
+ * unnecessary parameters.
+ *
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: TemplateConfigurationHelper.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class TemplateConfigurationHelper
+{
+ // list with include-patterns
+ private List<Pattern> includes = new ArrayList<Pattern>();
+
+ // list with exclude-patterns
+ private List<Pattern> excludes = new ArrayList<Pattern>();
+
+ private ConfigurationManager cfm;
+
+ /**
+ * Creates instance of template configuration helper with given lists of filtering
+ * patterns. Parameter will be included only if it matches any include-pattern and
+ * doesn't match any exclude-pattern. I.e. You can include "extended-*" and exclude
+ * "extended-type". Please refer to Java regexp documentation. Filtering for this
+ * example, should be defined as following:
+ * include: "^extended-.*"
+ * exclude: "^extended-type"
+ *
+ * @param includes Array with string representation of include reg-exp patterns
+ * @param excludes Array with string representation of exclude reg-exp patterns
+ * @param ConfigurationManager instance for looking up resources
+ */
+ public TemplateConfigurationHelper(String[] includes, String[] excludes, ConfigurationManager cfm)
+ {
+ super();
+ this.cfm = cfm;
+ // compile include patterns
+ for (String regex : includes)
+ {
+ this.includes.add(Pattern.compile(regex));
+ }
+ // compile exclude patterns
+ for (String regex : excludes)
+ {
+ this.excludes.add(Pattern.compile(regex));
+ }
+ }
+
+ /**
+ * Reads configuration file from a stream and replaces all the occurrences of template-variables
+ * (like : "${parameter.name}") with values provided in the map.
+ *
+ * @param inputStream
+ * @param parameters
+ * @return
+ * @throws IOException
+ */
+ public InputStream fillTemplate(InputStream inputStream, Map<String, String> parameters) throws IOException
+ {
+ if (inputStream == null || parameters == null || parameters.size() == 0)
+ {
+ return inputStream;
+ }
+ // parameters filtering
+ Map<String, String> preparedParams = prepareParameters(parameters);
+ // read stream
+ String configuration = readStream(inputStream);
+ for (Entry<String, String> entry : preparedParams.entrySet())
+ {
+ configuration = configuration.replace(entry.getKey(), entry.getValue());
+ }
+ // create new stream
+ InputStream configurationStream = new ByteArrayInputStream(configuration.getBytes());
+ return configurationStream;
+ }
+
+ /**
+ * Reads configuration file from a stream and replaces all the occurrences of template-variables
+ * (like : "${parameter.name}") with values provided in the map.
+ *
+ * @param filename
+ * @param parameters
+ * @return
+ * @throws IOException
+ */
+ public InputStream fillTemplate(String filename, Map<String, String> parameters) throws IOException
+ {
+ InputStream inputStream = getInputStream(cfm, filename);
+ // inputStream still remains null, so file was not opened
+ if (inputStream == null)
+ {
+ throw new IOException("Can't find or open file:" + filename);
+ }
+ return fillTemplate(inputStream, parameters);
+ }
+
+ /**
+ * Tries first to get the file content using the configuration manager, if it cannot
+ * be found it will then try to get it from the context class loader of the current thread,
+ * if it cannot be found it will try to get it from the class loader of the current class and
+ * finally it still cannot be found it will try to use the file name as a file path.
+ * @param cfm the configuration manager from which we want to try to find the file content
+ * @param filename the name of the file to found
+ * @return the {@link InputStream} corresponding to the file content if it can be found
+ * <code>null</code> otherwise
+ */
+ public static InputStream getInputStream(ConfigurationManager cfm, String filename)
+ {
+ InputStream inputStream = null;
+ // try to get using configuration manager
+ try
+ {
+ inputStream = cfm.getInputStream(filename);
+ }
+ catch (Exception e)
+ {
+ // will try to use another resolve mechanism
+ }
+
+ // try to get resource by class loader
+ if (inputStream == null)
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ inputStream = cl == null ? null : cl.getResourceAsStream(filename);
+ }
+
+ // check system class loader
+ if (inputStream == null)
+ {
+ inputStream = TemplateConfigurationHelper.class.getClassLoader().getResourceAsStream(filename);
+ }
+
+ // try to get as file stream
+ if (inputStream == null)
+ {
+ try
+ {
+ inputStream = PrivilegedFileHelper.fileInputStream(filename);
+ }
+ catch (IOException e)
+ {
+ // Still can't resolve
+ }
+ }
+ return inputStream;
+ }
+
+ /**
+ * Checks if String mathes to any pattern from the list
+ *
+ * @param patterns
+ * @param parameter
+ * @return
+ */
+ private boolean matches(List<Pattern> patterns, String parameter)
+ {
+ for (Pattern pattern : patterns)
+ {
+ if (pattern.matcher(parameter).matches())
+ {
+ // string matched
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Filters the map of parameters, leaving only those than matches filtering regular expressions.
+ * Also adds "${}" to the parameter key: <br>
+ * I.e. such map provided on input:
+ *
+ * "jbosscache-cache.loader":"org.exoplatform"
+ * "jbosscache-configuration":"/conf/test.xml"
+ * "max-volatile-size":"100Kb"
+ *
+ * the output will be like:
+ *
+ * "${jbosscache-cache.loader}":"org.exoplatform"
+ *
+ * Other will be ignored (depending on includes/excludes lists provided in constructor).
+ *
+ * @param parameters
+ * @return
+ */
+ protected Map<String, String> prepareParameters(Map<String, String> parameters)
+ {
+ Map<String, String> map = new HashMap<String, String>();
+ for (Entry<String, String> entry : parameters.entrySet())
+ {
+ if (matches(includes, entry.getKey()) && !matches(excludes, entry.getKey()))
+ {
+ map.put("${" + entry.getKey() + "}", entry.getValue());
+ }
+ }
+ return map;
+ }
+
+ /**
+ * Reads bytes from input stream and builds a string from them
+ *
+ * @param inputStream
+ * @return
+ * @throws IOException
+ */
+ protected String readStream(InputStream inputStream) throws IOException
+ {
+ StringBuffer out = new StringBuffer();
+ byte[] b = new byte[4096];
+ for (int n; (n = inputStream.read(b)) != -1;)
+ {
+ out.append(new String(b, 0, n));
+ }
+ return out.toString();
+ }
+}
Copied: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/util/TestTemplateConfigurationHelper.java (from rev 5271, jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java)
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/util/TestTemplateConfigurationHelper.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/util/TestTemplateConfigurationHelper.java 2011-12-15 16:30:03 UTC (rev 5331)
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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 org.exoplatform.container.util;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.configuration.ConfigurationManagerImpl;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: TestTemplateHelper.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class TestTemplateConfigurationHelper extends TestCase
+{
+
+ public void testFilters()
+ {
+ // create helper with predefined include and exclude patterns
+ TemplateConfigurationHelper helper =
+ new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
+ new String[]{"^jbosscache-configuration"}, new ConfigurationManagerImpl());
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("jbosscache-configuration", "");
+ parameters.put("jbosscache-cache.loader", "");
+ parameters.put("jbosscache-clustername", "");
+ parameters.put("max-volatile-size", "");
+ Map<String, String> preparedParameters = helper.prepareParameters(parameters);
+ assertEquals(2, preparedParameters.size());
+ // "jbosscache-configuration" and "max-volatile-size" should be excluded
+ assertFalse(preparedParameters.containsKey("${jbosscache-configuration}"));
+ assertFalse(preparedParameters.containsKey("${max-volatile-size}"));
+ assertTrue(preparedParameters.containsKey("${jbosscache-cache.loader}"));
+ assertTrue(preparedParameters.containsKey("${jbosscache-clustername}"));
+ }
+
+ public void testFilters2()
+ {
+ // create helper with predefined include and exclude patterns
+ TemplateConfigurationHelper helper =
+ new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
+ new String[]{"^jbosscache-configuration"}, new ConfigurationManagerImpl());
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("jgroups-configuration", "");
+ parameters.put("jbosscache-cache.loader", "");
+ parameters.put("jbosscache-clustername", "");
+ parameters.put("max-volatile-size", "");
+ Map<String, String> preparedParameters = helper.prepareParameters(parameters);
+ assertEquals(3, preparedParameters.size());
+ // "jbosscache-configuration" and "max-volatile-size" should be excluded
+ assertFalse(preparedParameters.containsKey("${max-volatile-size}"));
+ assertTrue(preparedParameters.containsKey("${jbosscache-cache.loader}"));
+ assertTrue(preparedParameters.containsKey("${jbosscache-clustername}"));
+ }
+
+ public void testTemplating() throws IOException
+ {
+ TemplateConfigurationHelper helper =
+ new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
+ new String[]{"^jbosscache-configuration"}, new ConfigurationManagerImpl());
+ String template = "configuration in any format, containing ${jbosscache-template-variable} and many others";
+ String expectedConfig = "configuration in any format, containing pretty good parameter and many others";
+
+ InputStream templateStream = new ByteArrayInputStream(template.getBytes());
+
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("jbosscache-template-variable", "pretty good parameter");
+
+ InputStream configStream = helper.fillTemplate(templateStream, parameters);
+ String config = readStream(configStream);
+ assertTrue(expectedConfig.equals(config));
+ }
+
+ private String readStream(InputStream inputStream) throws IOException
+ {
+ StringBuffer out = new StringBuffer();
+ byte[] b = new byte[4096];
+ for (int n; (n = inputStream.read(b)) != -1;)
+ {
+ out.append(new String(b, 0, n));
+ }
+ return out.toString();
+ }
+}
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2011-12-15 15:26:48 UTC (rev 5330)
+++ kernel/trunk/pom.xml 2011-12-15 16:30:03 UTC (rev 5331)
@@ -213,7 +213,7 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
- <version>5.0.1.FINAL</version>
+ <version>5.1.0.CR1</version>
</dependency>
<dependency>
<groupId>org.jibx</groupId>
12 years, 5 months
exo-jcr SVN: r5330 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-12-15 10:26:48 -0500 (Thu, 15 Dec 2011)
New Revision: 5330
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml
Log:
EXOJCR-1684: Include documentation about references in external configuration
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml 2011-12-14 08:34:53 UTC (rev 5329)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml 2011-12-15 15:26:48 UTC (rev 5330)
@@ -608,53 +608,14 @@
<section>
<title>Import</title>
- <para>The import tag allows to link to other configuration files. These
- imported files can be placed anywhere. If you write a default
- configuration which is part of your jar file you should not import files
- from outside your jar.</para>
+ <para>The import tag allows to import other configuration files using URLs
+ that are configuration manager specific, for more details about what are
+ the supported URLs please refer to the next section about the
+ configuration manager.</para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">war</emphasis>: Imports from <emphasis
- role="bold">portal.war/WEB-INF</emphasis></para>
- </listitem>
+ <para>See below an example of a configuration file composed of
+ imports:</para>
- <listitem>
- <para><emphasis role="bold">jar</emphasis> or <emphasis
- role="bold">classpath</emphasis>: Uses the <emphasis
- role="bold">classloader</emphasis>, you can use this prefix in the
- default configuration for importing an other configuration file which
- is accessible by the classloader.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">file</emphasis>: Uses an <emphasis
- role="bold">absolute path</emphasis>, you also can put a <emphasis
- role="bold">URL</emphasis>.</para>
- </listitem>
-
- <listitem>
- <para><emphasis role="bold">without any prefix</emphasis>:</para>
-
- <itemizedlist>
- <listitem>
- <para>Standalone mode: <emphasis role="bold">user
- directory</emphasis></para>
- </listitem>
-
- <listitem>
- <para>Portal mode: $AS-HOME, that means the application server
- home, for example " <emphasis
- role="bold">exo-tomcat</emphasis>".</para>
- </listitem>
- </itemizedlist>
- </listitem>
- </itemizedlist>
-
- <para>If you open the
- "portal/trunk/web/portal/src/main/webapp/WEB-INF/conf.configuration.xml"
- you will see that it consists only of imports:</para>
-
<programlisting language="xml"><import>war:/conf/common/common-configuration.xml</import>
<import>war:/conf/common/logs-configuration.xml</import>
<import>war:/conf/database/database-configuration.xml</import>
@@ -671,9 +632,8 @@
possible to resolve properties at runtime instead of providing a value at
packaging time.</para>
- <para>In
- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.tmpl.xml
- you find an example for system properties:</para>
+ <para>See below an example of a configuration file based on system
+ properties:</para>
<programlisting language="xml"> <component>
<key>org.exoplatform.services.database.HibernateService</key>
@@ -702,4 +662,98 @@
EXO_OPTS="-DconnectionUrl=jdbc:hsqldb:file:../temp/data/exodb
-DdriverClass=org.hsqldb.jdbcDriver"</emphasis></para>
</section>
+
+ <section>
+ <title>Understanding the prefixes supported by the configuration
+ manager</title>
+
+ <para>The configuration manager allows you to find files using URL with
+ special prefixes that we describe in details below.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">war</emphasis>: try to find the file using
+ the <emphasis>Servlet Context</emphasis> of your
+ <emphasis>portal.war</emphasis> or any web applications defined as
+ <emphasis>PortalContainerConfigOwner</emphasis>, so for example in
+ case of the portal.war if the URL is
+ <emphasis>war:/conf/common/portlet-container-configuration.xml</emphasis>
+ it will try to get the file from
+ <emphasis>portal.war/WEB-INF/conf/common/portlet-container-configuration.xml.</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">jar</emphasis> or <emphasis
+ role="bold">classpath</emphasis>: you can use this prefix to find a
+ file that is accessible using the <emphasis>ClassLoader</emphasis>.
+ For example <emphasis>jar:/conf/my-file.xml</emphasis> will be
+ understood as try to find <emphasis>conf/my-file.xml</emphasis> from
+ the <emphasis>ClassLoader</emphasis>.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">file</emphasis>: this prefix will indicate
+ the configuration manager that it needs to interprete the URL as an
+ <emphasis>absolute path</emphasis>. For example
+ <emphasis>file:///path/to/my/file.xml</emphasis> will be understood as
+ an obsolute path.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis>Without prefixes</emphasis>: it will be understood as
+ a <emphasis>relative path</emphasis> from the parent directory of the
+ last processed configuration file. For example, if the configuration
+ manager is processing the file corresonding to the URL
+ <emphasis>file:///path/to/my/configuration.xml</emphasis> and in this
+ file you import <emphasis>dir/to/foo.xml</emphasis>, the configuration
+ manager will try to get the file from
+ <emphasis>file:///path/to/my/dir/to/foo.xml</emphasis>. Please note
+ that it works also for other perfixes. In case you use the
+ configuration manager in a component to get a file like the example
+ below, it will depend on the mode and will be relative to the
+ following directories:</para>
+
+ <programlisting><component>
+ <key>org.exoplatform.services.resources.LocaleConfigService</key>
+ <type>org.exoplatform.services.resources.impl.LocaleConfigServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>locale.config.file</name>
+ <value>war:/conf/common/locales-config.xml</value>
+ </value-param>
+ </init-params>
+</component></programlisting>
+
+ <itemizedlist>
+ <listitem>
+ <para>In standalone mode: it will be a relative path to where it
+ can find the file <emphasis>exo-configuration.xml</emphasis>
+ knowing that the file is first checked in the <emphasis>user
+ directory</emphasis>, if it cannot be found there, it will check
+ in the <emphasis>exo configuration directory</emphasis> and if it
+ still cannot be found it will try to find
+ <emphasis>conf/exo-configuration.xml</emphasis> in the
+ <emphasis>ClassLoader</emphasis>.</para>
+ </listitem>
+
+ <listitem>
+ <para>In portal mode: it will be a relative path to the
+ <emphasis>exo configuration directory</emphasis> in case of the
+ RootContainer (assuming that a file configuration.xml exists there
+ otherwise it would be hard to know) and from
+ <emphasis>${exo-configuration-directory}/portal/${portal-container-name}</emphasis>
+ in case of the PortalContainer (assuming that a file
+ configuration.xml exists there otherwise it would be hard to
+ know).</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>For more details about the exo configuration directory please
+ refer to the chapter <emphasis>Configuration
+ Retrieval</emphasis>.</para>
+ </note>
+ </section>
</chapter>
12 years, 5 months
exo-jcr SVN: r5329 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-14 03:34:53 -0500 (Wed, 14 Dec 2011)
New Revision: 5329
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml
Log:
EXOJCR-1673: value-param has been changed on values-param, doc updated
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml 2011-12-14 08:32:40 UTC (rev 5328)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml 2011-12-14 08:34:53 UTC (rev 5329)
@@ -135,10 +135,10 @@
<programlisting language="xml"><component>
<type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
<init-params>
- <value-param>
+ <values-param>
<name>mixin-names</name>
- <value>exo:hideable</value>
- </value-param>
+ <value>exo:hideable</value>
+ </values-param>
<properties-param>
<name>locations</name>
<property name="db1" value="ws2"/>
12 years, 5 months
exo-jcr SVN: r5328 - in jcr/trunk/exo.jcr.component.ext/src: test/resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2011-12-14 03:32:40 -0500 (Wed, 14 Dec 2011)
New Revision: 5328
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-1673: value-param has been changed values-param
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-14 07:46:15 UTC (rev 5327)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-14 08:32:40 UTC (rev 5328)
@@ -25,6 +25,7 @@
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -45,6 +46,7 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -110,7 +112,7 @@
protected final RepositoryService repositoryService;
- protected final String[] mixinNames;
+ protected final List<String> mixinNames;
// TODO temporary flag to have start() run once
protected boolean started = false;
@@ -140,14 +142,14 @@
throw new RepositoryConfigurationException("Property parameters 'locations' expected");
}
- ValueParam mixinValue = params.getValueParam("mixin-names");
- if (mixinValue != null)
+ ValuesParam mixinValues = params.getValuesParam("mixin-names");
+ if (mixinValues != null)
{
- this.mixinNames = mixinValue.getValue().split(",");
+ this.mixinNames = params.getValuesParam("mixin-names").getValues();
}
else
{
- this.mixinNames = new String[0];
+ this.mixinNames = new ArrayList<String>();
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-12-14 07:46:15 UTC (rev 5327)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-12-14 08:32:40 UTC (rev 5328)
@@ -181,10 +181,11 @@
</component-plugin>
</component-plugins>
<init-params>
- <value-param>
+ <values-param>
<name>mixin-names</name>
- <value>exo:testFirstHideable,exo:testSecondHideable</value>
- </value-param>
+ <value>exo:testFirstHideable</value>
+ <value>exo:testSecondHideable</value>
+ </values-param>
<properties-param>
<name>locations</name>
<property name="db1" value="ws2" />
12 years, 5 months
exo-jcr SVN: r5327 - in jcr/trunk/exo.jcr.component.core/src/test: resources and 1 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-12-14 02:46:15 -0500 (Wed, 14 Dec 2011)
New Revision: 5327
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-config-extended.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/indexing-configuration.xml
Log:
EXOJCR-1677 : adding a simple test for IndexingRules with no conditional parameter.
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java 2011-12-14 07:38:32 UTC (rev 5326)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/IndexingRuleTest.java 2011-12-14 07:46:15 UTC (rev 5327)
@@ -22,6 +22,7 @@
import javax.jcr.Node;
import javax.jcr.NodeIterator;
+import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
import javax.jcr.Value;
import javax.jcr.query.RowIterator;
@@ -125,4 +126,23 @@
assertNotNull("No excerpt created", excerpt);
assertTrue("Title must not be present in excerpt", excerpt.getString().indexOf("Platform") == -1);
}
+
+
+ public void testSimpleIndexingRule() throws Exception
+ {
+ Node node = testRootNode.addNode("testPropertySkip", "jcr:extendedUnstructured");
+ node.setProperty("anyProperty", "Marvin", PropertyType.STRING);
+ node.setProperty("included", "Thomas", PropertyType.STRING);
+
+ testRootNode.save();
+
+ String sqlBase = "SELECT * FROM nt:unstructured WHERE CONTAINS";
+ String sqlSkippedProperty = sqlBase + "(*, 'Marvin')";
+ String sqlNotSkippedProperty = sqlBase + "(*, 'Thomas')";
+
+ // this should find nothing, property is not indexed.
+ executeSQLQuery(sqlSkippedProperty, new Node[]{});
+ // this should find node, because property "name" is included to index
+ executeSQLQuery(sqlNotSkippedProperty, new Node[]{node});
+ }
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-config-extended.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-config-extended.xml 2011-12-14 07:38:32 UTC (rev 5326)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-config-extended.xml 2011-12-14 07:46:15 UTC (rev 5327)
@@ -810,6 +810,12 @@
<nodeType name="exo:videoFolder" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
</nodeType>
+
+ <nodeType name="jcr:extendedUnstructured" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:unstructured</supertype>
+ </supertypes>
+ </nodeType>
</nodeTypes>
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/indexing-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/indexing-configuration.xml 2011-12-14 07:38:32 UTC (rev 5326)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/indexing-configuration.xml 2011-12-14 07:46:15 UTC (rev 5327)
@@ -40,6 +40,10 @@
<index-rule nodeType="nt:hierarchyNode">
<!-- do not index any properties -->
</index-rule>
+
+ <index-rule nodeType="jcr:extendedUnstructured">
+ <property>included</property>
+ </index-rule>
<aggregate primaryType="nt:file">
<include>jcr:content</include>
12 years, 5 months
exo-jcr SVN: r5325 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-13 11:26:58 -0500 (Tue, 13 Dec 2011)
New Revision: 5325
Modified:
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java
Log:
EXOJCR-1673: Fixed test
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java 2011-12-13 16:18:25 UTC (rev 5324)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java 2011-12-13 16:26:58 UTC (rev 5325)
@@ -77,21 +77,17 @@
assertTrue(regNodes.hasNode(RegistryService.EXO_APPLICATIONS));
assertTrue(regNodes.hasNode(RegistryService.EXO_USERS));
- assertTrue(regNodes.getNode(RegistryService.EXO_REGISTRY).isNodeType("exo:testFirstHideable")
- && regNodes.getNode(RegistryService.EXO_REGISTRY).isNodeType("exo:testSecondHideable"));
+ assertTrue(regNodes.isNodeType("exo:testFirstHideable"));
+ assertTrue(regNodes.isNodeType("exo:testSecondHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testFirstHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testSecondHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testFirstHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testSecondHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testFirstHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testSecondHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testFirstHideable"));
+ assertTrue(regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testSecondHideable"));
- assertTrue(regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testFirstHideable")
- && regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testSecondHideable"));
-
- assertTrue(regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testFirstHideable")
- && regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testSecondHideable"));
-
- assertTrue(regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testFirstHideable")
- && regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testSecondHideable"));
-
- assertTrue(regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testFirstHideable")
- && regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testSecondHideable"));
-
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registry");
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registryEntry");
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registryGroup");
12 years, 5 months
exo-jcr SVN: r5324 - in jcr/trunk: exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry and 3 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-12-13 11:18:25 -0500 (Tue, 13 Dec 2011)
New Revision: 5324
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/test/nodetypes-ext-test.xml
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml
Log:
EXOJCR-1673: allow to add additional mixins to nodes of RegistryService
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-12 15:20:42 UTC (rev 5323)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2011-12-13 16:18:25 UTC (rev 5324)
@@ -110,6 +110,8 @@
protected final RepositoryService repositoryService;
+ protected final String[] mixinNames;
+
// TODO temporary flag to have start() run once
protected boolean started = false;
@@ -128,10 +130,25 @@
this.repositoryService = repositoryService;
this.regWorkspaces = new HashMap<String, String>();
if (params == null)
+ {
throw new RepositoryConfigurationException("Init parameters expected");
+ }
+
this.props = params.getPropertiesParam("locations");
if (props == null)
+ {
throw new RepositoryConfigurationException("Property parameters 'locations' expected");
+ }
+
+ ValueParam mixinValue = params.getValueParam("mixin-names");
+ if (mixinValue != null)
+ {
+ this.mixinNames = mixinValue.getValue().split(",");
+ }
+ else
+ {
+ this.mixinNames = new String[0];
+ }
}
/**
@@ -405,69 +422,124 @@
ManageableRepository rep = repositoryService.getRepository(repName);
final Session sysSession = rep.getSystemSession(regWorkspaces.get(repName));
- if (sysSession.getRootNode().hasNode(EXO_REGISTRY) && replace)
- sysSession.getRootNode().getNode(EXO_REGISTRY).remove();
-
- if (!sysSession.getRootNode().hasNode(EXO_REGISTRY))
+ try
{
- Node rootNode = sysSession.getRootNode().addNode(EXO_REGISTRY, EXO_REGISTRY_NT);
- rootNode.addNode(EXO_SERVICES, EXO_REGISTRYGROUP_NT);
- rootNode.addNode(EXO_APPLICATIONS, EXO_REGISTRYGROUP_NT);
- rootNode.addNode(EXO_USERS, EXO_REGISTRYGROUP_NT);
- rootNode.addNode(EXO_GROUPS, EXO_REGISTRYGROUP_NT);
+ if (sysSession.getRootNode().hasNode(EXO_REGISTRY) && replace)
+ {
+ sysSession.getRootNode().getNode(EXO_REGISTRY).remove();
+ }
- Set<String> appNames = appConfigurations.keySet();
- final String fullPath = "/" + EXO_REGISTRY + "/" + entryLocation;
- for (String appName : appNames)
+ Node rootNode;
+ Node servicesNode;
+ Node applicationsNode;
+ Node usersNode;
+ Node groupsNode;
+
+ if (!sysSession.getRootNode().hasNode(EXO_REGISTRY))
{
- final String xml = appConfigurations.get(appName);
- try
+ rootNode = sysSession.getRootNode().addNode(EXO_REGISTRY, EXO_REGISTRY_NT);
+ servicesNode = rootNode.addNode(EXO_SERVICES, EXO_REGISTRYGROUP_NT);
+ applicationsNode = rootNode.addNode(EXO_APPLICATIONS, EXO_REGISTRYGROUP_NT);
+ usersNode = rootNode.addNode(EXO_USERS, EXO_REGISTRYGROUP_NT);
+ groupsNode = rootNode.addNode(EXO_GROUPS, EXO_REGISTRYGROUP_NT);
+
+ Set<String> appNames = appConfigurations.keySet();
+ final String fullPath = "/" + EXO_REGISTRY + "/" + entryLocation;
+ for (String appName : appNames)
{
- SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
+ final String xml = appConfigurations.get(appName);
+ try
{
- public Void run() throws Exception
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
- Document document = builder.parse(stream);
- RegistryEntry entry = new RegistryEntry(document);
- sysSession.importXML(fullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);
- return null;
- }
- });
- }
- catch (PrivilegedActionException pae)
- {
- Throwable cause = pae.getCause();
- if (cause instanceof ParserConfigurationException)
- {
- log.error(cause.getLocalizedMessage(), cause);
+ public Void run() throws Exception
+ {
+ DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
+ Document document = builder.parse(stream);
+ RegistryEntry entry = new RegistryEntry(document);
+ sysSession.importXML(fullPath, entry.getAsInputStream(), IMPORT_UUID_CREATE_NEW);
+ return null;
+ }
+ });
}
- else if (cause instanceof IOException)
+ catch (PrivilegedActionException pae)
{
- log.error(cause.getLocalizedMessage(), cause);
+ Throwable cause = pae.getCause();
+ if (cause instanceof ParserConfigurationException)
+ {
+ log.error(cause.getLocalizedMessage(), cause);
+ }
+ else if (cause instanceof IOException)
+ {
+ log.error(cause.getLocalizedMessage(), cause);
+ }
+ else if (cause instanceof SAXException)
+ {
+ log.error(cause.getLocalizedMessage(), cause);
+ }
+ else if (cause instanceof TransformerException)
+ {
+ log.error(cause.getLocalizedMessage(), cause);
+ }
+ else if (cause instanceof RuntimeException)
+ {
+ throw (RuntimeException)cause;
+ }
+ else
+ {
+ throw new RuntimeException(cause);
+ }
}
- else if (cause instanceof SAXException)
- {
- log.error(cause.getLocalizedMessage(), cause);
- }
- else if (cause instanceof TransformerException)
- {
- log.error(cause.getLocalizedMessage(), cause);
- }
- else if (cause instanceof RuntimeException)
- {
- throw (RuntimeException)cause;
- }
- else
- {
- throw new RuntimeException(cause);
- }
}
+ sysSession.save();
}
- sysSession.save();
+ else
+ {
+ rootNode = sysSession.getRootNode().getNode(EXO_REGISTRY);
+ servicesNode = rootNode.getNode(EXO_SERVICES);
+ applicationsNode = rootNode.getNode(EXO_APPLICATIONS);
+ usersNode = rootNode.getNode(EXO_USERS);
+ groupsNode = rootNode.getNode(EXO_GROUPS);
+ }
+
+ for (String mixin : mixinNames)
+ {
+ if (rootNode.canAddMixin(mixin))
+ {
+ rootNode.addMixin(mixin);
+ }
+
+ if (servicesNode.canAddMixin(mixin))
+ {
+ servicesNode.addMixin(mixin);
+ }
+
+ if (applicationsNode.canAddMixin(mixin))
+ {
+ applicationsNode.addMixin(mixin);
+ }
+
+ if (usersNode.canAddMixin(mixin))
+ {
+ usersNode.addMixin(mixin);
+ }
+
+ if (groupsNode.canAddMixin(mixin))
+ {
+ groupsNode.addMixin(mixin);
+ }
+ }
+
+ if (sysSession.hasPendingChanges())
+ {
+ sysSession.save();
+ }
}
- sysSession.logout();
+ finally
+ {
+ sysSession.logout();
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java 2011-12-12 15:20:42 UTC (rev 5323)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/registry/RegistryTest.java 2011-12-13 16:18:25 UTC (rev 5324)
@@ -27,6 +27,7 @@
import java.io.ByteArrayInputStream;
+import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
import javax.jcr.RepositoryException;
import javax.xml.parsers.DocumentBuilder;
@@ -69,14 +70,28 @@
RegistryService regService = (RegistryService)container.getComponentInstanceOfType(RegistryService.class);
assertNotNull(regService);
- assertNotNull(regService.getRegistry(sessionProviderService.getSessionProvider(null)).getNode());
- assertTrue(regService.getRegistry(sessionProviderService.getSessionProvider(null)).getNode().hasNode(
- RegistryService.EXO_SERVICES));
- assertTrue(regService.getRegistry(sessionProviderService.getSessionProvider(null)).getNode().hasNode(
- RegistryService.EXO_APPLICATIONS));
- assertTrue(regService.getRegistry(sessionProviderService.getSessionProvider(null)).getNode().hasNode(
- RegistryService.EXO_USERS));
+ Node regNodes = regService.getRegistry(sessionProviderService.getSessionProvider(null)).getNode();
+ assertNotNull(regNodes);
+ assertTrue(regNodes.hasNode(RegistryService.EXO_SERVICES));
+ assertTrue(regNodes.hasNode(RegistryService.EXO_APPLICATIONS));
+ assertTrue(regNodes.hasNode(RegistryService.EXO_USERS));
+
+ assertTrue(regNodes.getNode(RegistryService.EXO_REGISTRY).isNodeType("exo:testFirstHideable")
+ && regNodes.getNode(RegistryService.EXO_REGISTRY).isNodeType("exo:testSecondHideable"));
+
+ assertTrue(regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testFirstHideable")
+ && regNodes.getNode(RegistryService.EXO_USERS).isNodeType("exo:testSecondHideable"));
+
+ assertTrue(regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testFirstHideable")
+ && regNodes.getNode(RegistryService.EXO_GROUPS).isNodeType("exo:testSecondHideable"));
+
+ assertTrue(regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testFirstHideable")
+ && regNodes.getNode(RegistryService.EXO_SERVICES).isNodeType("exo:testSecondHideable"));
+
+ assertTrue(regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testFirstHideable")
+ && regNodes.getNode(RegistryService.EXO_APPLICATIONS).isNodeType("exo:testSecondHideable"));
+
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registry");
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registryEntry");
session.getWorkspace().getNodeTypeManager().getNodeType("exo:registryGroup");
Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-12-12 15:20:42 UTC (rev 5323)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2011-12-13 16:18:25 UTC (rev 5324)
@@ -181,6 +181,10 @@
</component-plugin>
</component-plugins>
<init-params>
+ <value-param>
+ <name>mixin-names</name>
+ <value>exo:testFirstHideable,exo:testSecondHideable</value>
+ </value-param>
<properties-param>
<name>locations</name>
<property name="db1" value="ws2" />
Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/test/nodetypes-ext-test.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/test/nodetypes-ext-test.xml 2011-12-12 15:20:42 UTC (rev 5323)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/test/nodetypes-ext-test.xml 2011-12-13 16:18:25 UTC (rev 5324)
@@ -45,5 +45,10 @@
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
-
+
+ <nodeType name="exo:testFirstHideable" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ </nodeType>
+
+ <nodeType name="exo:testSecondHideable" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
+ </nodeType>
</nodeTypes>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml 2011-12-12 15:20:42 UTC (rev 5323)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-registry-service.xml 2011-12-13 16:18:25 UTC (rev 5324)
@@ -122,18 +122,26 @@
<section>
<title>Configuration</title>
- <para>RegistryService has only one optional properties parameter <emphasis
- role="bold">locations</emphasis>. It is used to mention where exo:registry
- is placed for each repository. The name of each property is interpreted as
- a repository name and its value as a workspace name (a system workspace by
- default).</para>
+ <para>RegistryService has two optional params: value parameter <emphasis
+ role="bold">mixin-names</emphasis> and properties parameter <emphasis
+ role="bold">locations</emphasis>. The mixin-names is used for adding
+ additional mixins to nodes exo:registry, exo:applications, exo:services,
+ exo:users and exo:groups of RegistryService. This allows the top level
+ applications to manage these nodes in special way. Locations is used to
+ mention where exo:registry is placed for each repository. The name of each
+ property is interpreted as a repository name and its value as a workspace
+ name (a system workspace by default).</para>
<programlisting language="xml"><component>
<type>org.exoplatform.services.jcr.ext.registry.RegistryService</type>
<init-params>
- <properties-param>
+ <value-param>
+ <name>mixin-names</name>
+ <value>exo:hideable</value>
+ </value-param>
+ <properties-param>
<name>locations</name>
- <property name="db1" value="ws2"/>
+ <property name="db1" value="ws2"/>
</properties-param>
</init-params>
</component></programlisting>
12 years, 5 months
exo-jcr SVN: r5323 - in core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc: listeners and 1 other directory.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-12-12 10:20:42 -0500 (Mon, 12 Dec 2011)
New Revision: 5323
Modified:
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/GroupDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipTypeDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserProfileDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/listeners/RemoveMembershipListener.java
Log:
EXOJCR-1554: replaced addLIKE with addEQ where needed
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/GroupDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/GroupDAOImpl.java 2011-12-12 14:28:24 UTC (rev 5322)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/GroupDAOImpl.java 2011-12-12 15:20:42 UTC (rev 5323)
@@ -82,7 +82,7 @@
DBObjectQuery<GroupImpl> query = new DBObjectQuery<GroupImpl>(GroupImpl.class);
if (parent != null)
{
- query.addLIKE("GROUP_ID", parent.getId());
+ query.addEQ("GROUP_ID", parent.getId());
Group parentGroup = super.loadUnique(connection, query.toQuery());
if (parentGroup == null)
{
@@ -99,7 +99,7 @@
}
query.getParameters().clear();
- query.addLIKE("GROUP_ID", groupId);
+ query.addEQ("GROUP_ID", groupId);
Group o = super.loadUnique(connection, query.toQuery());
if (o != null)
{
@@ -137,7 +137,7 @@
public Group findGroupById(String groupId) throws Exception
{
DBObjectQuery<GroupImpl> query = new DBObjectQuery<GroupImpl>(GroupImpl.class);
- query.addLIKE("GROUP_ID", groupId);
+ query.addEQ("GROUP_ID", groupId);
Group g = super.loadUnique(query.toQuery());
if (log.isDebugEnabled())
log.debug("----------FIND GROUP BY ID: " + groupId + " _ " + (g != null));
@@ -172,7 +172,7 @@
if (parent != null)
parentId = parent.getId();
DBObjectQuery<GroupImpl> query = new DBObjectQuery<GroupImpl>(GroupImpl.class);
- query.addLIKE("PARENT_ID", parentId);
+ query.addEQ("PARENT_ID", parentId);
DBPageList<GroupImpl> pageList = new DBPageList<GroupImpl>(20, this, query);
if (log.isDebugEnabled())
{
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipTypeDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipTypeDAOImpl.java 2011-12-12 14:28:24 UTC (rev 5322)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/MembershipTypeDAOImpl.java 2011-12-12 15:20:42 UTC (rev 5323)
@@ -69,7 +69,7 @@
public MembershipType findMembershipType(String name) throws Exception
{
DBObjectQuery<MembershipTypeImpl> query = new DBObjectQuery<MembershipTypeImpl>(MembershipTypeImpl.class);
- query.addLIKE("MT_NAME", name);
+ query.addEQ("MT_NAME", name);
MembershipType mt = loadUnique(query.toQuery());;
// System.out.println("===========FIND MT BY NAME" + name + " - " +
// (mt!=null));
@@ -89,7 +89,7 @@
public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
{
DBObjectQuery<MembershipTypeImpl> query = new DBObjectQuery<MembershipTypeImpl>(MembershipTypeImpl.class);
- query.addLIKE("MT_NAME", name);
+ query.addEQ("MT_NAME", name);
MembershipTypeImpl mt = loadUnique(query.toQuery());
if (mt == null)
{
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserDAOImpl.java 2011-12-12 14:28:24 UTC (rev 5322)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserDAOImpl.java 2011-12-12 15:20:42 UTC (rev 5323)
@@ -126,10 +126,12 @@
public User findUserByName(String userName) throws Exception
{
DBObjectQuery<UserImpl> query = new DBObjectQuery<UserImpl>(UserImpl.class);
- query.addLIKE("USER_NAME", userName);
+ query.addEQ("USER_NAME", userName);
User user = loadUnique(query.toQuery());;
if (log.isDebugEnabled())
+ {
log.debug("+++++++++++FIND USER BY USER NAME " + userName + " - " + (user != null));
+ }
return user;
}
@@ -187,7 +189,7 @@
DBObjectQuery dbQuery = new DBObjectQuery<UserImpl>(UserImpl.class);
for (Membership member : members)
{
- dbQuery.addLIKE("USER_NAME", member.getUserName());
+ dbQuery.addEQ("USER_NAME", member.getUserName());
}
return new JDBCListAccess<User>(this, dbQuery.toQueryUseOR(), dbQuery.toCountQueryUseOR());
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserProfileDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserProfileDAOImpl.java 2011-12-12 14:28:24 UTC (rev 5322)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/UserProfileDAOImpl.java 2011-12-12 15:20:42 UTC (rev 5323)
@@ -73,7 +73,7 @@
private UserProfileData findUserProfileDataByName(String userName) throws Exception
{
DBObjectQuery<UserProfileData> query = new DBObjectQuery<UserProfileData>(UserProfileData.class);
- query.addLIKE("USER_NAME", userName);
+ query.addEQ("USER_NAME", userName);
return loadUnique(query.toQuery());
}
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/listeners/RemoveMembershipListener.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/listeners/RemoveMembershipListener.java 2011-12-12 14:28:24 UTC (rev 5322)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/jdbc/listeners/RemoveMembershipListener.java 2011-12-12 15:20:42 UTC (rev 5323)
@@ -78,7 +78,7 @@
MembershipType memberType = (MembershipType)target;
MembershipDAOImpl mtHandler = (MembershipDAOImpl)service_.getMembershipHandler();
DBObjectQuery<MembershipImpl> query = new DBObjectQuery<MembershipImpl>(MembershipImpl.class);
- query.addLIKE("MEMBERSHIP_TYPE", memberType.getName());
+ query.addEQ("MEMBERSHIP_TYPE", memberType.getName());
mtHandler.removeMemberships(query, true);
}
catch (Exception e)
12 years, 5 months