exo-jcr SVN: r1374 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-13 07:40:36 -0500 (Wed, 13 Jan 2010)
New Revision: 1374
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
Log:
EXOJCR-331 : org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 10:14:17 UTC (rev 1373)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 12:40:36 UTC (rev 1374)
@@ -198,8 +198,8 @@
<component>
<key>org.jboss.cache.transaction.TransactionManagerLookup</key>
- <type>org.jboss.cache.transaction.GenericTransactionManagerLookup</type>
- </component>
+ <type>org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup</type>
+ </component>
<component>
<type>org.exoplatform.services.transaction.jbosscache.JBossTransactionService</type>
16 years, 3 months
exo-jcr SVN: r1373 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: lucene and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-13 05:14:17 -0500 (Wed, 13 Jan 2010)
New Revision: 1373
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitorListener.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-387: Make UpdateInProgress observable
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-01-13 09:34:22 UTC (rev 1372)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -34,6 +34,7 @@
import java.io.IOException;
import java.io.Serializable;
+import java.util.Map;
import java.util.Set;
/**
@@ -111,8 +112,7 @@
}
/**
- *
- * @param mode
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
*/
public void onChangeMode(IndexerIoMode mode)
{
@@ -164,8 +164,22 @@
{
if (!event.isPre() && event.getFqn().equals(namesFqn))
{
- // read from cache to update lists
- Set<String> set = (Set<String>)cache.get(namesFqn, LIST_KEY);
+ Set<String> set = null;
+ Map<?, ?> data = event.getData();
+ if (data == null)
+ {
+ log.warn("The data map is empty");
+ }
+ else
+ {
+ set = (Set<String>)data.get(namesFqn);
+ }
+ if (set == null)
+ {
+ log.warn("The data cannot be found, we will try to get it from the cache");
+ // read from cache to update lists
+ set = (Set<String>)cache.get(namesFqn, LIST_KEY);
+ }
if (set != null)
{
setNames(set);
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-13 09:34:22 UTC (rev 1372)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -20,7 +20,9 @@
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;
@@ -29,15 +31,22 @@
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 $
*
*/
-public class JbossCacheIndexUpdateMonitor implements IndexUpdateMonitor
+@CacheListener
+public class JbossCacheIndexUpdateMonitor implements IndexUpdateMonitor, IndexerIoModeListener
{
/**
* Logger instance for this class
@@ -53,12 +62,19 @@
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
@@ -69,10 +85,33 @@
{
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()
@@ -109,8 +148,7 @@
}
catch (InterruptedException e)
{
- // TODO Auto-generated catch block
- e.printStackTrace();
+ log.warn("An error occurs while tryning to lock the node " + name, e);
}
return false;
}
@@ -125,6 +163,10 @@
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
cache.put(PARAMETER_ROOT, PARAMETER_NAME, new Boolean(updateInProgress));
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(updateInProgress);
+ }
}
/**
@@ -137,4 +179,45 @@
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/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-13 09:34:22 UTC (rev 1372)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -20,6 +20,8 @@
import org.jboss.cache.lock.LockType;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
/**
@@ -29,16 +31,21 @@
*/
public class DefaultIndexUpdateMonitor implements IndexUpdateMonitor
{
- private AtomicBoolean updateInProgress;
-
+ private final AtomicBoolean updateInProgress;
+
/**
+ * The list of all the listeners
+ */
+ private final List<IndexUpdateMonitorListener> listeners;
+
+ /**
* @param semaphore
*/
public DefaultIndexUpdateMonitor()
{
super();
- this.updateInProgress = new AtomicBoolean();
- this.updateInProgress.set(false);
+ this.updateInProgress = new AtomicBoolean(false);
+ this.listeners = new CopyOnWriteArrayList<IndexUpdateMonitorListener>();
}
/**
@@ -57,6 +64,10 @@
public void setUpdateInProgress(boolean updateInProgress)
{
this.updateInProgress.set(updateInProgress);
+ for (IndexUpdateMonitorListener listener : listeners)
+ {
+ listener.onUpdateInProgressChange(updateInProgress);
+ }
}
/**
@@ -82,4 +93,12 @@
return false;
}
+ /**
+ * @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);
+ }
+
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-13 09:34:22 UTC (rev 1372)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -38,6 +38,12 @@
void setUpdateInProgress(boolean updateInProgress);
/**
+ * Adds a new listener of type {@link IndexUpdateMonitorListener}
+ * @param listener the listener to add
+ */
+ void addIndexUpdateMonitorListener(IndexUpdateMonitorListener listener);
+
+ /**
* Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
* @param name
* @return
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitorListener.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitorListener.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitorListener.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -0,0 +1,18 @@
+package org.exoplatform.services.jcr.impl.core.query.lucene;
+
+/**
+ * This interface allows you to execute a given action when the state of the {@link IndexUpdateMonitor}
+ * changes.
+ *
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public interface IndexUpdateMonitorListener
+{
+ /**
+ * This method is called when the flag <code>updateInProgress</code> changes of value
+ * @param updateInProgress the new value of the flag
+ */
+ void onUpdateInProgressChange(boolean updateInProgress);
+}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-13 09:34:22 UTC (rev 1372)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-13 10:14:17 UTC (rev 1373)
@@ -77,7 +77,7 @@
* thread and reader threads is done using {@link #updateMonitor} and
* {@link #updateInProgress}.
*/
-public class MultiIndex implements IndexerIoModeListener
+public class MultiIndex implements IndexerIoModeListener, IndexUpdateMonitorListener
{
/**
@@ -246,6 +246,7 @@
this.indexNames.read();
modeHandler.addIndexerIoModeListener(this);
+ indexUpdateMonitor.addIndexUpdateMonitorListener(this);
// as of 1.5 deletable file is not used anymore
removeDeletable();
@@ -261,9 +262,9 @@
this.indexingQueue = new IndexingQueue(store);
// copy current index names
Set<String> currentNames = new HashSet<String>(indexNames.getNames());
-
+
// open persistent indexes
- for (String name:currentNames)
+ for (String name : currentNames)
{
// only open if it still exists
// it is possible that indexNames still contains a name for
@@ -2398,7 +2399,7 @@
updateMonitor.notifyAll();
releaseMultiReader();
}
-
+
this.redoLog = new RedoLog(indexDir);
redoLogApplied = redoLog.hasEntries();
@@ -2488,4 +2489,30 @@
}
}
}
+
+ /**
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitorListener#onUpdateInProgressChange(boolean)
+ */
+ public void onUpdateInProgressChange(boolean updateInProgress)
+ {
+ if (modeHandler.getMode() == IndexerIoMode.READ_ONLY)
+ {
+ if (!updateInProgress)
+ {
+ // wake up the sleeping threads
+ try
+ {
+ synchronized (updateMonitor)
+ {
+ updateMonitor.notifyAll();
+ releaseMultiReader();
+ }
+ }
+ catch (IOException e)
+ {
+ log.error("An erro occurs while trying to wake up the sleeping threads", e);
+ }
+ }
+ }
+ }
}
16 years, 3 months
exo-jcr SVN: r1372 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-13 04:34:22 -0500 (Wed, 13 Jan 2010)
New Revision: 1372
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
Log:
EXOJCR-334: add GenericTransactionManagerLookup to conf
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 09:23:33 UTC (rev 1371)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 09:34:22 UTC (rev 1372)
@@ -198,7 +198,7 @@
<component>
<key>org.jboss.cache.transaction.TransactionManagerLookup</key>
- <type>org.jboss.cache.transaction.JBossTransactionManagerLookup</type>
+ <type>org.jboss.cache.transaction.GenericTransactionManagerLookup</type>
</component>
<component>
16 years, 3 months
exo-jcr SVN: r1371 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-13 04:23:33 -0500 (Wed, 13 Jan 2010)
New Revision: 1371
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
Log:
EXOJCR-334: add TS to cluster conf
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 08:24:43 UTC (rev 1370)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/cluster/test-configuration.xml 2010-01-13 09:23:33 UTC (rev 1371)
@@ -196,7 +196,16 @@
<type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>
</component>
+ <component>
+ <key>org.jboss.cache.transaction.TransactionManagerLookup</key>
+ <type>org.jboss.cache.transaction.JBossTransactionManagerLookup</type>
+ </component>
+
<component>
+ <type>org.exoplatform.services.transaction.jbosscache.JBossTransactionService</type>
+ </component>
+
+ <component>
<key>org.exoplatform.services.transaction.TransactionService</key>
<type>org.exoplatform.services.transaction.impl.jotm.TransactionServiceJotmImpl</type>
<init-params>
16 years, 3 months
exo-jcr SVN: r1370 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-13 03:24:43 -0500 (Wed, 13 Jan 2010)
New Revision: 1370
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
Log:
EXOJCR-334: add JBossTransactionService
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java 2010-01-13 08:24:43 UTC (rev 1370)
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.transaction.jbosscache;
+
+import org.exoplatform.services.transaction.ExoResource;
+import org.exoplatform.services.transaction.TransactionService;
+import org.jboss.cache.transaction.TransactionManagerLookup;
+
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import javax.transaction.xa.Xid;
+
+/**
+ * @author <a href="mailto:dmitry.kataev@exoplatform.com">Dmytro Katayev</a>
+ * @version $Id$
+ */
+public class JBossTransactionService implements TransactionService
+{
+
+ /**
+ * TransactionManagerLookup.
+ */
+ final protected TransactionManagerLookup tmLookup;
+
+ /**
+ * JBossTransactionManagerLookup constructor.
+ *
+ * @param tmLookup TransactionManagerLookup
+ */
+ public JBossTransactionService(TransactionManagerLookup tmLookup)
+ {
+ this.tmLookup = tmLookup;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Xid createXid()
+ {
+ throw new RuntimeException("Method createXid() not supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void delistResource(ExoResource xares) throws RollbackException, SystemException
+ {
+ throw new RuntimeException("Method delistResource() not supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void enlistResource(ExoResource xares) throws RollbackException, SystemException
+ {
+ throw new RuntimeException("Method enlistResource() not supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getDefaultTimeout()
+ {
+ throw new RuntimeException("Method getDefaultTimeout() not supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TransactionManager getTransactionManager()
+ {
+ try
+ {
+ return tmLookup.getTransactionManager();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Transaction manager not found");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public UserTransaction getUserTransaction()
+ {
+ throw new RuntimeException("Method UserTransaction() not supported");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException
+ {
+ throw new RuntimeException("Method setTransactionTimeout() not supported");
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
16 years, 3 months
exo-jcr SVN: r1369 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 4 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-01-13 03:23:39 -0500 (Wed, 13 Jan 2010)
New Revision: 1369
Removed:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionManagerLookup.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/TCK.sh
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-334: JBossTransactionService refactoring
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/TCK.sh
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/TCK.sh 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/TCK.sh 2010-01-13 08:23:39 UTC (rev 1369)
@@ -1,2 +1,2 @@
-MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dmaven.test.skip=true -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
-mvn $MAVEN_OPTS clean install -Prun-its
\ No newline at end of file
+MAVEN_OPTS="-Duser.language=en -Duser.region=us -Dmaven.test.skip=false -DforkMode=never -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OPTS "
+mvn clean test -Prun-tck
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-13 08:23:39 UTC (rev 1369)
@@ -24,9 +24,10 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
+
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.exoplatform.services.transaction.jbosscache.JBossTransactionService;
import java.util.HashMap;
import java.util.List;
@@ -76,21 +77,15 @@
* System Workspace data container (persistent level)
*/
public CacheableWorkspaceDataManager(WorkspaceDataContainer dataContainer, WorkspaceStorageCache cache,
- SystemDataContainerHolder systemDataContainerHolder)
+ SystemDataContainerHolder systemDataContainerHolder, JBossTransactionService transactionService)
{
super(dataContainer, systemDataContainerHolder);
this.cache = cache;
this.requestCache = new HashMap<Integer, DataRequest>();
addItemPersistenceListener(cache);
- if (cache instanceof JBossCacheWorkspaceStorageCache)
- {
- transactionManager = ((JBossCacheWorkspaceStorageCache)cache).getTransactionManager();
- }
- else
- {
- transactionManager = null;
- }
+
+ transactionManager = transactionService.getTransactionManager();
}
/**
@@ -190,56 +185,48 @@
@Override
public void save(ItemStateChangesLog changesLog) throws RepositoryException
{
- if (transactionManager == null)
+ try
{
+ transactionManager.begin();
+ transactionManager.setTransactionTimeout(90000);
+ cache.beginTransaction();
super.save(changesLog);
+ cache.commitTransaction();
+ transactionManager.commit();
}
- else
+ catch (RollbackException e)
{
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (RepositoryException e)
+ {
try
{
- transactionManager.begin();
- //should be configured from xml in feature
- transactionManager.setTransactionTimeout(90000);
- cache.beginTransaction();
- super.save(changesLog);
- cache.commitTransaction();
- transactionManager.commit();
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (RepositoryException e)
+ throw e;
+ }
+ catch (Exception e)
+ {
+ try
{
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- throw e;
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (Exception e)
+ catch (Exception e1)
{
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e1.getLocalizedMessage(), e1.getCause());
- }
- e.printStackTrace();
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ // Treat the exception
+ throw new RepositoryException(e1.getLocalizedMessage(), e1.getCause());
}
+ e.printStackTrace();
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
// notify listeners after transaction commit
super.notifySaveItems(changesLog, false);
@@ -339,46 +326,38 @@
if (parentData != null)
{
- if (transactionManager == null)
+ try
{
- cache.addChildNodes(parentData, childNodes);
+ if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
+ {
+ cache.addChildNodes(parentData, childNodes);
+ }
+ else
+ {
+ transactionManager.begin();
+ cache.beginTransaction();
+ cache.addChildNodes(parentData, childNodes);
+ cache.commitTransaction();
+ transactionManager.commit();
+ }
}
- else
+ catch (RollbackException e)
{
-
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (Exception e)
+ {
try
{
- if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
- {
- cache.addChildNodes(parentData, childNodes);
- }
- else
- {
- transactionManager.begin();
- cache.beginTransaction();
- cache.addChildNodes(parentData, childNodes);
- cache.commitTransaction();
- transactionManager.commit();
- }
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (Exception e)
- {
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- }
}
}
}
@@ -432,45 +411,38 @@
if (parentData != null)
{
- if (transactionManager == null)
+ try
{
- cache.addChildProperties(parentData, childProperties);
+ if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
+ {
+ cache.addChildProperties(parentData, childProperties);
+ }
+ else
+ {
+ transactionManager.begin();
+ cache.beginTransaction();
+ cache.addChildProperties(parentData, childProperties);
+ cache.commitTransaction();
+ transactionManager.commit();
+ }
}
- else
+ catch (RollbackException e)
{
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (Exception e)
+ {
try
{
- if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
- {
- cache.addChildProperties(parentData, childProperties);
- }
- else
- {
- transactionManager.begin();
- cache.beginTransaction();
- cache.addChildProperties(parentData, childProperties);
- cache.commitTransaction();
- transactionManager.commit();
- }
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (Exception e)
- {
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- }
}
}
}
@@ -500,45 +472,38 @@
data = super.getItemData(parentData, name);
if (data != null && cache.isEnabled())
{
- if (transactionManager == null)
+ try
{
- cache.put(data);
+ if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
+ {
+ cache.put(data);
+ }
+ else
+ {
+ transactionManager.begin();
+ cache.beginTransaction();
+ cache.put(data);
+ cache.commitTransaction();
+ transactionManager.commit();
+ }
}
- else
+ catch (RollbackException e)
{
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (Exception e)
+ {
try
{
- if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
- {
- cache.put(data);
- }
- else
- {
- transactionManager.begin();
- cache.beginTransaction();
- cache.put(data);
- cache.commitTransaction();
- transactionManager.commit();
- }
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (Exception e)
- {
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- }
}
}
return data;
@@ -557,47 +522,39 @@
ItemData data = super.getItemData(identifier);
if (data != null && cache.isEnabled())
{
- if (transactionManager == null)
+ try
{
- cache.put(data);
+ if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
+ {
+ cache.put(data);
+ }
+ else
+ {
+ transactionManager.begin();
+ cache.beginTransaction();
+ cache.put(data);
+ cache.commitTransaction();
+ transactionManager.commit();
+ }
}
- else
+ catch (RollbackException e)
{
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (Exception e)
+ {
try
{
- if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
- {
- cache.put(data);
- }
- else
- {
- transactionManager.begin();
- cache.beginTransaction();
- cache.put(data);
- cache.commitTransaction();
- transactionManager.commit();
- }
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (Exception e)
- {
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- }
}
-
}
return data;
}
@@ -640,45 +597,38 @@
if (parentData != null)
{
- if (transactionManager == null)
+ try
{
- cache.addChildPropertiesList(parentData, propertiesList);
+ if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
+ {
+ cache.addChildPropertiesList(parentData, propertiesList);
+ }
+ else
+ {
+ transactionManager.begin();
+ cache.beginTransaction();
+ cache.addChildPropertiesList(parentData, propertiesList);
+ cache.commitTransaction();
+ transactionManager.commit();
+ }
}
- else
+ catch (RollbackException e)
{
+ // Indicate that the transaction has been rolled back rather than committed.
+ throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
+ }
+ catch (Exception e)
+ {
try
{
- if (transactionManager.getStatus() == Status.STATUS_ACTIVE)
- {
- cache.addChildPropertiesList(parentData, propertiesList);
- }
- else
- {
- transactionManager.begin();
- cache.beginTransaction();
- cache.addChildPropertiesList(parentData, propertiesList);
- cache.commitTransaction();
- transactionManager.commit();
- }
+ cache.rollbackTransaction();
+ transactionManager.rollback();
}
- catch (RollbackException e)
+ catch (Exception e1)
{
- // Indicate that the transaction has been rolled back rather than committed.
+ // Treat the exception
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
- catch (Exception e)
- {
- try
- {
- cache.rollbackTransaction();
- transactionManager.rollback();
- }
- catch (Exception e1)
- {
- // Treat the exception
- throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
- }
- }
}
}
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-13 08:23:39 UTC (rev 1369)
@@ -35,6 +35,7 @@
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.transaction.jbosscache.JBossTransactionService;
import org.jboss.cache.CacheFactory;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -52,6 +53,7 @@
import javax.jcr.RepositoryException;
import javax.transaction.RollbackException;
+import javax.transaction.Status;
import javax.transaction.TransactionManager;
/**
@@ -133,6 +135,11 @@
protected final Fqn<String> refsRoot;
/**
+ * TransactionManager.
+ */
+ private TransactionManager transactionManager;
+
+ /**
* Node order comparator for getChildNodes().
*/
class NodesOrderComparator<N extends NodeData> implements Comparator<NodeData>
@@ -254,17 +261,18 @@
}
}
- public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig) throws RepositoryException,
- RepositoryConfigurationException
+ public JBossCacheWorkspaceStorageCache(WorkspaceEntry wsConfig, JBossTransactionService transactionService)
+ throws RepositoryException, RepositoryConfigurationException
{
- this(readJBCConfig(wsConfig));
+ this(readJBCConfig(wsConfig), transactionService);
}
/**
* JBossCacheWorkspaceStorageCache constructor.
*
*/
- public JBossCacheWorkspaceStorageCache(String jbcConfig) throws RepositoryException
+ public JBossCacheWorkspaceStorageCache(String jbcConfig, JBossTransactionService transactionService)
+ throws RepositoryException
{
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
LOG.info("JBoss Cache configuration used: " + jbcConfig);
@@ -278,12 +286,10 @@
// prepare cache structures
- // TODO transaction
- TransactionManager tm = getTransactionManager();
-
+ transactionManager = transactionService.getTransactionManager();
try
{
- tm.begin();
+ transactionManager.begin();
this.itemsRoot = Fqn.fromElements(ITEMS);
cacheRoot.addChild(this.itemsRoot).setResident(true);
@@ -305,7 +311,7 @@
// TODO apply locks
//this.locks = cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.LOCKS));
- tm.commit();
+ transactionManager.commit();
}
catch (RollbackException e)
{
@@ -316,7 +322,7 @@
{
try
{
- tm.rollback();
+ transactionManager.rollback();
throw new RepositoryException("Cannot preare cache", e);
}
catch (Exception e1)
@@ -340,15 +346,6 @@
}
/**
- * Return TransactionManager.
- * @return TransactionManager.
- */
- public TransactionManager getTransactionManager()
- {
- return cache.getTransactionManager();
- }
-
- /**
* {@inheritDoc}
*/
public void put(ItemData item)
@@ -419,8 +416,8 @@
}
/**
- * {@inheritDoc}
- */
+ * {@inheritDoc}
+ */
public void addChildNodes(NodeData parent, List<NodeData> childs)
{
// remove previous all (to be sure about consistency)
Deleted: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionManagerLookup.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionManagerLookup.java 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionManagerLookup.java 2010-01-13 08:23:39 UTC (rev 1369)
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.transaction.jbosscache;
-
-import org.jboss.cache.transaction.JBossStandaloneJTAManagerLookup;
-import org.jboss.cache.transaction.TransactionManagerLookup;
-
-import javax.transaction.TransactionManager;
-
-/**
- * @author <a href="mailto:dmitry.kataev@exoplatform.com">Dmytro Katayev</a>
- * @version $Id$
- */
-public class JBossTransactionManagerLookup implements TransactionManagerLookup
-{
-
- protected JBossStandaloneJTAManagerLookup jtaManagerLookup;
-
- /**
- *
- */
- public JBossTransactionManagerLookup(JBossStandaloneJTAManagerLookup jtaManagerLookup)
- {
- this.jtaManagerLookup = jtaManagerLookup;
- }
-
- /**
- * {@inheritDoc}
- */
- public TransactionManager getTransactionManager() throws Exception
- {
- return jtaManagerLookup.getTransactionManager();
- }
-
-}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestJBossCacheWorkspaceStorageCache.java 2010-01-13 08:23:39 UTC (rev 1369)
@@ -18,8 +18,10 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.persistent;
+import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
+import org.exoplatform.services.transaction.jbosscache.JBossTransactionService;
/**
* Created by The eXo Platform SAS.
@@ -33,6 +35,8 @@
@Override
public WorkspaceStorageCache getCacheImpl() throws Exception
{
- return new JBossCacheWorkspaceStorageCache("conf/standalone/test-jbosscache-config.xml");
+ JBossTransactionService transactionService =
+ (JBossTransactionService)container.getComponentInstanceOfType(JBossTransactionService.class);
+ return new JBossCacheWorkspaceStorageCache("conf/standalone/test-jbosscache-config.xml", transactionService);
}
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2010-01-12 20:29:54 UTC (rev 1368)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.xml 2010-01-13 08:23:39 UTC (rev 1369)
@@ -194,6 +194,15 @@
<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>
+ <type>org.exoplatform.services.transaction.jbosscache.JBossTransactionService</type>
+ </component>
<component>
<key>org.exoplatform.services.transaction.TransactionService</key>
16 years, 3 months
exo-jcr SVN: r1368 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: lucene and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-12 15:29:54 -0500 (Tue, 12 Jan 2010)
New Revision: 1368
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
Log:
EXOJCR-383: Add a logger to know the current mode
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java 2010-01-12 20:19:27 UTC (rev 1367)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java 2010-01-12 20:29:54 UTC (rev 1368)
@@ -16,6 +16,9 @@
*/
package org.exoplatform.services.jcr.impl.core.query;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -29,6 +32,11 @@
{
/**
+ * The logger instance for this class
+ */
+ private static final Logger log = LoggerFactory.getLogger(IndexerIoModeHandler.class);
+
+ /**
* The current mode
*/
private volatile IndexerIoMode mode;
@@ -44,6 +52,7 @@
*/
public IndexerIoModeHandler(IndexerIoMode mode)
{
+ log.info("Indexer io mode=" + mode);
this.mode = mode;
this.listeners = new CopyOnWriteArrayList<IndexerIoModeListener>();
}
@@ -64,6 +73,7 @@
{
if (this.mode != mode)
{
+ log.info("Indexer io mode=" + mode);
this.mode = mode;
for (IndexerIoModeListener listener : listeners)
{
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-12 20:19:27 UTC (rev 1367)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-12 20:29:54 UTC (rev 1368)
@@ -2354,7 +2354,6 @@
*/
public void onChangeMode(IndexerIoMode mode)
{
- log.info("Indexer io mode=" + mode);
try
{
switch (mode)
16 years, 3 months
exo-jcr SVN: r1367 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache and 3 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-12 15:19:27 -0500 (Tue, 12 Jan 2010)
New Revision: 1367
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeListener.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
Log:
EXOJCR-383: Rework the way to manage the IndexerIoMode
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -65,9 +65,9 @@
private String idleTime;
/**
- * Indexer io mode
+ * The handler of the Indexer io mode
*/
- protected IndexerIoMode ioMode = IndexerIoMode.READ_ONLY;
+ protected IndexerIoModeHandler modeHandler;
/**
* {@link IndexInfos} instance that is passed to {@link MultiIndex}
@@ -82,6 +82,13 @@
}
/**
+ * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoModeHandler(org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler)
+ */
+ public void setIndexerIoModeHandler(IndexerIoModeHandler modeHandler) throws IOException
+ {
+ this.modeHandler = modeHandler;
+ }
+ /**
* @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setContext(org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext)
*/
public void setContext(QueryHandlerContext context)
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/DefaultChangesFilter.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -53,8 +53,9 @@
QueryHandler parentHandler) throws IOException, RepositoryConfigurationException, RepositoryException
{
super(searchManager, parentSearchManager, config, indexingTree, parentIndexingTree, handler, parentHandler);
- handler.setIndexerIoMode(IndexerIoMode.READ_WRITE);
- parentHandler.setIndexerIoMode(IndexerIoMode.READ_WRITE);
+ IndexerIoModeHandler modeHandler = new IndexerIoModeHandler(IndexerIoMode.READ_WRITE);
+ handler.setIndexerIoModeHandler(modeHandler);
+ parentHandler.setIndexerIoModeHandler(modeHandler);
if (!parentHandler.isInitialized())
{
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeHandler.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.exoplatform.services.jcr.impl.core.query;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * This class is used to manage the livecycle of the corresponding {@link IndexerIoMode}
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class IndexerIoModeHandler
+{
+
+ /**
+ * The current mode
+ */
+ private volatile IndexerIoMode mode;
+
+ /**
+ * The list of all the listeners
+ */
+ private final List<IndexerIoModeListener> listeners;
+
+ /**
+ * Initialize the mode
+ * @param mode the initial value of the mode
+ */
+ public IndexerIoModeHandler(IndexerIoMode mode)
+ {
+ this.mode = mode;
+ this.listeners = new CopyOnWriteArrayList<IndexerIoModeListener>();
+ }
+
+ /**
+ * @return the current mode of the indexer
+ */
+ public IndexerIoMode getMode()
+ {
+ return mode;
+ }
+
+ /**
+ * Changes the current mode of the indexer. If the value has changes all the listeners
+ * will be notified
+ */
+ public void setMode(IndexerIoMode mode)
+ {
+ if (this.mode != mode)
+ {
+ this.mode = mode;
+ for (IndexerIoModeListener listener : listeners)
+ {
+ listener.onChangeMode(mode);
+ }
+ }
+ }
+
+ /**
+ * Add a new IndexerIoModeListener to the list of listeners
+ * @param listener the listener to add
+ */
+ public void addIndexerIoModeListener(IndexerIoModeListener listener)
+ {
+ listeners.add(listener);
+ }
+}
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeListener.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeListener.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexerIoModeListener.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.exoplatform.services.jcr.impl.core.query;
+
+/**
+ * This interface describes a IndexerIoModeListener, any time the IndexerIoMode changes
+ * the listeners are notified and the method onChangeMode is called
+ * @author <a href="mailto:nicolas.filotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public interface IndexerIoModeListener
+{
+ /**
+ * The method that we call when the mode has changes
+ * @param mode the new mode of the indexer
+ */
+ void onChangeMode(IndexerIoMode mode);
+}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandler.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.core.query.lucene.DefaultIndexUpdateMonitor;
import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos;
import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor;
import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex;
@@ -136,7 +135,7 @@
*/
void logErrorChanges(Set<String> removed, Set<String> added) throws IOException;
- void setIndexerIoMode(IndexerIoMode ioMode) throws IOException;
+ void setIndexerIoModeHandler(IndexerIoModeHandler handler) throws IOException;
/**
* @return the name of the query class to use.
@@ -154,29 +153,29 @@
* @return the lucene Hits object.
* @throws IOException if an error occurs while searching the index.
*/
- public QueryHits executeQuery(Query query) throws IOException;
+ QueryHits executeQuery(Query query) throws IOException;
/**
* Sets {@link IndexInfos} instance into QueryHandler, which is later passed to {@link MultiIndex}.
*
* @param indexInfos
*/
- public void setIndexInfos(IndexInfos indexInfos);
+ void setIndexInfos(IndexInfos indexInfos);
/**
* Returns {@link IndexInfos} instance that was set into QueryHandler.
* @return
*/
- public IndexInfos getIndexInfos();
+ IndexInfos getIndexInfos();
/**
* @return the indexUpdateMonitor
*/
- public IndexUpdateMonitor getIndexUpdateMonitor();
+ IndexUpdateMonitor getIndexUpdateMonitor();
/**
* @param indexUpdateMonitor the indexUpdateMonitor to set
*/
- public void setIndexUpdateMonitor(IndexUpdateMonitor indexUpdateMonitor);
+ void setIndexUpdateMonitor(IndexUpdateMonitor indexUpdateMonitor);
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -18,11 +18,13 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
+import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler;
import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteOnlyCacheLoader;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.jboss.cache.CacheStatus;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
@@ -49,6 +51,8 @@
private QueryHandler handler;
private QueryHandler parentHandler;
+
+ private volatile IndexerIoModeHandler modeHandler;
/**
* @see org.jboss.cache.loader.AbstractCacheLoader#commit(java.lang.Object)
@@ -134,25 +138,37 @@
*
* @param ioMode
*/
- public void setMode(IndexerIoMode ioMode)
+ void setMode(IndexerIoMode ioMode)
{
- try
+ if (modeHandler != null)
{
- if (handler != null)
+ modeHandler.setMode(ioMode);
+ }
+ }
+
+ /**
+ * Set the mode handler
+ * @param modeHandler
+ */
+ IndexerIoModeHandler getModeHandler()
+ {
+ if (modeHandler == null)
+ {
+ if (cache.getCacheStatus() != CacheStatus.STARTED)
{
- handler.setIndexerIoMode(ioMode);
+ throw new IllegalStateException("The cache should be started first");
}
- if (parentHandler != null)
+ synchronized (this)
{
- parentHandler.setIndexerIoMode(ioMode);
+ if (modeHandler == null)
+ {
+ this.modeHandler = new IndexerIoModeHandler(cache.getRPCManager().isCoordinator() ? IndexerIoMode.READ_WRITE : IndexerIoMode.READ_ONLY);
+ }
}
}
- catch (IOException e)
- {
- log.error("Unable to set indexer mode to " + ioMode, e);
- }
+ return modeHandler;
}
-
+
/**
* Flushes lists of added/removed nodes to SearchManagers, starting indexing.
*
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -19,6 +19,8 @@
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.IndexInfos;
import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex;
import org.exoplatform.services.log.ExoLogger;
@@ -49,7 +51,7 @@
*
*/
@CacheListener
-public class JBossCacheIndexInfos extends IndexInfos
+public class JBossCacheIndexInfos extends IndexInfos implements IndexerIoModeListener
{
private final Log log = ExoLogger.getLogger(this.getClass().getName());
@@ -68,9 +70,9 @@
private boolean system;
/**
- * {@link IndexerIoMode} is used to define current mode.
+ * Used to retrieve the current mode
*/
- private IndexerIoMode ioMode = IndexerIoMode.READ_WRITE;
+ private final IndexerIoModeHandler modeHandler;
/**
* This FQN points to cache node, where list of indexes for this {@link IndexInfos} instance is stored.
@@ -80,27 +82,28 @@
/**
* @param cache instance of JbossCache that is used to deliver index names
*/
- public JBossCacheIndexInfos(Cache<Serializable, Object> cache, boolean system, IndexerIoMode ioMode)
+ public JBossCacheIndexInfos(Cache<Serializable, Object> cache, boolean system, IndexerIoModeHandler modeHandler)
{
- this(DEFALUT_NAME, cache, system, ioMode);
+ this(DEFALUT_NAME, cache, system, modeHandler);
}
/**
* @param fileName where index names are stored.
* @param cache instance of JbossCache that is used to deliver index names
*/
- public JBossCacheIndexInfos(String fileName, Cache<Serializable, Object> cache, boolean system, IndexerIoMode ioMode)
+ public JBossCacheIndexInfos(String fileName, Cache<Serializable, Object> cache, boolean system, IndexerIoModeHandler modeHandler)
{
super(fileName);
this.cache = cache;
- this.ioMode = ioMode;
+ this.modeHandler = modeHandler;
+ modeHandler.addIndexerIoModeListener(this);
// store parsed FQN to avoid it's parsing each time cache event is generated
namesFqn = Fqn.fromString(system ? SYSINDEX_NAMES : INDEX_NAMES);
Node<Serializable, Object> cacheRoot = cache.getRoot();
// prepare cache structures
cacheRoot.addChild(namesFqn).setResident(true);
- if (ioMode == IndexerIoMode.READ_ONLY)
+ if (modeHandler.getMode() == IndexerIoMode.READ_ONLY)
{
// Currently READ_ONLY is set, so new lists should be fired to multiIndex.
cache.addCacheListener(this);
@@ -108,29 +111,31 @@
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos#setIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
+ *
+ * @param mode
*/
- @Override
- public void setIoMode(IndexerIoMode ioMode) throws IOException
+ public void onChangeMode(IndexerIoMode mode)
{
- if (this.ioMode != ioMode)
+ if (mode == IndexerIoMode.READ_WRITE)
{
- log.info("New IoMode:" + ioMode);
- super.setIoMode(ioMode);
- if (ioMode == IndexerIoMode.READ_WRITE)
+ // Now is read-write. Index list is actual and shouldn't be refreshed.
+ // Remove listener to avoid asserting if ioMode is RO on each cache event
+ cache.removeCacheListener(this);
+ // re-read from FS current actual list.
+ try
{
- // Now is read-write. Index list is actual and shouldn't be refreshed.
- // Remove listener to avoid asserting if ioMode is RO on each cache event
- cache.removeCacheListener(this);
- // re-read from FS current actual list.
super.read();
}
- else
+ catch (IOException e)
{
- // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
- cache.addCacheListener(this);
+ log.error("Cannot read the list of indexe names", e);
}
}
+ else
+ {
+ // Currently READ_ONLY is set, so new lists should be fired to multiIndex.
+ cache.addCacheListener(this);
+ }
}
/**
@@ -140,7 +145,7 @@
public void write() throws IOException
{
// if READ_WRITE and is dirty, then flush.
- if (isDirty() && ioMode == IndexerIoMode.READ_WRITE)
+ if (isDirty() && modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
// write to FS
super.write();
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexChangesFilter.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -23,6 +23,7 @@
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;
@@ -112,22 +113,22 @@
// 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);
- handler.setIndexerIoMode(ioMode);
- parentHandler.setIndexerIoMode(ioMode);
-
if (!parentHandler.isInitialized())
{
// TODO: uncomment it, when JbossCacheIndexInfos is finished.
- parentHandler.setIndexInfos(new JBossCacheIndexInfos(cache, true, ioMode));
- parentHandler.setIndexUpdateMonitor(new JbossCacheIndexUpdateMonitor(cache, ioMode));
+ 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, ioMode));
- handler.setIndexUpdateMonitor(new JbossCacheIndexUpdateMonitor(cache, ioMode));
+ handler.setIndexInfos(new JBossCacheIndexInfos(cache, false, modeHandler));
+ handler.setIndexUpdateMonitor(new JbossCacheIndexUpdateMonitor(cache, modeHandler));
handler.init();
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JbossCacheIndexUpdateMonitor.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -19,6 +19,7 @@
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.lucene.IndexUpdateMonitor;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -29,7 +30,6 @@
import org.jboss.cache.lock.LockManager;
import org.jboss.cache.lock.LockType;
-import java.io.IOException;
import java.io.Serializable;
/**
@@ -50,22 +50,22 @@
private final static String PARAMETER_NAME = "index-update-in-progress";
- public IndexerIoMode ioMode;
+ public final IndexerIoModeHandler modeHandler;
/**
* @param cache instance of JbossCache that is used to deliver index names
*/
- public JbossCacheIndexUpdateMonitor(Cache<Serializable, Object> cache, IndexerIoMode ioMode)
+ public JbossCacheIndexUpdateMonitor(Cache<Serializable, Object> cache, IndexerIoModeHandler modeHandler)
{
this.cache = cache;
- this.ioMode = ioMode;
+ this.modeHandler = modeHandler;
Node<Serializable, Object> cacheRoot = cache.getRoot();
// prepare cache structures
cacheRoot.addChild(PARAMETER_ROOT).setResident(true);
- if (IndexerIoMode.READ_WRITE == ioMode)
+ if (IndexerIoMode.READ_WRITE == modeHandler.getMode())
{
setUpdateInProgress(false);
}
@@ -116,21 +116,11 @@
}
/**
- * Sets {@link IndexerIoMode} to indexInfos;
- * @param ioMode
- * @throws IOException
- */
- public void setIoMode(IndexerIoMode ioMode) throws IOException
- {
- this.ioMode = ioMode;
- }
-
- /**
* @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean)
*/
public void setUpdateInProgress(boolean updateInProgress)
{
- if (IndexerIoMode.READ_ONLY == ioMode)
+ if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -18,10 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
-import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.jboss.cache.lock.LockType;
-import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
/**
@@ -33,8 +31,6 @@
{
private AtomicBoolean updateInProgress;
- private IndexerIoMode ioMode;
-
/**
* @param semaphore
*/
@@ -64,14 +60,6 @@
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
- */
- public void setIoMode(IndexerIoMode ioMode) throws IOException
- {
- this.ioMode = ioMode;
- }
-
- /**
* @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#unlock(java.lang.String)
*/
public void unlock(String name)
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -17,7 +17,6 @@
package org.exoplatform.services.jcr.impl.core.query.lucene;
import org.apache.lucene.store.Directory;
-import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexInputStream;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.IndexOutputStream;
@@ -273,16 +272,6 @@
}
/**
- * Sets {@link IndexerIoMode} to indexInfos;
- * @param ioMode
- * @throws IOException
- */
- public void setIoMode(IndexerIoMode ioMode) throws IOException
- {
- // do nothing
- }
-
- /**
* Sets new names, clearing existing. It is thought to be used when list of indexes can
* be externally changed.
*
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -18,11 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.core.query.lucene;
-import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.jboss.cache.lock.LockType;
-import java.io.IOException;
-
/**
* @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 $
@@ -41,13 +38,6 @@
void setUpdateInProgress(boolean updateInProgress);
/**
- * Sets {@link IndexerIoMode} to indexInfos;
- * @param ioMode
- * @throws IOException
- */
- public void setIoMode(IndexerIoMode ioMode) throws IOException;
-
- /**
* Returns true if the node is locked (either for reading or writing) by anyone, and false otherwise.
* @param name
* @return
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -25,6 +25,8 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.Constants;
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.IndexingTree;
import org.exoplatform.services.jcr.impl.core.query.lucene.directory.DirectoryManager;
import org.slf4j.Logger;
@@ -75,7 +77,7 @@
* thread and reader threads is done using {@link #updateMonitor} and
* {@link #updateInProgress}.
*/
-public class MultiIndex
+public class MultiIndex implements IndexerIoModeListener
{
/**
@@ -212,12 +214,12 @@
private final IndexFormatVersion version;
/**
- * Indexer io mode
+ * The handler of the Indexer io mode
*/
- private IndexerIoMode ioMode = IndexerIoMode.READ_ONLY;
+ private final IndexerIoModeHandler modeHandler;
/**
- * Creates a new MultiIndex in READ ONLY MODE! setIndexerIoMode(READ_WRITE) later.
+ * Creates a new MultiIndex.
*
* @param handler
* the search handler
@@ -227,10 +229,10 @@
* @throws IOException
* if an error occurs
*/
- MultiIndex(SearchIndex handler, IndexingTree indexingTree, IndexerIoMode ioMode, IndexInfos indexInfos,
+ MultiIndex(SearchIndex handler, IndexingTree indexingTree, IndexerIoModeHandler modeHandler, IndexInfos indexInfos,
IndexUpdateMonitor indexUpdateMonitor) throws IOException
{
- this.ioMode = ioMode;
+ this.modeHandler = modeHandler;
this.indexUpdateMonitor = indexUpdateMonitor;
this.directoryManager = handler.getDirectoryManager();
this.indexDir = directoryManager.getDirectory(".");
@@ -243,6 +245,7 @@
this.indexNames.setDirectory(indexDir);
this.indexNames.read();
+ modeHandler.addIndexerIoModeListener(this);
// as of 1.5 deletable file is not used anymore
removeDeletable();
@@ -297,7 +300,7 @@
reader.release();
}
indexingQueue.initialize(this);
- if (ioMode == IndexerIoMode.READ_WRITE)
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
setReadWrite();
}
@@ -626,7 +629,7 @@
}
}
- if (ioMode == IndexerIoMode.READ_ONLY)
+ if (modeHandler.getMode() == IndexerIoMode.READ_ONLY)
{
throw new UnsupportedOperationException("Can't create index in READ_ONLY mode.");
}
@@ -2347,20 +2350,14 @@
}
/**
- * Set indexer io mode.
- * @param ioMode
- * @throws IOException
+ * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
*/
- public void setIndexerIoMode(IndexerIoMode ioMode) throws IOException
+ public void onChangeMode(IndexerIoMode mode)
{
- log.info("Indexer io mode=" + ioMode);
- //do some thing if changed
- if (!this.ioMode.equals(ioMode))
+ log.info("Indexer io mode=" + mode);
+ try
{
- this.ioMode = ioMode;
- indexNames.setIoMode(ioMode);
- indexUpdateMonitor.setIoMode(ioMode);
- switch (ioMode)
+ switch (mode)
{
case READ_ONLY :
setReadOny();
@@ -2370,7 +2367,10 @@
break;
}
}
-
+ catch (IOException e)
+ {
+ log.error("An error occurs while changing of mode " + mode, e);
+ }
}
/**
@@ -2392,6 +2392,14 @@
*/
protected void setReadWrite() throws IOException
{
+ // Release all the current threads
+ synchronized (updateMonitor)
+ {
+ indexUpdateMonitor.setUpdateInProgress(false);
+ updateMonitor.notifyAll();
+ releaseMultiReader();
+ }
+
this.redoLog = new RedoLog(indexDir);
redoLogApplied = redoLog.hasEntries();
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -515,9 +515,9 @@
indexingConfig = createIndexingConfiguration(nsMappings);
analyzer.setIndexingConfig(indexingConfig);
- index = new MultiIndex(this, context.getIndexingTree(), ioMode, getIndexInfos(), getIndexUpdateMonitor());
+ index = new MultiIndex(this, context.getIndexingTree(), modeHandler, getIndexInfos(), getIndexUpdateMonitor());
// if RW mode, create initial index and start check
- if (ioMode == IndexerIoMode.READ_WRITE)
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
{
if (index.numDocs() == 0 && context.isCreateInitialIndex())
{
@@ -2641,31 +2641,4 @@
return new LuceneQueryHits(reader, searcher, query);
}
-
- /**
- * @throws IOException
- * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
- */
- public void setIndexerIoMode(IndexerIoMode ioMode) throws IOException
- {
- log.info("Indexer io mode=" + ioMode);
- //do some thing if changed
- if (!this.ioMode.equals(ioMode))
- {
- this.ioMode = ioMode;
- if (index != null)
- {
- switch (ioMode)
- {
- case READ_ONLY :
- index.setIndexerIoMode(ioMode);
- break;
- case READ_WRITE :
- index.setIndexerIoMode(ioMode);
- break;
- }
- }
- }
-
- }
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/lucene/SlowQueryHandler.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -22,7 +22,6 @@
import org.exoplatform.services.jcr.impl.core.SessionImpl;
import org.exoplatform.services.jcr.impl.core.query.AbstractQueryHandler;
import org.exoplatform.services.jcr.impl.core.query.ExecutableQuery;
-import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode;
import org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext;
import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits;
@@ -93,14 +92,4 @@
// TODO Auto-generated method stub
return null;
}
-
- /**
- * @see org.exoplatform.services.jcr.impl.core.query.QueryHandler#setIndexerIoMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode)
- */
- public void setIndexerIoMode(IndexerIoMode ioMode) throws IOException
- {
- // TODO Auto-generated method stub
-
- }
-
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-12 15:04:02 UTC (rev 1366)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-01-12 20:19:27 UTC (rev 1367)
@@ -21,6 +21,7 @@
import junit.framework.TestCase;
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.lucene.IndexUpdateMonitor;
import org.exoplatform.services.log.ExoLogger;
@@ -62,7 +63,7 @@
super.setUp();
cache = createCache();
TransactionManager tm = ((CacheSPI<Serializable, Object>)cache).getTransactionManager();
- indexUpdateMonitor = new JbossCacheIndexUpdateMonitor(cache, IndexerIoMode.READ_WRITE);
+ indexUpdateMonitor = new JbossCacheIndexUpdateMonitor(cache, new IndexerIoModeHandler(IndexerIoMode.READ_WRITE));
}
/**
16 years, 3 months
exo-jcr SVN: r1366 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-12 10:04:02 -0500 (Tue, 12 Jan 2010)
New Revision: 1366
Removed:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.mysql.xml
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.mysql.xml
Log:
EXOJCR-221: mysql test config removed
Deleted: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.mysql.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.mysql.xml 2010-01-12 13:44:52 UTC (rev 1365)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-configuration.mysql.xml 2010-01-12 15:04:02 UTC (rev 1366)
@@ -1,498 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<configuration
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.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.FileCleaner" value="DEBUG"/>
-
- <!-- property name="log4j.category.jcr.JDBCStorageConnection" value="DEBUG"/>
- <property name="log4j.category.jcr.NodeImpl" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.database.DBSchemaCreator" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspaceDataReplicator" value="DEBUG"/ -->
-
- <!-- property name="log4j.category.jcr.WorkspaceStorageCacheImpl" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.WorkspacePersistentDataManager" value="DEBUG"/ -->
- <!-- property name="log4j.category.jcr.SessionDataManager" value="DEBUG"/ -->
- </properties-param>
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedSimpleLog</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.SimpleLogConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>SimpleLog properties</description>
- <property name="org.apache.commons.logging.simplelog.defaultlog" value="debug"/>
- <property name="org.apache.commons.logging.simplelog.showdatetime" value="true"/>
- </properties-param -->
-
- <!-- value-param>
- <name>logger</name>
- <value>org.exoplatform.services.log.impl.BufferedJdk14Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Jdk14Configurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>jdk1.4 Logger properties</description>
- <property name="handlers" value="java.util.logging.ConsoleHandler"/>
- <property name=".level" value="FINE"/>
- <property name="java.util.logging.ConsoleHandler.level" value="FINE"/>
- </properties-param -->
-
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- <component-plugins>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="test" value="http://www.apache.org/jackrabbit/test"/>
- <property name="exojcrtest" value="http://www.exoplatform.org/jcr/test/1.0"/>
- <property name="rma" value="http://www.rma.com/jcr/"/>
- <property name="metadata" value="http://www.exoplatform.com/jcr/metadata/1.1/"/>
- <property name="dc" value="http://purl.org/dc/elements/1.1/"/>
- </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/standalone/test-jcr-config.mysql.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.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:13306/portal" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/jcr1" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/jcr2" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/jcr3" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/portaltck" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/jcrtck" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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:13306/jcr2tck" />
- <property name="username" value="exoadmin" />
- <property name="password" value="exo12321" />
- <property name="maxActive" value="20" />
- <property name="maxIdle" value="5" />
- <property name="initialSize" value="2" />
- </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>
Deleted: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.mysql.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.mysql.xml 2010-01-12 13:44:52 UTC (rev 1365)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/standalone/test-jcr-config.mysql.xml 2010-01-12 15:04:02 UTC (rev 1366)
@@ -1,407 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<repository-service default-repository="db1">
- <repositories>
- <repository name="db1" system-workspace="ws" default-workspace="ws">
- <security-domain>exo-domain</security-domain>
- <!-- access-control>optional</access-control -->
- <!-- access-control>disable</access-control -->
- <session-max-age>1h</session-max-age>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="ws">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- <property name="statistic-period" value="30" />
- <property name="statistic-log" value="false" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock" />
- </properties>
- </persister>
- </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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- </workspace>
-
- <workspace name="ws2">
- <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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- </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="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>
- <cache enabled="true"
- class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler
- class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1/ws3" />
- <property name="synonymprovider-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class"
- value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class"
- value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- </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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/locktck" />
- </properties>
- </persister>
- </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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws1" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- </properties>
- </query-handler>
- </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.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="2k" />
- <property name="live-time" value="20m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="target/temp/index/db1tck/ws2" />
- <property name="synonymprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.PropertiesSynonymProvider" />
- <property name="synonymprovider-config-path" value="../../synonyms.properties" />
- <property name="support-highlighting" value="true" />
- <property name="indexing-configuration-path" value="../../indexing-configuration.xml" />
- <property name="query-class" value="org.exoplatform.services.jcr.impl.core.query.QueryImpl" />
- <property name="spellchecker-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.spell.LuceneSpellChecker$FiveSecondsRefreshInterval" />
- <property name="excerptprovider-class" value="org.exoplatform.services.jcr.impl.core.query.lucene.WeightedHTMLExcerpt"/>
- <property name="extractorPoolSize" value="2"/>
- <property name="extractorTimeout" value="10"/>
- </properties>
- </query-handler>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
16 years, 3 months
exo-jcr SVN: r1365 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-12 08:44:52 -0500 (Tue, 12 Jan 2010)
New Revision: 1365
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
Log:
EXOJCR-331 : setTransactionTimeout(90000)
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-12 13:39:22 UTC (rev 1364)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-12 13:44:52 UTC (rev 1365)
@@ -200,7 +200,7 @@
{
transactionManager.begin();
//should be configured from xml in feature
- transactionManager.setTransactionTimeout(Integer.MAX_VALUE);
+ transactionManager.setTransactionTimeout(90000);
cache.beginTransaction();
super.save(changesLog);
cache.commitTransaction();
16 years, 3 months