exo-jcr SVN: r1596 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/cas.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-27 11:54:37 -0500 (Wed, 27 Jan 2010)
New Revision: 1596
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/cas/TestJDBCValueContentAddressStorageImpl.java
Log:
EXOJCR-310 fix of dialect usage in JDBC VCAS test
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/cas/TestJDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/cas/TestJDBCValueContentAddressStorageImpl.java 2010-01-27 16:38:01 UTC (rev 1595)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/cas/TestJDBCValueContentAddressStorageImpl.java 2010-01-27 16:54:37 UTC (rev 1596)
@@ -55,15 +55,20 @@
if (wse.getName().equals(session.getWorkspace().getName()))
{
jdbcSourceName = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
- jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT);
+ jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT, null);
}
}
if (jdbcSourceName == null)
+ {
fail(JDBCWorkspaceDataContainer.SOURCE_NAME + " required in workspace container config");
+ }
props.put(JDBCValueContentAddressStorageImpl.JDBC_SOURCE_NAME_PARAM, jdbcSourceName);
- props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ if (jdbcDialect != null)
+ {
+ props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ }
props.put(JDBCValueContentAddressStorageImpl.TABLE_NAME_PARAM,
JDBCValueContentAddressStorageImpl.DEFAULT_TABLE_NAME + "_TEST");
14 years, 3 months
exo-jcr SVN: r1595 - in jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs: operations and 1 other directory.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-27 11:38:01 -0500 (Wed, 27 Jan 2010)
New Revision: 1595
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/Probe.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableSimpleFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableTreeFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java
Log:
EXOJCR-310 fix of dialect usage in VCAS tests; svn:Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -41,7 +41,7 @@
* Date: 19.07.2008
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: CASableFileIOChannelTestBase.java 34801 2009-07-31 15:44:50Z dkatayev $
+ * @version $Id$
*/
public abstract class CASableFileIOChannelTestBase extends JcrImplBaseTest
{//
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/Probe.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/Probe.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/Probe.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -25,7 +25,7 @@
* Created by The eXo Platform SAS.
*
* @author Gennady Azarenkov
- * @version $Id: Probe.java 11907 2008-03-13 15:36:21Z ksm $
+ * @version $Id$
*/
public class Probe extends Thread
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/Probe.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableSimpleFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableSimpleFileIOChannel.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableSimpleFileIOChannel.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -31,7 +31,7 @@
* Date: 19.07.2008
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: TestCASableSimpleFileIOChannel.java 34801 2009-07-31 15:44:50Z dkatayev $
+ * @version $Id$
*/
public class TestCASableSimpleFileIOChannel extends CASableFileIOChannelTestBase
{
@@ -51,15 +51,20 @@
if (wse.getName().equals(session.getWorkspace().getName()))
{
jdbcSourceName = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
- jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT);
+ jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT, null);
}
}
if (jdbcSourceName == null)
+ {
fail(JDBCWorkspaceDataContainer.SOURCE_NAME + " required in workspace container config");
+ }
props.put(JDBCValueContentAddressStorageImpl.JDBC_SOURCE_NAME_PARAM, jdbcSourceName);
- props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ if (jdbcDialect != null)
+ {
+ props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ }
props.put(JDBCValueContentAddressStorageImpl.TABLE_NAME_PARAM,
JDBCValueContentAddressStorageImpl.DEFAULT_TABLE_NAME + "_TEST");
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableSimpleFileIOChannel.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableTreeFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableTreeFileIOChannel.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableTreeFileIOChannel.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -31,7 +31,7 @@
* Date: 19.07.2008
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: TestCASableTreeFileIOChannel.java 34801 2009-07-31 15:44:50Z dkatayev $
+ * @version $Id$
*/
public class TestCASableTreeFileIOChannel extends CASableFileIOChannelTestBase
{
@@ -51,15 +51,20 @@
if (wse.getName().equals(session.getWorkspace().getName()))
{
jdbcSourceName = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
- jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT);
+ jdbcDialect = wse.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT, null);
}
}
if (jdbcSourceName == null)
+ {
fail(JDBCWorkspaceDataContainer.SOURCE_NAME + " required in workspace container config");
+ }
props.put(JDBCValueContentAddressStorageImpl.JDBC_SOURCE_NAME_PARAM, jdbcSourceName);
- props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ if (jdbcDialect != null)
+ {
+ props.put(JDBCValueContentAddressStorageImpl.JDBC_DIALECT_PARAM, jdbcDialect);
+ }
props.put(JDBCValueContentAddressStorageImpl.TABLE_NAME_PARAM,
JDBCValueContentAddressStorageImpl.DEFAULT_TABLE_NAME + "_TEST");
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestCASableTreeFileIOChannel.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -35,7 +35,7 @@
* Created by The eXo Platform SAS.
*
* @author Gennady Azarenkov
- * @version $Id: TestFileIOChannel.java 34801 2009-07-31 15:44:50Z dkatayev $
+ * @version $Id$
*/
public class TestFileIOChannel extends TestCase
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileIOChannel.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -36,7 +36,7 @@
* Created by The eXo Platform SAS.
*
* @author Gennady Azarenkov
- * @version $Id: TestFileValueIO.java 11907 2008-03-13 15:36:21Z ksm $
+ * @version $Id$
*/
public class TestFileValueIO extends TestCase
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestFileValueIO.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -41,7 +41,7 @@
* cases.
*
* @author Nikolay Zamosenchuk
- * @version $Id: $
+ * @version $Id$
*/
public class TestRemoveFromValueStorage extends BaseStandaloneTest
{
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/TestRemoveFromValueStorage.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java 2010-01-27 16:36:20 UTC (rev 1594)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java 2010-01-27 16:38:01 UTC (rev 1595)
@@ -44,7 +44,7 @@
* Date: 28.05.2009
*
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
- * @version $Id: TestValueFileIOHelper.java 111 2008-11-11 11:11:11Z pnedonosko $
+ * @version $Id$
*/
public class TestValueFileIOHelper extends JcrImplBaseTest
{
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/TestValueFileIOHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id
14 years, 3 months
exo-jcr SVN: r1594 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache and 6 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-01-27 11:36:20 -0500 (Wed, 27 Jan 2010)
New Revision: 1594
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/impl/core/lock/jbosscache/CacheableLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
Log:
EXOJCR-434: Added support of ConfigurationManager for retrieving configuration files also from JAR, WAR, EAR archives. Fixed indexer parameters in template-based configuration.
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 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/TemplateConfigurationHelper.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.config;
+import org.exoplatform.container.configuration.ConfigurationManager;
+
import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
@@ -46,6 +48,8 @@
// 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
@@ -57,10 +61,12 @@
*
* @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)
+ public TemplateConfigurationHelper(String[] includes, String[] excludes, ConfigurationManager cfm)
{
super();
+ this.cfm = cfm;
// compile include patterns
for (String regex : includes)
{
@@ -77,12 +83,13 @@
* Creates instance of TemplateConfigurationHelper pre-configured for JBossCache parameters,<br>
* including: "jbosscache-*" and "jgroups-configuration", and excluding "jbosscache-configuration"
*
+ * @param ConfigurationManager instance for looking up resources
* @return
*/
- public static TemplateConfigurationHelper createJBossCacheHelper()
+ public static TemplateConfigurationHelper createJBossCacheHelper(ConfigurationManager cfm)
{
return new TemplateConfigurationHelper(new String[]{"^jbosscache-.*", "^jgroups-configuration"},
- new String[]{"^jbosscache-configuration"});
+ new String[]{"^jbosscache-configuration"}, cfm);
}
/**
@@ -124,17 +131,46 @@
*/
public InputStream fillTemplate(String filename, Map<String, String> parameters) throws IOException
{
+ // try to get resource by class loader
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream inputStream = cl == null ? null : cl.getResourceAsStream(filename);
+
+ // check system class loader
if (inputStream == null)
{
- // check system class loader
inputStream = getClass().getClassLoader().getResourceAsStream(filename);
}
+
+ // try to get as file stream
if (inputStream == null)
{
- inputStream = new FileInputStream(filename);
+ try
+ {
+ inputStream = new FileInputStream(filename);
+ }
+ catch (IOException e)
+ {
+ // we'll try to get it through configuration manager also
+ }
}
+
+ // try to get using configuration manager
+ if (inputStream == null)
+ {
+ try
+ {
+ inputStream = cfm.getInputStream(filename);
+ }
+ catch (Exception e)
+ {
+ // Stream still remains to be null, exception will be thrown below
+ }
+ }
+ // 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);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -16,6 +16,7 @@
*/
package org.exoplatform.services.jcr.impl.core.lock.jbosscache;
+import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.jmx.annotations.NameTemplate;
@@ -184,9 +185,9 @@
* @throws RepositoryConfigurationException
*/
public CacheableLockManager(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- InitialContextInitializer context, TransactionService transactionService) throws RepositoryConfigurationException
+ InitialContextInitializer context, TransactionService transactionService,ConfigurationManager cfm) throws RepositoryConfigurationException
{
- this(dataManager, config, context, transactionService.getTransactionManager());
+ this(dataManager, config, context, transactionService.getTransactionManager(), cfm);
}
/**
@@ -198,9 +199,9 @@
* @throws RepositoryConfigurationException
*/
public CacheableLockManager(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- InitialContextInitializer context) throws RepositoryConfigurationException
+ InitialContextInitializer context,ConfigurationManager cfm) throws RepositoryConfigurationException
{
- this(dataManager, config, context, (TransactionManager)null);
+ this(dataManager, config, context, (TransactionManager)null,cfm);
}
/**
@@ -214,7 +215,7 @@
* @throws RepositoryConfigurationException
*/
public CacheableLockManager(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- InitialContextInitializer context, TransactionManager transactionManager) throws RepositoryConfigurationException
+ InitialContextInitializer context, TransactionManager transactionManager, ConfigurationManager cfm) throws RepositoryConfigurationException
{
lockRoot = Fqn.fromElements(LOCKS);
@@ -257,7 +258,7 @@
.getCacheConfig();
// initialize template
- TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper(cfm);
InputStream configStream;
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.core.query;
+import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.log.ExoLogger;
@@ -50,9 +51,9 @@
*/
public DefaultChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
- QueryHandler parentHandler) throws IOException, RepositoryConfigurationException, RepositoryException
+ QueryHandler parentHandler, ConfigurationManager cfm) throws IOException, RepositoryConfigurationException, RepositoryException
{
- super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
+ super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler, cfm);
IndexerIoModeHandler modeHandler = new IndexerIoModeHandler(IndexerIoMode.READ_WRITE);
handler.setIndexerIoModeHandler(modeHandler);
parentHandler.setIndexerIoModeHandler(modeHandler);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerChangesFilter.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerChangesFilter.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.core.query;
+import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
@@ -67,7 +68,7 @@
*/
public IndexerChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
- QueryHandler parentHandler)
+ QueryHandler parentHandler, ConfigurationManager cfm)
{
super();
this.searchManager = searchManager;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -649,12 +649,12 @@
}
Constructor<? extends IndexerChangesFilter> constuctor =
changesFilterClass.getConstructor(SearchManager.class, SearchManager.class, QueryHandlerEntry.class,
- IndexingTree.class, IndexingTree.class, QueryHandler.class, QueryHandler.class);
+ IndexingTree.class, IndexingTree.class, QueryHandler.class, QueryHandler.class, ConfigurationManager.class);
if (parentSearchManager != null)
{
newChangesFilter =
constuctor.newInstance(this, parentSearchManager, config, indexingTree, parentSearchManager
- .getIndexingTree(), handler, parentSearchManager.getHandler());
+ .getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
}
}
catch (SecurityException e)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.core.query.jbosscache;
+import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.config.QueryHandlerParams;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
@@ -72,13 +73,13 @@
*/
public JBossCacheIndexChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
- QueryHandler parentHandler) throws IOException, RepositoryException, RepositoryConfigurationException
+ QueryHandler parentHandler, ConfigurationManager cfm) throws IOException, RepositoryException, RepositoryConfigurationException
{
- super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
+ super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler, cfm);
String jbcConfig = config.getParameterValue(QueryHandlerParams.PARAM_JBOSSCACHE_CONFIGURATION);
// initialize template
- TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper(cfm);
InputStream configStream;
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
+import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.jcr.access.AccessControlList;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
@@ -256,7 +257,7 @@
* @throws RepositoryException if error of initialization
* @throws RepositoryConfigurationException if error of configuration
*/
- public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, TransactionService transactionService)
+ public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, TransactionService transactionService, ConfigurationManager cfm)
throws RepositoryException, RepositoryConfigurationException
{
if (wsConfig.getCache() == null)
@@ -269,7 +270,7 @@
LOG.info("JBoss Cache configuration used: " + jbcConfig);
// initialize template
- TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper(cfm);
InputStream configStream;
try
{
@@ -310,10 +311,10 @@
* @throws RepositoryException if error of initialization
* @throws RepositoryConfigurationException if error of configuration
*/
- public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig) throws RepositoryException,
+ public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, ConfigurationManager cfm) throws RepositoryException,
RepositoryConfigurationException
{
- this(wsConfig, null);
+ this(wsConfig, null, cfm);
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.config;
+import org.exoplatform.container.configuration.ConfigurationManagerImpl;
+
import junit.framework.TestCase;
import java.io.ByteArrayInputStream;
@@ -37,7 +39,8 @@
public void testFilters()
{
// create helper with predefined include and exclude patterns
- TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper helper =
+ TemplateConfigurationHelper.createJBossCacheHelper(new ConfigurationManagerImpl());
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("jbosscache-configuration", "");
parameters.put("jbosscache-cache.loader", "");
@@ -51,11 +54,11 @@
assertTrue(preparedParameters.containsKey("${jbosscache-cache.loader}"));
assertTrue(preparedParameters.containsKey("${jbosscache-clustername}"));
}
-
+
public void testFilters2()
{
// create helper with predefined include and exclude patterns
- TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper(new ConfigurationManagerImpl());
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("jgroups-configuration", "");
parameters.put("jbosscache-cache.loader", "");
@@ -71,7 +74,7 @@
public void testTemplating() throws IOException
{
- TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper();
+ TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper(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";
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-27 16:36:20 UTC (rev 1594)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
+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;
@@ -41,13 +42,15 @@
{
TransactionService transactionService =
(TransactionService)container.getComponentInstanceOfType(TransactionService.class);
-
+
ArrayList<SimpleParameterEntry> list = new ArrayList<SimpleParameterEntry>();
- list.add(new SimpleParameterEntry(JBossCacheWorkspaceStorageCache.JBOSSCACHE_CONFIG, "conf/standalone/test-jbosscache-config.xml"));
-
+ list.add(new SimpleParameterEntry(JBossCacheWorkspaceStorageCache.JBOSSCACHE_CONFIG,
+ "jar:/conf/standalone/test-jbosscache-config.xml"));
+
CacheEntry entry = new CacheEntry(list);
WorkspaceEntry workspaceEntry = new WorkspaceEntry();
workspaceEntry.setCache(entry);
- return new JBossCacheWorkspaceStorageCache(workspaceEntry, transactionService == null ? null : transactionService);
+ return new JBossCacheWorkspaceStorageCache(workspaceEntry,
+ transactionService == null ? null : transactionService, new ConfigurationManagerImpl());
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml 2010-01-27 16:11:03 UTC (rev 1593)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml 2010-01-27 16:36:20 UTC (rev 1594)
@@ -139,6 +139,14 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws1" />
<property name="max-volatile-time" value="60" />
+
+ <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.jbosscache.CacheableLockManager">
@@ -196,6 +204,14 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws2" />
<property name="max-volatile-time" value="60" />
+
+ <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.jbosscache.CacheableLockManager">
@@ -230,35 +246,32 @@
<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" />
- </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="jdbcjcr3" />
- <property name="jdbc-dialect" value="mysql" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </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" />
+ </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="jdbc-dialect" value="hsqldb" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
</container>
<cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
@@ -275,6 +288,17 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws3" />
<property name="max-volatile-time" value="60" />
+
+ <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.jbosscache.CacheableLockManager">
@@ -351,6 +375,14 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws" />
<property name="max-volatile-time" value="60" />
+
+ <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.jbosscache.CacheableLockManager">
@@ -415,6 +447,12 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws1" />
<property name="max-volatile-time" value="60" />
+ <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.jbosscache.CacheableLockManager">
@@ -479,6 +517,15 @@
<property name="jgroups-configuration" value="udp.xml" />
<property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws2" />
<property name="max-volatile-time" value="60" />
+ <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.jbosscache.CacheableLockManager">
14 years, 3 months
exo-jcr SVN: r1593 - jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-27 11:11:03 -0500 (Wed, 27 Jan 2010)
New Revision: 1593
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
Log:
EXOJCR-310 cluster configs
Modified: 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 2010-01-27 16:05:42 UTC (rev 1592)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2010-01-27 16:11:03 UTC (rev 1593)
@@ -33,7 +33,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -46,7 +45,6 @@
<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="mysql" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -64,8 +62,7 @@
<property name="restore-path" value="./sv_export_root.xml" />
<property name="restore-path" value="./src/test/resources/import-export/restore_db1_ws1.xml" />
</properties>
- </initializer
--->
+ </initializer -->
<cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
<properties>
<property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-config-db1-ws.xml" />
@@ -91,7 +88,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -139,7 +135,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr2" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -188,7 +183,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr3" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -211,7 +205,6 @@
<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="jdbcjcr3" />
- <property name="jdbc-dialect" value="mysql" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -260,7 +253,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -315,7 +307,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr1tck" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -369,7 +360,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr2tck" />
- <property name="dialect" value="mysql" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
14 years, 3 months
exo-jcr SVN: r1592 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/storage/jdbc and 3 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-27 11:05:42 -0500 (Wed, 27 Jan 2010)
New Revision: 1592
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-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-jcr-config-sjdbc.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-310 database dialect detection (and for VCAS and conf persister)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2010-01-27 16:05:42 UTC (rev 1592)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.config.ConfigurationPersister;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -34,6 +35,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
+import javax.jcr.RepositoryException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
@@ -119,37 +121,66 @@
+ PARAM_SOURCE_NAME + ") is expected");
}
}
-
- String dialectParam = params.getProperty(PARAM_DIALECT);
-
this.sourceName = sourceNameParam;
- String binType = "BLOB";
- if (dialectParam != null)
- if (dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_GENERIC)
- || dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_HSQLDB))
+ String dialect = params.getProperty(PARAM_DIALECT);
+ if (dialect == null)
+ {
+ Connection conn = null;
+ try
{
- binType = "VARBINARY(102400)"; // 100Kb
+ conn = openConnection();
+ dialect = DialectDetecter.detect(conn.getMetaData());
}
- else if (dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_PGSQL))
+ catch (NamingException e)
{
- configTableName = configTableName.toUpperCase().toLowerCase(); // postgres needs it
- binType = "BYTEA";
+ throw new RepositoryConfigurationException(e);
}
- else if (dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_MSSQL))
+ catch (SQLException e)
{
- binType = "VARBINARY(max)";
+ throw new RepositoryConfigurationException(e);
}
- else if (dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_SYBASE))
+ finally
{
- binType = "VARBINARY(255)";
+ if (conn != null)
+ {
+ try
+ {
+ conn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+ }
}
- else if (dialectParam.equalsIgnoreCase(DBConstants.DB_DIALECT_INGRES))
- {
- configTableName = configTableName.toUpperCase().toLowerCase(); // ingres needs it
- binType = "LONG BYTE";
- }
+ }
+ String binType = "BLOB";
+ if (DBConstants.DB_DIALECT_GENERIC.equalsIgnoreCase(dialect)
+ || DBConstants.DB_DIALECT_HSQLDB.equalsIgnoreCase(dialect))
+ {
+ binType = "VARBINARY(102400)"; // 100Kb
+ }
+ else if (DBConstants.DB_DIALECT_PGSQL.equalsIgnoreCase(dialect))
+ {
+ configTableName = configTableName.toUpperCase().toLowerCase(); // postgres needs it
+ binType = "BYTEA";
+ }
+ else if (DBConstants.DB_DIALECT_MSSQL.equalsIgnoreCase(dialect))
+ {
+ binType = "VARBINARY(max)";
+ }
+ else if (DBConstants.DB_DIALECT_SYBASE.equalsIgnoreCase(dialect))
+ {
+ binType = "VARBINARY(255)";
+ }
+ else if (DBConstants.DB_DIALECT_INGRES.equalsIgnoreCase(dialect))
+ {
+ configTableName = configTableName.toUpperCase().toLowerCase(); // ingres needs it
+ binType = "LONG BYTE";
+ }
+
this.initSQL =
"CREATE TABLE " + configTableName + " (" + "NAME VARCHAR(64) NOT NULL, " + "CONFIG " + binType + " NOT NULL, "
+ "CONSTRAINT JCR_CONFIG_PK PRIMARY KEY(NAME))";
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2010-01-27 16:05:42 UTC (rev 1592)
@@ -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.impl.storage.jdbc;
+
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+
+/**
+ * JDBC dialect detecter based on database metadata and vendor product name.
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
+ * @version $Id:DialectDetecter.java 1111 2010-01-01 00:00:01Z pnedonosko $
+ *
+ */
+public class DialectDetecter
+{
+
+ /**
+ * Detect databse dialect using JDBC metadata. Based on code of
+ * http://svn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hi...
+ *
+ * @param jdbcConn Connection
+ * @return String
+ * @throws SQLException if error occurs
+ */
+ public static String detect(final DatabaseMetaData metaData) throws SQLException
+ {
+ final String databaseName = metaData.getDatabaseProductName();
+
+ if ("HSQL Database Engine".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_HSQLDB;
+ }
+
+ if ("H2".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_H2;
+ }
+
+ if ("MySQL".equals(databaseName))
+ {
+ // TODO doesn't detect MySQL_UTF8
+ return DBConstants.DB_DIALECT_MYSQL;
+ }
+
+ if ("PostgreSQL".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_PGSQL;
+ }
+
+ if ("Apache Derby".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_DERBY;
+ }
+
+ if ("ingres".equalsIgnoreCase(databaseName))
+ {
+ return DBConstants.DB_DIALECT_INGRES;
+ }
+
+ if (databaseName.startsWith("Microsoft SQL Server"))
+ {
+ return DBConstants.DB_DIALECT_MSSQL;
+ }
+
+ if ("Sybase SQL Server".equals(databaseName) || "Adaptive Server Enterprise".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_SYBASE;
+ }
+
+ if (databaseName.startsWith("Adaptive Server Anywhere"))
+ {
+ // TODO not implemented anything special for
+ return DBConstants.DB_DIALECT_SYBASE;
+ }
+
+ // TODO Informix not supported now
+ //if ( "Informix Dynamic Server".equals( databaseName ) ) {
+ // return new InformixDialect();
+ //}
+
+ if (databaseName.startsWith("DB2/"))
+ {
+ // TODO doesn't detect DB2 v8
+ return DBConstants.DB_DIALECT_DB2;
+ }
+
+ if ("Oracle".equals(databaseName))
+ {
+ // TODO doesn't detect Oracle OCI (experimental support still)
+ return DBConstants.DB_DIALECT_ORACLE;
+
+ // int databaseMajorVersion = metaData.getDatabaseMajorVersion();
+ // switch ( databaseMajorVersion ) {
+ // case 11:
+ // log.warn( "Oracle 11g is not yet fully supported; using 10g dialect" );
+ // return new Oracle10gDialect();
+ // case 10:
+ // return new Oracle10gDialect();
+ // case 9:
+ // return new Oracle9iDialect();
+ // case 8:
+ // return new Oracle8iDialect();
+ // default:
+ // log.warn( "unknown Oracle major version [" + databaseMajorVersion + "]" );
+ // }
+ }
+
+ return DBConstants.DB_DIALECT_GENERIC;
+ }
+
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-01-27 16:05:42 UTC (rev 1592)
@@ -246,7 +246,7 @@
dbUserName != null ? DriverManager.getConnection(dbUrl, dbUserName, dbPassword) : DriverManager
.getConnection(dbUrl);
- this.dbDialect = detectDialect(jdbcConn.getMetaData());
+ this.dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
}
catch (SQLException e)
{
@@ -301,7 +301,7 @@
try
{
jdbcConn = ds.getConnection();
- this.dbDialect = detectDialect(jdbcConn.getMetaData());
+ this.dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
}
catch (SQLException e)
{
@@ -380,100 +380,6 @@
}
/**
- * Detect databse dialect using JDBC metadata. Based on code of
- * http://svn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hi...
- *
- * @param jdbcConn Connection
- * @return String
- * @throws SQLException if error occurs
- */
- protected String detectDialect(DatabaseMetaData metaData) throws SQLException
- {
- String databaseName = metaData.getDatabaseProductName();
-
- if ("HSQL Database Engine".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_HSQLDB;
- }
-
- if ("H2".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_H2;
- }
-
- if ("MySQL".equals(databaseName))
- {
- // TODO doesn't detect MySQL_UTF8
- return DBConstants.DB_DIALECT_MYSQL;
- }
-
- if ("PostgreSQL".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_PGSQL;
- }
-
- if ("Apache Derby".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_DERBY;
- }
-
- if ("ingres".equalsIgnoreCase(databaseName))
- {
- return DBConstants.DB_DIALECT_INGRES;
- }
-
- if (databaseName.startsWith("Microsoft SQL Server"))
- {
- return DBConstants.DB_DIALECT_MSSQL;
- }
-
- if ("Sybase SQL Server".equals(databaseName) || "Adaptive Server Enterprise".equals(databaseName))
- {
- return DBConstants.DB_DIALECT_SYBASE;
- }
-
- if (databaseName.startsWith("Adaptive Server Anywhere"))
- {
- // TODO not implemented anything special for
- return DBConstants.DB_DIALECT_SYBASE;
- }
-
- // TODO Informix not supported now
- //if ( "Informix Dynamic Server".equals( databaseName ) ) {
- // return new InformixDialect();
- //}
-
- if (databaseName.startsWith("DB2/"))
- {
- // TODO doesn't detect DB2 v8
- return DBConstants.DB_DIALECT_DB2;
- }
-
- if ("Oracle".equals(databaseName))
- {
- // TODO doesn't detect Oracle OCI (experimental support still)
- return DBConstants.DB_DIALECT_ORACLE;
-
- // int databaseMajorVersion = metaData.getDatabaseMajorVersion();
- // switch ( databaseMajorVersion ) {
- // case 11:
- // log.warn( "Oracle 11g is not yet fully supported; using 10g dialect" );
- // return new Oracle10gDialect();
- // case 10:
- // return new Oracle10gDialect();
- // case 9:
- // return new Oracle9iDialect();
- // case 8:
- // return new Oracle8iDialect();
- // default:
- // log.warn( "unknown Oracle major version [" + databaseMajorVersion + "]" );
- // }
- }
-
- return DBConstants.DB_DIALECT_GENERIC;
- }
-
- /**
* Prepare sefault connection factory.
*
* @return GenericConnectionFactory
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2010-01-27 16:05:42 UTC (rev 1592)
@@ -20,10 +20,12 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
+import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -86,8 +88,8 @@
/**
* MYSQL_PK_CONSTRAINT_DETECT.
*/
- private static final Pattern MYSQL_PK_CONSTRAINT_DETECT =
- Pattern.compile(MYSQL_PK_CONSTRAINT_DETECT_PATTERN, Pattern.CASE_INSENSITIVE);
+ private static final Pattern MYSQL_PK_CONSTRAINT_DETECT = Pattern.compile(MYSQL_PK_CONSTRAINT_DETECT_PATTERN,
+ Pattern.CASE_INSENSITIVE);
protected DataSource dataSource;
@@ -118,97 +120,118 @@
*/
public void init(Properties props) throws RepositoryConfigurationException, VCASException
{
- // init database metadata
- final String tn = props.getProperty(TABLE_NAME_PARAM);
- if (tn != null)
- tableName = tn;
- else
- tableName = DEFAULT_TABLE_NAME;
+ final String sn = props.getProperty(JDBC_SOURCE_NAME_PARAM);
+ if (sn == null)
+ {
+ throw new RepositoryConfigurationException(JDBC_SOURCE_NAME_PARAM + " parameter expected!");
+ }
- dialect = props.getProperty(JDBC_DIALECT_PARAM, DBConstants.DB_DIALECT_GENERIC);
+ try
+ {
+ dataSource = (DataSource)new InitialContext().lookup(sn);
+ Connection conn = null;
+ try
+ {
+ conn = dataSource.getConnection();
+ DatabaseMetaData dbMetaData = conn.getMetaData();
- sqlConstraintPK = tableName + "_PK";
+ String dialect = props.getProperty(JDBC_DIALECT_PARAM);
+ if (dialect == null)
+ {
+ dialect = DialectDetecter.detect(dbMetaData);
+ }
- sqlVCASIDX = tableName + "_IDX";
+ dialect = props.getProperty(JDBC_DIALECT_PARAM, DBConstants.DB_DIALECT_GENERIC);
- if (DBConstants.DB_DIALECT_PGSQL.equalsIgnoreCase(dialect)
- || DBConstants.DB_DIALECT_INGRES.equalsIgnoreCase(dialect))
- {
- // use lowercase for postgres/ingres metadata.getTable(), HSQLDB wants UPPERCASE
- // for other seems not matter
- tableName = tableName.toUpperCase().toLowerCase();
- sqlConstraintPK = sqlConstraintPK.toUpperCase().toLowerCase();
- sqlVCASIDX = sqlVCASIDX.toUpperCase().toLowerCase();
- }
+ // init database metadata
+ final String tn = props.getProperty(TABLE_NAME_PARAM);
+ if (tn != null)
+ {
+ tableName = tn;
+ }
+ else
+ {
+ tableName = DEFAULT_TABLE_NAME;
+ }
- sqlAddRecord = "INSERT INTO " + tableName + " (PROPERTY_ID, ORDER_NUM, CAS_ID) VALUES(?,?,?)";
- sqlDeleteRecord = "DELETE FROM " + tableName + " WHERE PROPERTY_ID=?";
- sqlDeleteValueRecord = "DELETE FROM " + tableName + " WHERE PROPERTY_ID=? AND ORDER_NUM=?";
- sqlSelectRecord = "SELECT CAS_ID FROM " + tableName + " WHERE PROPERTY_ID=? AND ORDER_NUM=?";
- sqlSelectRecords = "SELECT CAS_ID, ORDER_NUM FROM " + tableName + " WHERE PROPERTY_ID=? ORDER BY ORDER_NUM";
+ sqlConstraintPK = tableName + "_PK";
- sqlSelectOwnRecords =
- "SELECT P.CAS_ID, P.ORDER_NUM, S.CAS_ID as SHARED_ID " + "FROM " + tableName + " P LEFT JOIN " + tableName
- + " S ON P.PROPERTY_ID<>S.PROPERTY_ID AND P.CAS_ID=S.CAS_ID "
- + "WHERE P.PROPERTY_ID=? GROUP BY P.CAS_ID, P.ORDER_NUM, S.CAS_ID ORDER BY P.ORDER_NUM";
+ sqlVCASIDX = tableName + "_IDX";
- sqlSelectSharingProps =
- "SELECT DISTINCT C.PROPERTY_ID AS PROPERTY_ID FROM " + tableName + " C, " + tableName + " P "
- + "WHERE C.CAS_ID=P.CAS_ID AND C.PROPERTY_ID<>P.PROPERTY_ID AND P.PROPERTY_ID=?";
+ if (DBConstants.DB_DIALECT_PGSQL.equalsIgnoreCase(dialect)
+ || DBConstants.DB_DIALECT_INGRES.equalsIgnoreCase(dialect))
+ {
+ // use lowercase for postgres/ingres metadata.getTable(), HSQLDB wants UPPERCASE
+ // for other seems not matter
+ tableName = tableName.toUpperCase().toLowerCase();
+ sqlConstraintPK = sqlConstraintPK.toUpperCase().toLowerCase();
+ sqlVCASIDX = sqlVCASIDX.toUpperCase().toLowerCase();
+ }
- // init database objects
- final String sn = props.getProperty(JDBC_SOURCE_NAME_PARAM);
- if (sn != null)
- {
- try
- {
- dataSource = (DataSource)new InitialContext().lookup(sn);
- try
+ sqlAddRecord = "INSERT INTO " + tableName + " (PROPERTY_ID, ORDER_NUM, CAS_ID) VALUES(?,?,?)";
+ sqlDeleteRecord = "DELETE FROM " + tableName + " WHERE PROPERTY_ID=?";
+ sqlDeleteValueRecord = "DELETE FROM " + tableName + " WHERE PROPERTY_ID=? AND ORDER_NUM=?";
+ sqlSelectRecord = "SELECT CAS_ID FROM " + tableName + " WHERE PROPERTY_ID=? AND ORDER_NUM=?";
+ sqlSelectRecords = "SELECT CAS_ID, ORDER_NUM FROM " + tableName + " WHERE PROPERTY_ID=? ORDER BY ORDER_NUM";
+
+ sqlSelectOwnRecords =
+ "SELECT P.CAS_ID, P.ORDER_NUM, S.CAS_ID as SHARED_ID " + "FROM " + tableName + " P LEFT JOIN "
+ + tableName + " S ON P.PROPERTY_ID<>S.PROPERTY_ID AND P.CAS_ID=S.CAS_ID "
+ + "WHERE P.PROPERTY_ID=? GROUP BY P.CAS_ID, P.ORDER_NUM, S.CAS_ID ORDER BY P.ORDER_NUM";
+
+ sqlSelectSharingProps =
+ "SELECT DISTINCT C.PROPERTY_ID AS PROPERTY_ID FROM " + tableName + " C, " + tableName + " P "
+ + "WHERE C.CAS_ID=P.CAS_ID AND C.PROPERTY_ID<>P.PROPERTY_ID AND P.PROPERTY_ID=?";
+
+ // init database objects
+ ResultSet trs = dbMetaData.getTables(null, null, tableName, null);
+ // check if table already exists
+ if (!trs.next())
{
- Connection con = dataSource.getConnection();
- try
- {
- ResultSet trs = con.getMetaData().getTables(null, null, tableName, null);
- // check if table already exists
- if (!trs.next())
- {
- // create table
- con
- .createStatement()
- .executeUpdate(
- "CREATE TABLE "
- + tableName
- + " (PROPERTY_ID VARCHAR(96) NOT NULL, ORDER_NUM INTEGER NOT NULL, CAS_ID VARCHAR(512) NOT NULL, "
- + "CONSTRAINT " + sqlConstraintPK + " PRIMARY KEY(PROPERTY_ID, ORDER_NUM))");
+ // create table
+ conn.createStatement().executeUpdate(
+ "CREATE TABLE " + tableName
+ + " (PROPERTY_ID VARCHAR(96) NOT NULL, ORDER_NUM INTEGER NOT NULL, CAS_ID VARCHAR(512) NOT NULL, "
+ + "CONSTRAINT " + sqlConstraintPK + " PRIMARY KEY(PROPERTY_ID, ORDER_NUM))");
- // create index on hash (CAS_ID)
- con.createStatement().executeUpdate(
- "CREATE INDEX " + sqlVCASIDX + " ON " + tableName + "(CAS_ID, PROPERTY_ID, ORDER_NUM)");
+ // create index on hash (CAS_ID)
+ conn.createStatement().executeUpdate(
+ "CREATE INDEX " + sqlVCASIDX + " ON " + tableName + "(CAS_ID, PROPERTY_ID, ORDER_NUM)");
- if (LOG.isDebugEnabled())
- LOG.debug("JDBC Value Content Address Storage initialized in database " + sn);
- }
- else if (LOG.isDebugEnabled())
- LOG.debug("JDBC Value Content Address Storage already initialized in database " + sn);
- }
- finally
+ if (LOG.isDebugEnabled())
{
- con.close();
+ LOG.debug("JDBC Value Content Address Storage initialized in database " + sn);
}
}
- catch (SQLException e)
+ else if (LOG.isDebugEnabled())
{
- throw new VCASException("VCAS INIT database error: " + e, e);
+ LOG.debug("JDBC Value Content Address Storage already initialized in database " + sn);
}
}
- catch (final NamingException e)
+ catch (SQLException e)
{
- throw new RepositoryConfigurationException("JDBC data source is not available in JNDI with name '" + sn
- + "'. Error: " + e);
+ throw new VCASException("VCAS INIT database error: " + e, e);
}
+ finally
+ {
+ if (conn != null)
+ {
+ try
+ {
+ conn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new VCASException("VCAS INIT database error on Connection close: " + e, e);
+ }
+ }
+ }
}
- else
- throw new RepositoryConfigurationException(JDBC_SOURCE_NAME_PARAM + " parameter should be set");
+ catch (NamingException e)
+ {
+ throw new RepositoryConfigurationException("JDBC data source is not available in JNDI with name '" + sn
+ + "'. Error: " + e);
+ }
}
/**
@@ -274,8 +297,10 @@
return MYSQL_PK_CONSTRAINT_DETECT.matcher(err).find();
}
else if (err.toLowerCase().toUpperCase().indexOf(sqlConstraintPK.toLowerCase().toUpperCase()) >= 0)
+ {
// most of supported dbs prints PK name in exception
return true;
+ }
// NOTICE! As an additional check we may ask the database for property currently processed in
// VCAS
Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml 2010-01-27 16:05:42 UTC (rev 1592)
@@ -30,7 +30,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -77,7 +76,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -116,7 +114,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
Modified: 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 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration-sjdbc.xml 2010-01-27 16:05:42 UTC (rev 1592)
@@ -98,64 +98,65 @@
</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/"/>
+ </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>
+ </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>
+ </init-params>
+ </component-plugin>
+ </component-plugins>
</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/"/>
- </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>
- </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>
- </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>
- </init-params>
+ <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>
+ </init-params>
</component>
<component>
Modified: 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 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2010-01-27 16:05:42 UTC (rev 1592)
@@ -176,7 +176,6 @@
<name>working-conf</name>
<description>working-conf</description>
<property name="source-name" value="jdbcjcr"/>
- <property name="dialect" value="hsqldb"/>
<property name="persister-class-name" value="org.exoplatform.services.jcr.impl.config.JDBCConfigurationPersister"/>
</properties-param>
</init-params>
Modified: 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 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2010-01-27 16:05:42 UTC (rev 1592)
@@ -191,7 +191,6 @@
<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="hsqldb" />
</properties>
<filters>
<filter property-type="Binary" />
Modified: 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 2010-01-27 13:37:35 UTC (rev 1591)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2010-01-27 16:05:42 UTC (rev 1592)
@@ -45,7 +45,6 @@
<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="hsqldb" />
</properties>
<filters>
<filter property-type="Binary" />
@@ -205,7 +204,6 @@
<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="hsqldb" />
</properties>
<filters>
<filter property-type="Binary" />
14 years, 3 months
exo-jcr SVN: r1591 - jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-27 08:37:35 -0500 (Wed, 27 Jan 2010)
New Revision: 1591
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
Log:
EXOJCR-403: fix conf
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml 2010-01-27 13:31:57 UTC (rev 1590)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml 2010-01-27 13:37:35 UTC (rev 1591)
@@ -251,8 +251,8 @@
<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="hsqldb" />
+ <property name="jdbc-source-name" value="jdbcjcr3" />
+ <property name="jdbc-dialect" value="mysql" />
</properties>
<filters>
<filter property-type="Binary" />
14 years, 3 months
exo-jcr SVN: r1590 - jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-01-27 08:31:57 -0500 (Wed, 27 Jan 2010)
New Revision: 1590
Modified:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
Log:
EXOJCR-403 : The workspace configuration was fixed
Modified: 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 2010-01-27 12:58:07 UTC (rev 1589)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2010-01-27 13:31:57 UTC (rev 1590)
@@ -210,8 +210,8 @@
<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="jdbc-dialect" value="hsqldb" />
+ <property name="jdbc-source-name" value="jdbcjcr3" />
+ <property name="jdbc-dialect" value="mysql" />
</properties>
<filters>
<filter property-type="Binary" />
14 years, 3 months
exo-jcr SVN: r1589 - in jcr/trunk/exo.jcr.component.core/src: test/resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-27 07:58:07 -0500 (Wed, 27 Jan 2010)
New Revision: 1589
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
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
Log:
EXOJCR-310 database dialect detection for JDBC data container (but not for VCAS and conf persister yet)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2010-01-27 12:31:50 UTC (rev 1588)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2010-01-27 12:58:07 UTC (rev 1589)
@@ -286,7 +286,7 @@
* DB_DIALECT_HSQLDB.
*/
public final static String DB_DIALECT_HSQLDB = "HSQLDB".intern();
-
+
/**
* DB_DIALECT_DB2.
*/
@@ -316,6 +316,12 @@
* DB_DIALECT_INGRES.
*/
public final static String DB_DIALECT_INGRES = "Ingres".intern();
+
+ /**
+ * DB_DIALECT_H2.
+ */
+ public final static String DB_DIALECT_H2 = "H2".intern();
+
/**
* DB_DIALECTS.
@@ -323,6 +329,6 @@
public final static String[] DB_DIALECTS =
{DB_DIALECT_GENERIC, DB_DIALECT_ORACLE, DB_DIALECT_ORACLEOCI, DB_DIALECT_PGSQL, DB_DIALECT_MYSQL,
DB_DIALECT_HSQLDB, DB_DIALECT_DB2, DB_DIALECT_DB2V8, DB_DIALECT_MSSQL, DB_DIALECT_SYBASE, DB_DIALECT_DERBY,
- DB_DIALECT_MYSQL_UTF8, DB_DIALECT_INGRES};
+ DB_DIALECT_MYSQL_UTF8, DB_DIALECT_INGRES, DB_DIALECT_H2};
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-01-27 12:31:50 UTC (rev 1588)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-01-27 12:58:07 UTC (rev 1589)
@@ -45,6 +45,9 @@
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.DriverManager;
+import java.sql.SQLException;
import javax.jcr.RepositoryException;
import javax.naming.InitialContext;
@@ -190,7 +193,7 @@
String pDbDialect = null;
try
{
- pDbDialect = detectDialect(wsConfig.getContainer().getParameterValue(DB_DIALECT));
+ pDbDialect = validateDialect(wsConfig.getContainer().getParameterValue(DB_DIALECT));
LOG.info("Using a dialect '" + pDbDialect + "'");
}
catch (RepositoryConfigurationException e)
@@ -198,7 +201,6 @@
LOG.info("Using a default dialect '" + DBConstants.DB_DIALECT_GENERIC + "'");
pDbDialect = DBConstants.DB_DIALECT_GENERIC;
}
- this.dbDialect = pDbDialect;
String pDbDriver = null;
String pDbUrl = null;
@@ -233,6 +235,42 @@
this.dbPassword = pDbPassword;
this.dbSourceName = null;
LOG.info("Connect to JCR database as user '" + this.dbUserName + "'");
+
+ if (pDbDialect == DBConstants.DB_DIALECT_GENERIC)
+ {
+ // try to detect via JDBC metadata
+ Connection jdbcConn = null;
+ try
+ {
+ jdbcConn =
+ dbUserName != null ? DriverManager.getConnection(dbUrl, dbUserName, dbPassword) : DriverManager
+ .getConnection(dbUrl);
+
+ this.dbDialect = detectDialect(jdbcConn.getMetaData());
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ finally
+ {
+ if (jdbcConn != null)
+ {
+ try
+ {
+ jdbcConn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+ }
+ }
+ else
+ {
+ this.dbDialect = pDbDialect;
+ }
}
else
{
@@ -252,6 +290,47 @@
// remove in rel.2.0
}
this.dbSourceName = sn;
+
+ if (pDbDialect == DBConstants.DB_DIALECT_GENERIC)
+ {
+ // try to detect via JDBC metadata
+ DataSource ds = (DataSource)new InitialContext().lookup(dbSourceName);
+ if (ds != null)
+ {
+ Connection jdbcConn = null;
+ try
+ {
+ jdbcConn = ds.getConnection();
+ this.dbDialect = detectDialect(jdbcConn.getMetaData());
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ finally
+ {
+ if (jdbcConn != null)
+ {
+ try
+ {
+ jdbcConn.close();
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+ }
+ }
+ else
+ {
+ throw new RepositoryException("Datasource '" + dbSourceName + "' is not bound in this context.");
+ }
+ }
+ else
+ {
+ this.dbDialect = pDbDialect;
+ }
}
// ------------- Values swap config ------------------
@@ -301,6 +380,100 @@
}
/**
+ * Detect databse dialect using JDBC metadata. Based on code of
+ * http://svn.jboss.org/repos/hibernate/core/trunk/core/src/main/java/org/hi...
+ *
+ * @param jdbcConn Connection
+ * @return String
+ * @throws SQLException if error occurs
+ */
+ protected String detectDialect(DatabaseMetaData metaData) throws SQLException
+ {
+ String databaseName = metaData.getDatabaseProductName();
+
+ if ("HSQL Database Engine".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_HSQLDB;
+ }
+
+ if ("H2".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_H2;
+ }
+
+ if ("MySQL".equals(databaseName))
+ {
+ // TODO doesn't detect MySQL_UTF8
+ return DBConstants.DB_DIALECT_MYSQL;
+ }
+
+ if ("PostgreSQL".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_PGSQL;
+ }
+
+ if ("Apache Derby".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_DERBY;
+ }
+
+ if ("ingres".equalsIgnoreCase(databaseName))
+ {
+ return DBConstants.DB_DIALECT_INGRES;
+ }
+
+ if (databaseName.startsWith("Microsoft SQL Server"))
+ {
+ return DBConstants.DB_DIALECT_MSSQL;
+ }
+
+ if ("Sybase SQL Server".equals(databaseName) || "Adaptive Server Enterprise".equals(databaseName))
+ {
+ return DBConstants.DB_DIALECT_SYBASE;
+ }
+
+ if (databaseName.startsWith("Adaptive Server Anywhere"))
+ {
+ // TODO not implemented anything special for
+ return DBConstants.DB_DIALECT_SYBASE;
+ }
+
+ // TODO Informix not supported now
+ //if ( "Informix Dynamic Server".equals( databaseName ) ) {
+ // return new InformixDialect();
+ //}
+
+ if (databaseName.startsWith("DB2/"))
+ {
+ // TODO doesn't detect DB2 v8
+ return DBConstants.DB_DIALECT_DB2;
+ }
+
+ if ("Oracle".equals(databaseName))
+ {
+ // TODO doesn't detect Oracle OCI (experimental support still)
+ return DBConstants.DB_DIALECT_ORACLE;
+
+ // int databaseMajorVersion = metaData.getDatabaseMajorVersion();
+ // switch ( databaseMajorVersion ) {
+ // case 11:
+ // log.warn( "Oracle 11g is not yet fully supported; using 10g dialect" );
+ // return new Oracle10gDialect();
+ // case 10:
+ // return new Oracle10gDialect();
+ // case 9:
+ // return new Oracle9iDialect();
+ // case 8:
+ // return new Oracle8iDialect();
+ // default:
+ // log.warn( "unknown Oracle major version [" + databaseMajorVersion + "]" );
+ // }
+ }
+
+ return DBConstants.DB_DIALECT_GENERIC;
+ }
+
+ /**
* Prepare sefault connection factory.
*
* @return GenericConnectionFactory
@@ -618,12 +791,14 @@
return connFactory;
}
- protected String detectDialect(String confParam)
+ protected String validateDialect(String confParam)
{
for (String dbType : DBConstants.DB_DIALECTS)
{
if (dbType.equalsIgnoreCase(confParam))
+ {
return dbType;
+ }
}
return DBConstants.DB_DIALECT_GENERIC; // by default
Modified: 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 2010-01-27 12:31:50 UTC (rev 1588)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config-sjdbc.xml 2010-01-27 12:58:07 UTC (rev 1589)
@@ -32,7 +32,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -79,7 +78,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -124,7 +122,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -170,7 +167,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -240,7 +236,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -296,7 +291,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -343,7 +337,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="false" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
Modified: 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 2010-01-27 12:31:50 UTC (rev 1588)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2010-01-27 12:58:07 UTC (rev 1589)
@@ -33,7 +33,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -90,7 +89,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr1" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -134,7 +132,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr2" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -180,7 +177,6 @@
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr3" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -264,7 +260,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcrtck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -315,7 +310,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr1tck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
@@ -365,7 +359,6 @@
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcjcr2tck" />
- <property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
<property name="update-storage" value="false" />
<property name="max-buffer-size" value="200k" />
14 years, 3 months
exo-jcr SVN: r1588 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache and 9 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-01-27 07:31:50 -0500 (Wed, 27 Jan 2010)
New Revision: 1588
Added:
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/readme.txt
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-configuration.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-data.tpl.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-indexer.tpl.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-lock.tpl.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.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-jcr-config.xml
Log:
EXOJCR-434: Template in JBossCache configuration is handled in all class now. Template-based configuration created and used parameters names are aligned.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -105,5 +105,5 @@
public static final String PARAM_CHANGES_FILTER_CLASS = "changesfilter-class";
- public static final String PARAM_CHANGES_FILTER_CONFIG_PATH = "changesfilter-config-path";
+ public static final String PARAM_JBOSSCACHE_CONFIGURATION = "jbosscache-configuration";
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManager.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.access.SystemIdentity;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
+import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ChangesLogIterator;
import org.exoplatform.services.jcr.dataflow.CompositeChangesLog;
@@ -59,6 +60,8 @@
import org.jboss.cache.loader.CacheLoader;
import org.picocontainer.Startable;
+import java.io.IOException;
+import java.io.InputStream;
import java.io.Serializable;
import java.math.BigInteger;
import java.security.MessageDigest;
@@ -248,13 +251,27 @@
&& (config.getLockManager().getCacheConfig() != null || (paramenerts != null && config.getLockManager()
.getParameterValue(JBOSSCACCHE_CONFIG, null) != null)))
{
- String pathToConfig =
+ String jbcConfig =
(paramenerts != null && config.getLockManager().getParameterValue(JBOSSCACCHE_CONFIG, null) != null)
? config.getLockManager().getParameterValue(JBOSSCACCHE_CONFIG) : config.getLockManager()
.getCacheConfig();
+
+ // initialize template
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ InputStream configStream;
+ try
+ {
+ // fill template
+ configStream = configurationHelper.fillTemplate(jbcConfig, config.getLockManager().getParameters());
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
- cache = factory.createCache(pathToConfig, false);
+ cache = factory.createCache(configStream, false);
this.tm = transactionManager;
if (transactionManager != null)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -21,6 +21,7 @@
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.config.QueryHandlerParams;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
@@ -40,6 +41,7 @@
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
import java.io.IOException;
+import java.io.InputStream;
import java.io.Serializable;
import java.util.Properties;
import java.util.Set;
@@ -73,10 +75,24 @@
QueryHandler parentHandler) throws IOException, RepositoryException, RepositoryConfigurationException
{
super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
- String jbcConfig = config.getParameterValue(QueryHandlerParams.PARAM_CHANGES_FILTER_CONFIG_PATH);
+ String jbcConfig = config.getParameterValue(QueryHandlerParams.PARAM_JBOSSCACHE_CONFIGURATION);
+
+ // initialize template
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ InputStream configStream;
+ try
+ {
+ // fill template
+ configStream = configurationHelper.fillTemplate(jbcConfig, config.getParameters());
+ }
+ catch (IOException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
log.info("JBoss Cache configuration used: " + jbcConfig);
- this.cache = factory.createCache(jbcConfig, false);
+ this.cache = factory.createCache(configStream, false);
// initialize IndexerCacheLoader
IndexerCacheLoader indexerCacheLoader = new IndexerCacheLoader();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -20,6 +20,8 @@
import org.exoplatform.services.jcr.access.AccessControlList;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.config.SimpleParameterEntry;
+import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
@@ -41,6 +43,9 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -254,36 +259,33 @@
public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, TransactionService transactionService)
throws RepositoryException, RepositoryConfigurationException
{
- this(readJBCConfig(wsConfig), transactionService.getTransactionManager());
- }
+ if (wsConfig.getCache() == null)
+ {
+ throw new RepositoryConfigurationException("Cache configuration not found");
+ }
+ String jbcConfig = wsConfig.getCache().getParameterValue(JBOSSCACHE_CONFIG);
- /**
- * Cache constructor with JBossCache JTA transaction support.
- *
- * @param wsConfig WorkspaceEntry workspace config
- * @throws RepositoryException if error of initialization
- * @throws RepositoryConfigurationException if error of configuration
- */
- public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig) throws RepositoryException,
- RepositoryConfigurationException
- {
- this(readJBCConfig(wsConfig), null);
- }
-
- /**
- * JBossCacheWorkspaceStorageCache constructor.
- *
- */
- public JBossCacheWorkspaceStorageCache(String jbcConfig, TransactionManager transactionManager)
- throws RepositoryException
- {
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
LOG.info("JBoss Cache configuration used: " + jbcConfig);
- this.cache = new BufferedJBossCache(factory.createCache(jbcConfig, false));
- if (transactionManager != null)
+
+ // initialize template
+ TemplateConfigurationHelper configurationHelper = TemplateConfigurationHelper.createJBossCacheHelper();
+ InputStream configStream;
+ try
{
- cache.getConfiguration().getRuntimeConfig().setTransactionManager(transactionManager);
+ // fill template
+ configStream = configurationHelper.fillTemplate(jbcConfig, wsConfig.getCache().getParameters());
}
+ catch (IOException e)
+ {
+ throw new RepositoryConfigurationException(e);
+ }
+
+ this.cache = new BufferedJBossCache(factory.createCache(configStream, false));
+ if (transactionService.getTransactionManager() != null)
+ {
+ cache.getConfiguration().getRuntimeConfig().setTransactionManager(transactionService.getTransactionManager());
+ }
this.itemsRoot = Fqn.fromElements(ITEMS);
this.childNodes = Fqn.fromElements(CHILD_NODES);
@@ -302,6 +304,19 @@
}
/**
+ * Cache constructor with JBossCache JTA transaction support.
+ *
+ * @param wsConfig WorkspaceEntry workspace config
+ * @throws RepositoryException if error of initialization
+ * @throws RepositoryConfigurationException if error of configuration
+ */
+ public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig) throws RepositoryException,
+ RepositoryConfigurationException
+ {
+ this(wsConfig, null);
+ }
+
+ /**
* Checks if node with give FQN not exists and creates resident node.
* @param fqn
*/
@@ -317,7 +332,7 @@
{
cache.getNode(fqn).setResident(true);
}
-
+
}
protected static String readJBCConfig(final WorkspaceEntry wsConfig) throws RepositoryConfigurationException
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/config/TestTemplateConfigurationHelper.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -51,6 +51,23 @@
assertTrue(preparedParameters.containsKey("${jbosscache-cache.loader}"));
assertTrue(preparedParameters.containsKey("${jbosscache-clustername}"));
}
+
+ public void testFilters2()
+ {
+ // create helper with predefined include and exclude patterns
+ TemplateConfigurationHelper helper = TemplateConfigurationHelper.createJBossCacheHelper();
+ 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
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-27 12:31:50 UTC (rev 1588)
@@ -18,10 +18,15 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
+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.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.transaction.TransactionService;
+import java.util.ArrayList;
+
/**
* Created by The eXo Platform SAS.
*
@@ -36,6 +41,13 @@
{
TransactionService transactionService =
(TransactionService)container.getComponentInstanceOfType(TransactionService.class);
- return new JBossCacheWorkspaceStorageCache("conf/standalone/test-jbosscache-config.xml", transactionService == null ? null : transactionService.getTransactionManager());
+
+ ArrayList<SimpleParameterEntry> list = new ArrayList<SimpleParameterEntry>();
+ list.add(new SimpleParameterEntry(JBossCacheWorkspaceStorageCache.JBOSSCACHE_CONFIG, "conf/standalone/test-jbosscache-config.xml"));
+
+ CacheEntry entry = new CacheEntry(list);
+ WorkspaceEntry workspaceEntry = new WorkspaceEntry();
+ workspaceEntry.setCache(entry);
+ return new JBossCacheWorkspaceStorageCache(workspaceEntry, transactionService == null ? null : transactionService);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -75,7 +75,7 @@
<properties>
<property name="index-dir" value="${java.io.tmpdir}/cluster_nfs/db1/ws" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
+ <property name="jbosscache-configuration" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -118,7 +118,7 @@
<properties>
<property name="index-dir" value="${java.io.tmpdir}/cluster_nfs/db1/ws1" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
+ <property name="jbosscache-configuration" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
<property name="max-volatile-time" value="60" />
</properties>
</query-handler>
Modified: 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 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -75,7 +75,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
<property name="max-volatile-time" value="60" />
</properties>
</query-handler>
@@ -117,7 +117,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws1" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
@@ -165,7 +165,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws2" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws2.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws2.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
@@ -228,7 +228,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws3" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws3.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws3.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
@@ -292,7 +292,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
@@ -347,7 +347,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws1" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws1.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws1.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
@@ -401,7 +401,7 @@
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws2" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws2.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws2.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
<property name="synonymprovider-config-path" value="../../../synonyms.properties" />
Modified: 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 2010-01-27 10:47:12 UTC (rev 1587)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -75,7 +75,7 @@
<properties>
<property name="index-dir" value="target/temp/index/db1/ws" />
<!-- property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
- <property name="changesfilter-config-path" value="conf/standalone/test-jbosscache-config.xml" /-->
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config.xml" /-->
</properties>
</query-handler>
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/readme.txt
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/readme.txt (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/readme.txt 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,43 @@
+INFO
+
+This is new, template-based configuration of JCR with JBossCache.
+This configuration uses MySQL database (sql script for creating
+and deleting all needed DBs is shown below).
+
+Currently JBossCache cluster-groups use the same "udp.xml" config
+so lots of warnings can appear on system out from JGroups.
+
+TEMPLATING
+Configuration templates should use variables like:
+"jbosscache-*" or "jgroups-configuration" any other wouldn't be
+inserted into the template.
+
+
+
+DROP DATABASE IF EXISTS portal ;
+create database portal default charset latin1 collate latin1_general_cs;
+DROP DATABASE IF EXISTS jcr ;
+create database jcr default charset latin1 collate latin1_general_cs;
+
+DROP DATABASE IF EXISTS jcr2 ;
+create database jcr2 default charset latin1 collate latin1_general_cs;
+DROP DATABASE IF EXISTS jcr3 ;
+create database jcr3 default charset latin1 collate latin1_general_cs;
+
+DROP DATABASE IF EXISTS jcrtest ;
+create database jcrtest default charset latin1 collate latin1_general_cs;
+DROP DATABASE IF EXISTS portaltck ;
+create database portaltck default charset latin1 collate latin1_general_cs;
+
+DROP DATABASE IF EXISTS jcrtck ;
+create database jcrtck default charset latin1 collate latin1_general_cs;
+DROP DATABASE IF EXISTS jcr2tck;
+create database jcr2tck default charset latin1 collate latin1_general_cs;
+
+DROP DATABASE IF EXISTS jdbcjcr2export1 ;
+create database jdbcjcr2export1 default charset latin1 collate latin1_general_cs;
+DROP DATABASE IF EXISTS jdbcjcr2export2 ;
+create database jdbcjcr2export2 default charset latin1 collate latin1_general_cs;
+
+DROP DATABASE IF EXISTS jdbcjcr2export3 ;
+create database jdbcjcr2export3 default charset latin1 collate latin1_general_cs;
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/readme.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-configuration.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,625 @@
+<?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.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.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.JBossCacheStorageConnection1" value="DEBUG"/>
+
+ <!-- property name="log4j.category.jcr.NodeImpl" 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>
+ <type>org.exoplatform.services.jbosscache.JBossCacheService</type>
+ <init-params>
+ <value-param>
+ <name>jbosscache-configuration</name>
+ <value>conf/portal/exojcr-jboss-cache-conf.xml</value>
+ </value-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/"/>
+ </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>
+ </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/templateBased/test-jcr-config.xml</value>
+ </value-param>
+ <!-- properties-param>
+ <name>working-conf</name>
+ <description>working-conf</description>
+ <property name="source-name" value="jdbcjcr"/>
+ <property name="dialect" value="mysql"/>
+ <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.jboss.cache.transaction.TransactionManagerLookup</key>
+ <type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.jbosscache.ArjunaTransactionService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>300</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>5</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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/portal"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/jcr"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/jcr2"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/jcr3"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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=""/>
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/portaltck"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/jcrtck"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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="com.mysql.jdbc.Driver" />
+ <property name="url" value="jdbc:mysql://localhost/jcr2tck"/>
+ <property name="username" value="root"/>
+ <property name="password" value="admin"/>
+ <property name="maxActive" value="100" />
+ <property name="maxIdle" value="5" />
+ <property name="initialSize" value="5" />
+ </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>
+
+
+ <!-- Resource configuration for UserTransaction
+ use JOTM
+ -->
+ <component-plugin>
+ <name>jotm.tx</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>UserTransaction</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.transaction.UserTransaction</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.objectweb.jotm.UserTransactionFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="jotm.timeout" value="60"/>
+ </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>
+</configuration>
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-configuration.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-data.tpl.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-data.tpl.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-data.tpl.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000"
+ lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig configFile="${jgroups-configuration}" />
+ <sync />
+ </clustering>
+
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="10000" />
+ <property name="timeToLive" value="120000" />
+ </default>
+ </eviction>
+</jbosscache>
\ No newline at end of file
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-data.tpl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-indexer.tpl.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-indexer.tpl.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-indexer.tpl.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="50000"
+ lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+ <!-- Configure the TransactionManager -->
+ <transaction
+ transactionManagerLookupClass="org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig configFile="${jgroups-configuration}" />
+ <sync />
+ </clustering>
+ <!-- Eviction configuration -->
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="10000" />
+ <property name="minTimeToLive" value="60000" />
+ </default>
+ </eviction>
+
+</jbosscache>
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-indexer.tpl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-lock.tpl.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-lock.tpl.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-lock.tpl.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:jboss:jbosscache-core:config:3.2">
+
+ <locking useLockStriping="false" concurrencyLevel="50000"
+ lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <jgroupsConfig configFile="${jgroups-configuration}" />
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <!--
+ For another cache-loader class you should use another template with
+ cache-loader specific parameters
+ -->
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false"
+ fetchPersistentState="false" ignoreModifications="false"
+ purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+
+ </loaders>
+
+</jbosscache>
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jbosscache-lock.tpl.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml 2010-01-27 12:31:50 UTC (rev 1588)
@@ -0,0 +1,506 @@
+<?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.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr" />
+ <property name="dialect" value="mysql" />
+ <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="mysql" />
+ </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>
+ <!-- initializer class="org.exoplatform.services.jcr.impl.core.RestoreWorkspaceInitializer">
+ <properties>
+ <property name="restore-path" value="./sv_export_root.xml" />
+ <property name="restore-path" value="./src/test/resources/import-export/restore_db1_ws1.xml" />
+ </properties>
+ </initializer
+-->
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1-ws" />
+ </properties>
+ </cache>
+ <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir" value="${java.io.tmpdir}/cluster_nfs/db1/ws" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1_ws"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1_ws_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1-ws1" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws1" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1-ws1" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1_ws1"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1_ws1_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/> </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2" lazy-read-threshold="1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1-ws2" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws2" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1-ws2" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1_ws2"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1_ws2_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws3">
+ <!-- for system storage -->
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr3" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </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="jdbc-dialect" value="hsqldb" />
+ </properties>
+ <filters>
+ <filter property-type="Binary" />
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1-ws3" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1-ws3" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1-ws3" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1_ws3"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1_ws3_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </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.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcrtck" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </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="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1tck-ws" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1tck-ws" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1tck_ws"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1tck_ws_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws1">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr1tck" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </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="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1tck-ws1" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws1" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1tck-ws1" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1tck_ws1"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1tck_ws1_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+
+ <workspace name="ws2">
+ <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name" value="jdbcjcr2tck" />
+ <property name="dialect" value="mysql" />
+ <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" />
+ </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="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache">
+ <properties>
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-data.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-db1tck-ws2" />
+ </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="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-indexer.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-indexer-db1tck-ws2" />
+ <property name="max-volatile-time" value="60" />
+ </properties>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManager">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/templateBased/test-jbosscache-lock.tpl.xml" />
+ <property name="jgroups-configuration" value="udp.xml" />
+ <property name="jbosscache-cluster-name" value="JCR-cluster-locks-db1tck-ws2" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks_db1tck_ws2"/>
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_db1tck_ws2_pk"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn"/>
+ <property name="jbosscache-cl-cache.jdbc.fqn.type" value="VARCHAR(512)"/>
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node"/>
+ <property name="jbosscache-cl-cache.jdbc.node.type" value="LONGBLOB"/>
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent"/>
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr"/>
+ </properties>
+ </lock-manager>
+ </workspace>
+ </workspaces>
+ </repository>
+ </repositories>
+</repository-service>
\ No newline at end of file
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/templateBased/test-jcr-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 3 months
exo-jcr SVN: r1587 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/lab/cluster/prepare and 2 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-27 05:47:12 -0500 (Wed, 27 Jan 2010)
New Revision: 1587
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerSingletonStoreCacheLoader.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml
Log:
EXOJCR-433 : The class JbossCacheIndexUpdateMonitor renamed JBossCacheIndexUpdateMonitor and JbossCacheIndexChangesFilter renamed JBossCacheIndexChangesFilter
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -86,7 +86,7 @@
*/
public Object put(Fqn name, Object key, Object value) throws Exception
{
- if (key.equals(JbossCacheIndexChangesFilter.LISTWRAPPER) && value instanceof ChangesFilterListsWrapper)
+ if (key.equals(JBossCacheIndexChangesFilter.LISTWRAPPER) && value instanceof ChangesFilterListsWrapper)
{
if (log.isDebugEnabled())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerSingletonStoreCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerSingletonStoreCacheLoader.java 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerSingletonStoreCacheLoader.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -76,7 +76,7 @@
for (NodeSPI aChildren : children)
{
Fqn<?> fqn = aChildren.getFqn();
- Object value = cache.get(fqn, JbossCacheIndexChangesFilter.LISTWRAPPER);
+ Object value = cache.get(fqn, JBossCacheIndexChangesFilter.LISTWRAPPER);
if (value != null && value instanceof ChangesFilterListsWrapper)
{
// get wrapper object
@@ -91,7 +91,7 @@
}
//TODO: recover logic is here, lists are: removedNodes and addedNodes String id = IdGenerator.generate();
String id = IdGenerator.generate();
- cache.put(id, JbossCacheIndexChangesFilter.LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes,
+ cache.put(id, JBossCacheIndexChangesFilter.LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes,
removedNodes, parentAddedNodes, parentRemovedNodes));
if (debugEnabled)
log.debug("in-memory state passed to cache cacheLoader successfully");
Copied: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java (from rev 1586, jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java)
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -0,0 +1,176 @@
+/*
+ * 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.jbosscache;
+
+import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.QueryHandlerParams;
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
+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.IndexingTree;
+import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
+import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.jcr.util.IdGenerator;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public class JBossCacheIndexChangesFilter extends IndexerChangesFilter
+{
+ /**
+ * Logger instance for this class
+ */
+ private final Log log = ExoLogger.getLogger(JBossCacheIndexChangesFilter.class);
+
+ private final Cache<Serializable, Object> cache;
+
+ public static final String LISTWRAPPER = "$lists".intern();
+
+ /**
+ * @param searchManager
+ * @param config
+ * @param indexingTree
+ * @throws RepositoryConfigurationException
+ */
+ public JBossCacheIndexChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
+ QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
+ QueryHandler parentHandler) throws IOException, RepositoryException, RepositoryConfigurationException
+ {
+ super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
+ String jbcConfig = config.getParameterValue(QueryHandlerParams.PARAM_CHANGES_FILTER_CONFIG_PATH);
+ CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+ log.info("JBoss Cache configuration used: " + jbcConfig);
+ this.cache = factory.createCache(jbcConfig, false);
+
+ // initialize IndexerCacheLoader
+ IndexerCacheLoader indexerCacheLoader = new IndexerCacheLoader();
+ // inject dependencies
+ indexerCacheLoader.init(searchManager, parentSearchManager, handler, parentHandler);
+ // set SingltonStoreCacheLoader
+ SingletonStoreConfig singletonStoreConfig = new SingletonStoreConfig();
+ singletonStoreConfig.setSingletonStoreClass(IndexerSingletonStoreCacheLoader.class.getName());
+ //singletonStoreConfig.setSingletonStoreClass(SingletonStoreCacheLoader.class.getName());
+ Properties singletonStoreProperties = new Properties();
+ singletonStoreProperties.setProperty("pushStateWhenCoordinator", "false");
+ singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout", "10000");
+ singletonStoreConfig.setProperties(singletonStoreProperties);
+ singletonStoreConfig.setSingletonStoreEnabled(true);
+ // create CacheLoaderConfig
+ IndividualCacheLoaderConfig individualCacheLoaderConfig = new IndividualCacheLoaderConfig();
+ // set SingletonStoreConfig
+ individualCacheLoaderConfig.setSingletonStoreConfig(singletonStoreConfig);
+ // set CacheLoader
+ individualCacheLoaderConfig.setCacheLoader(indexerCacheLoader);
+ // set parameters
+ individualCacheLoaderConfig.setFetchPersistentState(false);
+ individualCacheLoaderConfig.setAsync(false);
+ individualCacheLoaderConfig.setIgnoreModifications(false);
+ individualCacheLoaderConfig.setPurgeOnStartup(false);
+ // create CacheLoaderConfig
+ CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
+ cacheLoaderConfig.setShared(false);
+ cacheLoaderConfig.setPassivation(false);
+ cacheLoaderConfig.addIndividualCacheLoaderConfig(individualCacheLoaderConfig);
+ // insert CacheLoaderConfig
+ this.cache.getConfiguration().setCacheLoaderConfig(cacheLoaderConfig);
+ this.cache.create();
+ this.cache.start();
+ // start will invoke cache listener which will notify handler that mode is changed
+ IndexerIoMode ioMode =
+ ((CacheSPI)cache).getRPCManager().isCoordinator() ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY;
+ IndexerIoModeHandler modeHandler = indexerCacheLoader.getModeHandler();
+ handler.setIndexerIoModeHandler(modeHandler);
+ parentHandler.setIndexerIoModeHandler(modeHandler);
+
+ if (!parentHandler.isInitialized())
+ {
+ // TODO: uncomment it, when JbossCacheIndexInfos is finished.
+ parentHandler.setIndexInfos(new JBossCacheIndexInfos(cache, true, modeHandler));
+ parentHandler.setIndexUpdateMonitor(new JBossCacheIndexUpdateMonitor(cache, modeHandler));
+ parentHandler.init();
+ }
+ if (!handler.isInitialized())
+ {
+ // TODO: uncomment it, when JbossCacheIndexInfos is finished.
+ handler.setIndexInfos(new JBossCacheIndexInfos(cache, false, modeHandler));
+ handler.setIndexUpdateMonitor(new JBossCacheIndexUpdateMonitor(cache, modeHandler));
+ handler.init();
+ }
+
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter#doUpdateIndex(java.util.Set, java.util.Set, java.util.Set, java.util.Set)
+ */
+ @Override
+ protected void doUpdateIndex(Set<String> removedNodes, Set<String> addedNodes, Set<String> parentRemovedNodes,
+ Set<String> parentAddedNodes)
+ {
+ String id = IdGenerator.generate();
+ try
+ {
+ cache.put(id, LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes, removedNodes, parentAddedNodes,
+ parentRemovedNodes));
+ }
+ catch (CacheException e)
+ {
+ logErrorChanges(handler, removedNodes, addedNodes);
+ logErrorChanges(parentHandler, parentRemovedNodes, parentAddedNodes);
+ }
+ }
+
+ /**
+ * Log errors
+ * @param logHandler
+ * @param removedNodes
+ * @param addedNodes
+ */
+ private void logErrorChanges(QueryHandler logHandler, Set<String> removedNodes, Set<String> addedNodes)
+ {
+ try
+ {
+
+ logHandler.logErrorChanges(addedNodes, removedNodes);
+ }
+ catch (IOException ioe)
+ {
+ log.warn("Exception occure when errorLog writed. Error log is not complete. " + ioe, ioe);
+ }
+ }
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java (from rev 1586, jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java)
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -0,0 +1,239 @@
+/*
+ * 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.jbosscache;
+
+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.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.lock.LockManager;
+import org.jboss.cache.lock.LockType;
+import org.jboss.cache.notifications.annotation.CacheListener;
+import org.jboss.cache.notifications.annotation.NodeModified;
+import org.jboss.cache.notifications.event.NodeModifiedEvent;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+@CacheListener
+public class JBossCacheIndexUpdateMonitor implements IndexUpdateMonitor, IndexerIoModeListener
+{
+ /**
+ * Logger instance for this class
+ */
+ private final Log log = ExoLogger.getLogger(JBossCacheIndexUpdateMonitor.class);
+
+ private final Cache<Serializable, Object> cache;
+
+ private final static Fqn PARAMETER_ROOT = Fqn.fromString("INDEX_UPDATE_MONITOR");
+
+ private final static String PARAMETER_NAME = "index-update-in-progress";
+
+ public final IndexerIoModeHandler modeHandler;
+
+ /**
+ * The list of all the listeners
+ */
+ private final List<IndexUpdateMonitorListener> listeners;
+
+ /**
+ * @param cache instance of JbossCache that is used to deliver index names
+ */
+ public JBossCacheIndexUpdateMonitor(Cache<Serializable, Object> cache, IndexerIoModeHandler modeHandler)
+ {
+ this.cache = cache;
+ this.modeHandler = modeHandler;
+ this.listeners = new CopyOnWriteArrayList<IndexUpdateMonitorListener>();
+ modeHandler.addIndexerIoModeListener(this);
+ Node<Serializable, Object> cacheRoot = cache.getRoot();
+
+ // prepare cache structures
+ if (!cacheRoot.hasChild(PARAMETER_ROOT))
+ {
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cacheRoot.addChild(PARAMETER_ROOT).setResident(true);
+ }
+ else
+ {
+ cache.getNode(PARAMETER_ROOT).setResident(true);
+ }
+
+ if (IndexerIoMode.READ_WRITE == modeHandler.getMode())
+ {
+ setUpdateInProgress(false);
+ }
+ else
+ {
+ // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
+ cache.addCacheListener(this);
+ }
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
+ */
+ 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.removeCacheListener(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.addCacheListener(this);
+ }
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#getUpdateInProgress()
+ */
+ public boolean getUpdateInProgress()
+ {
+ Object value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
+ return value != null ? (Boolean)value : false;
+ }
+
+ /**
+ * Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
+ * @param name
+ * @return
+ */
+ public boolean isLocked(String name)
+ {
+ LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
+ return lm.isLocked(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)));
+ }
+
+ /**
+ * Acquires a lock of type lockType, for a given owner
+ * @param name
+ * @param lockType
+ * @return
+ * @throws InterruptedException
+ */
+ public boolean lock(String name, LockType lockType)
+ {
+
+ LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
+ try
+ {
+ return lm.lock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), lockType, Integer.MAX_VALUE);
+ }
+ catch (InterruptedException e)
+ {
+ log.warn("An error occurs while tryning to lock the node " + name, e);
+ }
+ return false;
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean)
+ */
+ public void setUpdateInProgress(boolean updateInProgress)
+ {
+ if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
+ {
+ throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
+ }
+ try
+ {
+ cache.put(PARAMETER_ROOT, PARAMETER_NAME, new Boolean(updateInProgress));
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(updateInProgress);
+ }
+
+ }
+ catch (CacheException e)
+ {
+ log.error("Fail to change updateInProgress mode to " + updateInProgress, e);
+ }
+ }
+
+ /**
+ * Releases the lock passed in
+ * @param name
+ */
+ public void unlock(String name)
+ {
+ LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
+ lm.unlock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), cache.getInvocationContext()
+ .getGlobalTransaction());
+ }
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#addIndexUpdateMonitorListener(org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitorListener)
+ */
+ public void addIndexUpdateMonitorListener(IndexUpdateMonitorListener listener)
+ {
+ listeners.add(listener);
+ }
+
+ /**
+ * Called when a node of the cache has been modified. It will be used to trigger events
+ * when the value of <code>updateInProgress</code> has been changed remotely
+ * @param event the event
+ */
+ @NodeModified
+ public void cacheNodeModified(NodeModifiedEvent event)
+ {
+ if (!event.isPre() && event.getFqn().equals(PARAMETER_ROOT))
+ {
+ Object value = null;
+ Map<?, ?> data = event.getData();
+ if (data == null)
+ {
+ log.warn("The data map is empty");
+ }
+ else
+ {
+ value = data.get(PARAMETER_NAME);
+ }
+ if (value == null)
+ {
+ log.warn("The data cannot be found, we will try to get it from the cache");
+ value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
+ }
+ boolean updateInProgress = value != null ? (Boolean)value : false;
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(updateInProgress);
+ }
+ }
+ }
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -1,176 +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.
- */
-package org.exoplatform.services.jcr.impl.core.query.jbosscache;
-
-import org.exoplatform.services.jcr.config.QueryHandlerEntry;
-import org.exoplatform.services.jcr.config.QueryHandlerParams;
-import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter;
-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.IndexingTree;
-import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
-import org.exoplatform.services.jcr.impl.core.query.SearchManager;
-import org.exoplatform.services.jcr.util.IdGenerator;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.config.CacheLoaderConfig;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig.SingletonStoreConfig;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.jcr.RepositoryException;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
- *
- */
-public class JbossCacheIndexChangesFilter extends IndexerChangesFilter
-{
- /**
- * Logger instance for this class
- */
- private final Log log = ExoLogger.getLogger(JbossCacheIndexChangesFilter.class);
-
- private final Cache<Serializable, Object> cache;
-
- public static final String LISTWRAPPER = "$lists".intern();
-
- /**
- * @param searchManager
- * @param config
- * @param indexingTree
- * @throws RepositoryConfigurationException
- */
- public JbossCacheIndexChangesFilter(SearchManager searchManager, SearchManager parentSearchManager,
- QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree parentIndexingTree, QueryHandler handler,
- QueryHandler parentHandler) throws IOException, RepositoryException, RepositoryConfigurationException
- {
- super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
- String jbcConfig = config.getParameterValue(QueryHandlerParams.PARAM_CHANGES_FILTER_CONFIG_PATH);
- CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
- log.info("JBoss Cache configuration used: " + jbcConfig);
- this.cache = factory.createCache(jbcConfig, false);
-
- // initialize IndexerCacheLoader
- IndexerCacheLoader indexerCacheLoader = new IndexerCacheLoader();
- // inject dependencies
- indexerCacheLoader.init(searchManager, parentSearchManager, handler, parentHandler);
- // set SingltonStoreCacheLoader
- SingletonStoreConfig singletonStoreConfig = new SingletonStoreConfig();
- singletonStoreConfig.setSingletonStoreClass(IndexerSingletonStoreCacheLoader.class.getName());
- //singletonStoreConfig.setSingletonStoreClass(SingletonStoreCacheLoader.class.getName());
- Properties singletonStoreProperties = new Properties();
- singletonStoreProperties.setProperty("pushStateWhenCoordinator", "false");
- singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout", "10000");
- singletonStoreConfig.setProperties(singletonStoreProperties);
- singletonStoreConfig.setSingletonStoreEnabled(true);
- // create CacheLoaderConfig
- IndividualCacheLoaderConfig individualCacheLoaderConfig = new IndividualCacheLoaderConfig();
- // set SingletonStoreConfig
- individualCacheLoaderConfig.setSingletonStoreConfig(singletonStoreConfig);
- // set CacheLoader
- individualCacheLoaderConfig.setCacheLoader(indexerCacheLoader);
- // set parameters
- individualCacheLoaderConfig.setFetchPersistentState(false);
- individualCacheLoaderConfig.setAsync(false);
- individualCacheLoaderConfig.setIgnoreModifications(false);
- individualCacheLoaderConfig.setPurgeOnStartup(false);
- // create CacheLoaderConfig
- CacheLoaderConfig cacheLoaderConfig = new CacheLoaderConfig();
- cacheLoaderConfig.setShared(false);
- cacheLoaderConfig.setPassivation(false);
- cacheLoaderConfig.addIndividualCacheLoaderConfig(individualCacheLoaderConfig);
- // insert CacheLoaderConfig
- this.cache.getConfiguration().setCacheLoaderConfig(cacheLoaderConfig);
- this.cache.create();
- this.cache.start();
- // start will invoke cache listener which will notify handler that mode is changed
- IndexerIoMode ioMode =
- ((CacheSPI)cache).getRPCManager().isCoordinator() ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY;
- IndexerIoModeHandler modeHandler = indexerCacheLoader.getModeHandler();
- handler.setIndexerIoModeHandler(modeHandler);
- parentHandler.setIndexerIoModeHandler(modeHandler);
-
- if (!parentHandler.isInitialized())
- {
- // TODO: uncomment it, when JbossCacheIndexInfos is finished.
- parentHandler.setIndexInfos(new JBossCacheIndexInfos(cache, true, modeHandler));
- parentHandler.setIndexUpdateMonitor(new JbossCacheIndexUpdateMonitor(cache, modeHandler));
- parentHandler.init();
- }
- if (!handler.isInitialized())
- {
- // TODO: uncomment it, when JbossCacheIndexInfos is finished.
- handler.setIndexInfos(new JBossCacheIndexInfos(cache, false, modeHandler));
- handler.setIndexUpdateMonitor(new JbossCacheIndexUpdateMonitor(cache, modeHandler));
- handler.init();
- }
-
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter#doUpdateIndex(java.util.Set, java.util.Set, java.util.Set, java.util.Set)
- */
- @Override
- protected void doUpdateIndex(Set<String> removedNodes, Set<String> addedNodes, Set<String> parentRemovedNodes,
- Set<String> parentAddedNodes)
- {
- String id = IdGenerator.generate();
- try
- {
- cache.put(id, LISTWRAPPER, new ChangesFilterListsWrapper(addedNodes, removedNodes, parentAddedNodes,
- parentRemovedNodes));
- }
- catch (CacheException e)
- {
- logErrorChanges(handler, removedNodes, addedNodes);
- logErrorChanges(parentHandler, parentRemovedNodes, parentAddedNodes);
- }
- }
-
- /**
- * Log errors
- * @param logHandler
- * @param removedNodes
- * @param addedNodes
- */
- private void logErrorChanges(QueryHandler logHandler, Set<String> removedNodes, Set<String> addedNodes)
- {
- try
- {
-
- logHandler.logErrorChanges(addedNodes, removedNodes);
- }
- catch (IOException ioe)
- {
- log.warn("Exception occure when errorLog writed. Error log is not complete. " + ioe, ioe);
- }
- }
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -1,239 +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.
- */
-package org.exoplatform.services.jcr.impl.core.query.jbosscache;
-
-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.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.lock.LockManager;
-import org.jboss.cache.lock.LockType;
-import org.jboss.cache.notifications.annotation.CacheListener;
-import org.jboss.cache.notifications.annotation.NodeModified;
-import org.jboss.cache.notifications.event.NodeModifiedEvent;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
- *
- */
-@CacheListener
-public class JbossCacheIndexUpdateMonitor implements IndexUpdateMonitor, IndexerIoModeListener
-{
- /**
- * Logger instance for this class
- */
- private final Log log = ExoLogger.getLogger(JbossCacheIndexUpdateMonitor.class);
-
- private final Cache<Serializable, Object> cache;
-
- private final static Fqn PARAMETER_ROOT = Fqn.fromString("INDEX_UPDATE_MONITOR");
-
- private final static String PARAMETER_NAME = "index-update-in-progress";
-
- public final IndexerIoModeHandler modeHandler;
-
- /**
- * The list of all the listeners
- */
- private final List<IndexUpdateMonitorListener> listeners;
-
- /**
- * @param cache instance of JbossCache that is used to deliver index names
- */
- public JbossCacheIndexUpdateMonitor(Cache<Serializable, Object> cache, IndexerIoModeHandler modeHandler)
- {
- this.cache = cache;
- this.modeHandler = modeHandler;
- this.listeners = new CopyOnWriteArrayList<IndexUpdateMonitorListener>();
- modeHandler.addIndexerIoModeListener(this);
- Node<Serializable, Object> cacheRoot = cache.getRoot();
-
- // prepare cache structures
- if (!cacheRoot.hasChild(PARAMETER_ROOT))
- {
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
- cacheRoot.addChild(PARAMETER_ROOT).setResident(true);
- }
- else
- {
- cache.getNode(PARAMETER_ROOT).setResident(true);
- }
-
- if (IndexerIoMode.READ_WRITE == modeHandler.getMode())
- {
- setUpdateInProgress(false);
- }
- else
- {
- // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
- cache.addCacheListener(this);
- }
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
- */
- 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.removeCacheListener(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.addCacheListener(this);
- }
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#getUpdateInProgress()
- */
- public boolean getUpdateInProgress()
- {
- Object value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
- return value != null ? (Boolean)value : false;
- }
-
- /**
- * Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
- * @param name
- * @return
- */
- public boolean isLocked(String name)
- {
- LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- return lm.isLocked(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)));
- }
-
- /**
- * Acquires a lock of type lockType, for a given owner
- * @param name
- * @param lockType
- * @return
- * @throws InterruptedException
- */
- public boolean lock(String name, LockType lockType)
- {
-
- LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- try
- {
- return lm.lock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), lockType, Integer.MAX_VALUE);
- }
- catch (InterruptedException e)
- {
- log.warn("An error occurs while tryning to lock the node " + name, e);
- }
- return false;
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean)
- */
- public void setUpdateInProgress(boolean updateInProgress)
- {
- if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
- {
- throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
- }
- try
- {
- cache.put(PARAMETER_ROOT, PARAMETER_NAME, new Boolean(updateInProgress));
- for (IndexUpdateMonitorListener listener : listeners)
- {
- listener.onUpdateInProgressChange(updateInProgress);
- }
-
- }
- catch (CacheException e)
- {
- log.error("Fail to change updateInProgress mode to " + updateInProgress, e);
- }
- }
-
- /**
- * Releases the lock passed in
- * @param name
- */
- public void unlock(String name)
- {
- LockManager lm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(LockManager.class);
- lm.unlock(Fqn.fromRelativeFqn(PARAMETER_ROOT, Fqn.fromString(name)), cache.getInvocationContext()
- .getGlobalTransaction());
- }
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#addIndexUpdateMonitorListener(org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitorListener)
- */
- public void addIndexUpdateMonitorListener(IndexUpdateMonitorListener listener)
- {
- listeners.add(listener);
- }
-
- /**
- * Called when a node of the cache has been modified. It will be used to trigger events
- * when the value of <code>updateInProgress</code> has been changed remotely
- * @param event the event
- */
- @NodeModified
- public void cacheNodeModified(NodeModifiedEvent event)
- {
- if (!event.isPre() && event.getFqn().equals(PARAMETER_ROOT))
- {
- Object value = null;
- Map<?, ?> data = event.getData();
- if (data == null)
- {
- log.warn("The data map is empty");
- }
- else
- {
- value = data.get(PARAMETER_NAME);
- }
- if (value == null)
- {
- log.warn("The data cannot be found, we will try to get it from the cache");
- value = cache.get(PARAMETER_ROOT, PARAMETER_NAME);
- }
- boolean updateInProgress = value != null ? (Boolean)value : false;
- for (IndexUpdateMonitorListener listener : listeners)
- {
- listener.onUpdateInProgressChange(updateInProgress);
- }
- }
- }
-}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-27 10:47:12 UTC (rev 1587)
@@ -22,7 +22,7 @@
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.jbosscache.JbossCacheIndexUpdateMonitor;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexUpdateMonitor;
import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -59,7 +59,7 @@
// TODO Auto-generated method stub
super.setUp();
cache = createCache();
- indexUpdateMonitor = new JbossCacheIndexUpdateMonitor(cache, new IndexerIoModeHandler(IndexerIoMode.READ_WRITE));
+ indexUpdateMonitor = new JBossCacheIndexUpdateMonitor(cache, new IndexerIoModeHandler(IndexerIoMode.READ_WRITE));
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/cluster/test-jcr-config.xml 2010-01-27 10:47:12 UTC (rev 1587)
@@ -74,7 +74,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="${java.io.tmpdir}/cluster_nfs/db1/ws" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
<property name="max-volatile-time" value="60" />
@@ -117,7 +117,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="${java.io.tmpdir}/cluster_nfs/db1/ws1" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
<property name="max-volatile-time" value="60" />
</properties>
Modified: 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 2010-01-27 10:22:53 UTC (rev 1586)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jcr-config.xml 2010-01-27 10:47:12 UTC (rev 1587)
@@ -74,7 +74,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws.xml" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -116,7 +116,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws1" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws1.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
@@ -164,7 +164,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws2" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws2.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
@@ -227,7 +227,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1/ws3" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1_ws3.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
@@ -291,7 +291,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
@@ -346,7 +346,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws1" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws1.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
@@ -400,7 +400,7 @@
<query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
<properties>
<property name="index-dir" value="target/cluster_nfs/db1tck/ws2" />
- <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JbossCacheIndexChangesFilter" />
+ <property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.jbosscache.JBossCacheIndexChangesFilter" />
<property name="changesfilter-config-path" value="conf/standalone/cluster/test-jbosscache-indexer-config-exoloader_db1tck_ws2.xml" />
<property name="max-volatile-time" value="60" />
<property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
14 years, 3 months