Author: nzamosenchuk
Date: 2010-01-28 03:55:39 -0500 (Thu, 28 Jan 2010)
New Revision: 1599
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/query/jbosscache/JBossCacheIndexChangesFilter.java
Log:
EXOJCR-436: Added programmatically handled parameters:
"jbosscache-sscl-push.state.enabled"
"jbosscache-sscl-push.state.timeout". They are not present in templates but
handled, because singletonStore cache loader is configured in code, but not through 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/config/QueryHandlerParams.java 2010-01-28
08:41:58 UTC (rev 1598)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/QueryHandlerParams.java 2010-01-28
08:55:39 UTC (rev 1599)
@@ -106,4 +106,8 @@
public static final String PARAM_CHANGES_FILTER_CLASS =
"changesfilter-class";
public static final String PARAM_JBOSSCACHE_CONFIGURATION =
"jbosscache-configuration";
+
+ public static final String PARAM_JBOSSCACHE_PUSHSTATE =
"jbosscache-sscl-push.state.enabled";
+
+ public static final String PARAM_JBOSSCACHE_PUSHSTATE_TIMEOUT =
"jbosscache-sscl-push.state.timeout";
}
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-28
08:41:58 UTC (rev 1598)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-01-28
08:55:39 UTC (rev 1599)
@@ -73,7 +73,8 @@
*/
public JBossCacheIndexChangesFilter(SearchManager searchManager, SearchManager
parentSearchManager,
QueryHandlerEntry config, IndexingTree indexingTree, IndexingTree
parentIndexingTree, QueryHandler handler,
- QueryHandler parentHandler, ConfigurationManager cfm) throws IOException,
RepositoryException, RepositoryConfigurationException
+ QueryHandler parentHandler, ConfigurationManager cfm) throws IOException,
RepositoryException,
+ RepositoryConfigurationException
{
super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree,
handler, parentHandler, cfm);
String jbcConfig =
config.getParameterValue(QueryHandlerParams.PARAM_JBOSSCACHE_CONFIGURATION);
@@ -104,8 +105,13 @@
singletonStoreConfig.setSingletonStoreClass(IndexerSingletonStoreCacheLoader.class.getName());
//singletonStoreConfig.setSingletonStoreClass(SingletonStoreCacheLoader.class.getName());
Properties singletonStoreProperties = new Properties();
- singletonStoreProperties.setProperty("pushStateWhenCoordinator",
"false");
- singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout",
"10000");
+
+ // try to get pushState parameters, since they are set programmatically only
+ Boolean pushState =
config.getParameterBoolean(QueryHandlerParams.PARAM_JBOSSCACHE_PUSHSTATE, false);
+ Integer pushStateTimeOut =
config.getParameterInteger(QueryHandlerParams.PARAM_JBOSSCACHE_PUSHSTATE, 10000);
+
+ singletonStoreProperties.setProperty("pushStateWhenCoordinator",
pushState.toString());
+ singletonStoreProperties.setProperty("pushStateWhenCoordinatorTimeout",
pushStateTimeOut.toString());
singletonStoreConfig.setProperties(singletonStoreProperties);
singletonStoreConfig.setSingletonStoreEnabled(true);
// create CacheLoaderConfig
@@ -137,14 +143,12 @@
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();