exo-jcr SVN: r5949 - jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 09:14:54 -0400 (Fri, 23 Mar 2012)
New Revision: 5949
Modified:
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
Log:
JCR-1717 : use atomicBoolean instead of volatile boolean
Modified: jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-23 12:38:34 UTC (rev 5948)
+++ jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-23 13:14:54 UTC (rev 5949)
@@ -1,6 +1,6 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (working copy)
@@ -20,6 +20,7 @@
@@ -21,7 +21,7 @@
void addItemPersistenceListener(ItemsPersistenceListener listener);
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
@@ -39,6 +39,9 @@
import org.exoplatform.services.jcr.datamodel.QPath;
@@ -33,7 +33,15 @@
import org.exoplatform.services.jcr.impl.core.LocationFactory;
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
-@@ -86,7 +89,7 @@
+@@ -69,6 +72,7 @@
+ import java.util.NoSuchElementException;
+ import java.util.Set;
+ import java.util.StringTokenizer;
++import java.util.concurrent.atomic.AtomicBoolean;
+
+ import javax.jcr.Node;
+ import javax.jcr.PropertyType;
+@@ -86,7 +90,7 @@
* @version $Id: SearchManager.java 1008 2009-12-11 15:14:51Z nzamosenchuk $
*/
@NonVolatile
@@ -42,19 +50,114 @@
{
/**
-@@ -136,6 +139,11 @@
+@@ -135,7 +139,12 @@
+ protected LuceneVirtualTableResolver virtualTableResolver;
protected IndexerChangesFilter changesFilter;
-
+-
++
+ /**
+ * Indicates if component suspended or not.
+ */
-+ protected volatile boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
private final ExoContainerContext ctx;
/**
-@@ -856,4 +864,62 @@
+@@ -164,8 +173,8 @@
+ * @throws RepositoryConfigurationException
+ */
+
+- public SearchManager(ExoContainerContext ctx, QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
+- WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder parentSearchManager,
++ public SearchManager(ExoContainerContext ctx, QueryHandlerEntry config, NamespaceRegistryImpl nsReg,
++ NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder parentSearchManager,
+ DocumentReaderService extractor, ConfigurationManager cfm, final RepositoryIndexSearcherHolder indexSearcherHolder)
+ throws RepositoryException, RepositoryConfigurationException
+ {
+@@ -276,7 +285,9 @@
+ try
+ {
+ if (reader != null)
++ {
+ reader.close();
++ }
+ }
+ catch (IOException e)
+ {
+@@ -389,7 +400,9 @@
+ {
+
+ if (log.isDebugEnabled())
++ {
+ log.debug("start");
++ }
+ try
+ {
+ if (indexingTree == null)
+@@ -411,7 +424,9 @@
+ {
+ ItemData excludeData = itemMgr.getItemData(stringTokenizer.nextToken());
+ if (excludeData != null)
++ {
+ excludedPath.add(excludeData.getQPath());
++ }
+ }
+ catch (RepositoryException e)
+ {
+@@ -428,7 +443,9 @@
+ {
+ ItemData indexingRootDataItem = itemMgr.getItemData(rootNodeIdentifer);
+ if (indexingRootDataItem != null && indexingRootDataItem.isNode())
++ {
+ indexingRootData = (NodeData)indexingRootDataItem;
++ }
+ }
+ catch (RepositoryException e)
+ {
+@@ -509,14 +526,20 @@
+ if (item.isNode())
+ {
+ if (!indexingTree.isExcluded(item))
++ {
+ return (NodeData)item;
++ }
+ }
+ else
++ {
+ log.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
+ + " found. ");
++ }
+ }
+ else
++ {
+ log.warn("Unable to index node with id " + id + ", node does not exist.");
++ }
+
+ }
+ catch (RepositoryException e)
+@@ -667,8 +690,8 @@
+ if (parentSearchManager != null)
+ {
+ newChangesFilter =
+- constuctor.newInstance(this, parentSearchManager, config, indexingTree, parentSearchManager
+- .getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
++ constuctor.newInstance(this, parentSearchManager, config, indexingTree,
++ parentSearchManager.getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
+ }
+ }
+ catch (SecurityException e)
+@@ -715,7 +738,9 @@
+ // initialize query handler
+ String className = config.getType();
+ if (className == null)
++ {
+ throw new RepositoryConfigurationException("Content hanler configuration fail");
++ }
+
+ try
+ {
+@@ -856,4 +881,62 @@
return false;
}
@@ -71,7 +174,7 @@
+ */
+ public boolean isSuspended()
+ {
-+ return isSuspended;
++ return isSuspended.get();
+ }
+
+ /**
@@ -84,27 +187,27 @@
+
+ protected void suspendLocally() throws SuspendException
+ {
-+ if (!isSuspended)
++ if (!isSuspended.get())
+ {
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).suspend();
+ }
+
-+ isSuspended = true;
++ isSuspended.set(true);
+ }
+ }
+
+ protected void resumeLocally() throws ResumeException
+ {
-+ if (isSuspended)
++ if (isSuspended.get())
+ {
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).resume();
+ }
+
-+ isSuspended = false;
++ isSuspended.set(false);
+ }
+ }
+
@@ -119,7 +222,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
@@ -45,6 +45,9 @@
import org.exoplatform.services.jcr.datamodel.PropertyData;
@@ -131,15 +234,16 @@
import org.exoplatform.services.jcr.impl.core.LocationFactory;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-@@ -78,6 +81,7 @@
+@@ -78,6 +81,8 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.atomic.AtomicBoolean;
import javax.jcr.RepositoryException;
import javax.jcr.query.InvalidQueryException;
-@@ -89,7 +93,7 @@
+@@ -89,7 +94,7 @@
* Implements a {@link org.apache.jackrabbit.core.query.QueryHandler} using
* Lucene.
*/
@@ -148,7 +252,7 @@
{
private static final DefaultQueryNodeFactory DEFAULT_QUERY_NODE_FACTORY = new DefaultQueryNodeFactory();
-@@ -448,6 +452,16 @@
+@@ -448,6 +453,16 @@
private final ConfigurationManager cfm;
/**
@@ -159,13 +263,13 @@
+ /**
+ * Indicates if component suspended or not.
+ */
-+ protected volatile boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
+ /**
* Working constructor.
*
* @throws RepositoryConfigurationException
-@@ -819,26 +833,29 @@
+@@ -819,26 +834,29 @@
*/
public void close()
{
@@ -209,7 +313,7 @@
}
/**
-@@ -866,6 +883,8 @@
+@@ -866,6 +884,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -218,7 +322,7 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -914,6 +933,8 @@
+@@ -914,6 +934,8 @@
public MultiColumnQueryHits executeQuery(SessionImpl session, MultiColumnQuery query, QPath[] orderProps,
boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
{
@@ -227,7 +331,7 @@
checkOpen();
Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
-@@ -2710,6 +2731,8 @@
+@@ -2710,6 +2732,8 @@
*/
public QueryHits executeQuery(Query query) throws IOException
{
@@ -236,7 +340,7 @@
checkOpen();
IndexReader reader = getIndexReader(true);
-@@ -2742,4 +2765,76 @@
+@@ -2742,4 +2766,76 @@
log.error("Can not recover error log.", e);
}
}
@@ -249,7 +353,7 @@
+ latcher = new CountDownLatch(1);
+ close();
+
-+ isSuspended = true;
++ isSuspended.set(true);
+ }
+
+ /**
@@ -264,7 +368,7 @@
+
+ latcher.countDown();
+
-+ isSuspended = false;
++ isSuspended.set(false);
+ }
+ catch (IOException e)
+ {
@@ -281,7 +385,7 @@
+ */
+ public boolean isSuspended()
+ {
-+ return isSuspended;
++ return isSuspended.get();
+ }
+
+ /**
@@ -292,7 +396,7 @@
+ */
+ private void waitForResuming() throws IOException
+ {
-+ if (isSuspended)
++ if (isSuspended.get())
+ {
+ try
+ {
@@ -315,7 +419,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
@@ -177,7 +177,7 @@
/**
@@ -640,7 +744,7 @@
}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (working copy)
@@ -137,6 +137,11 @@
private int state = OFFLINE;
@@ -788,7 +892,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
@@ -30,6 +30,9 @@
import org.exoplatform.services.jcr.datamodel.QPathEntry;
@@ -800,15 +904,16 @@
import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
-@@ -41,6 +44,7 @@
+@@ -41,6 +44,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.jcr.RepositoryException;
import javax.transaction.TransactionManager;
-@@ -54,7 +58,7 @@
+@@ -54,7 +59,7 @@
*
* @version $Id$
*/
@@ -817,7 +922,7 @@
{
/**
-@@ -70,6 +74,21 @@
+@@ -70,6 +75,21 @@
private TransactionManager transactionManager;
/**
@@ -828,7 +933,7 @@
+ /**
+ * Indicates if component suspended or not.
+ */
-+ protected volatile boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
+ /**
+ * Allows to make all threads waiting until resume.
@@ -839,11 +944,11 @@
* ItemData request, used on get operations.
*
*/
-@@ -536,6 +555,39 @@
+@@ -536,6 +556,39 @@
@Override
public void save(final ItemStateChangesLog changesLog) throws RepositoryException
{
-+ if (isSuspended)
++ if (isSuspended.get())
+ {
+ try
+ {
@@ -864,7 +969,7 @@
+ {
+ workingThreads.decrementAndGet();
+
-+ if (isSuspended && workingThreads.get() == 0)
++ if (isSuspended.get() && workingThreads.get() == 0)
+ {
+ synchronized (workingThreads)
+ {
@@ -879,7 +984,7 @@
if (isTxAware())
{
// save in dedicated XA transaction
-@@ -952,4 +1004,75 @@
+@@ -952,4 +1005,75 @@
conn.close();
}
}
@@ -907,15 +1012,15 @@
+ */
+ public boolean isSuspended()
+ {
-+ return isSuspended;
++ return isSuspended.get();
+ }
+
+ private void suspendLocally() throws SuspendException
+ {
-+ if (!isSuspended)
++ if (!isSuspended.get())
+ {
+ latcher = new CountDownLatch(1);
-+ isSuspended = true;
++ isSuspended.set(true);
+
+ if (workingThreads.get() > 0)
+ {
@@ -942,10 +1047,10 @@
+
+ private void resumeLocally() throws ResumeException
+ {
-+ if (isSuspended)
++ if (isSuspended.get())
+ {
+ latcher.countDown();
-+ isSuspended = false;
++ isSuspended.set(false);
+ }
+ }
+
@@ -959,7 +1064,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (working copy)
@@ -29,6 +29,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
@@ -1211,7 +1316,7 @@
+}
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (working copy)
@@ -62,6 +62,16 @@
final int READONLY = 2;
@@ -1242,7 +1347,7 @@
Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
===================================================================
---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5937)
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5948)
+++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (working copy)
@@ -18,8 +18,18 @@
*/
12 years, 1 month
exo-jcr SVN: r5948 - in jcr/branches/1.14.x/patch/1.14.8-GA: JCR-1725 and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 08:38:34 -0400 (Fri, 23 Mar 2012)
New Revision: 5948
Added:
jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/
jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
Log:
JCR-1725 : patch proposed
Added: jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch
===================================================================
--- jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch (rev 0)
+++ jcr/branches/1.14.x/patch/1.14.8-GA/JCR-1725/JCR-1725.patch 2012-03-23 12:38:34 UTC (rev 5948)
@@ -0,0 +1,341 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5945)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
+@@ -81,8 +81,19 @@
+ import java.lang.reflect.Constructor;
+ import java.lang.reflect.InvocationTargetException;
+ import java.security.PrivilegedAction;
+-import java.util.*;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collection;
++import java.util.Collections;
++import java.util.HashMap;
++import java.util.HashSet;
++import java.util.Iterator;
++import java.util.LinkedHashSet;
++import java.util.List;
++import java.util.Map;
++import java.util.Set;
+ import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.atomic.AtomicBoolean;
+
+ import javax.jcr.RepositoryException;
+ import javax.jcr.query.InvalidQueryException;
+@@ -202,7 +213,7 @@
+ * Default name of the error log file
+ */
+ private static final String ERROR_LOG = "error.log";
+-
++
+ /**
+ * The actual index
+ */
+@@ -521,7 +532,7 @@
+ /**
+ * Indicates if component suspended or not.
+ */
+- protected boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
+ protected final Set<String> recoveryFilterClasses;
+
+@@ -674,10 +685,9 @@
+ }
+ catch (IOException e)
+ {
+- log
+- .error(
+- "Error while reindexing the workspace. Please fix the problem, delete index and restart server.",
+- e);
++ log.error(
++ "Error while reindexing the workspace. Please fix the problem, delete index and restart server.",
++ e);
+ }
+ }
+ }, "Reindexing-" + context.getRepositoryName() + "-" + context.getContainer().getWorkspaceName()).start();
+@@ -1120,8 +1130,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString(), e);
+ }
+ return doc;
+ }
+@@ -1148,8 +1157,7 @@
+ }
+ catch (RepositoryException e)
+ {
+- log
+- .warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
++ log.warn("Exception while creating document for node: " + state.getIdentifier() + ": " + e.toString());
+ }
+ return null;
+ }
+@@ -2029,8 +2037,7 @@
+ catch (Exception e)
+ {
+ // do not fail if aggregate cannot be created
+- log
+- .warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
++ log.warn("Exception while building indexing aggregate for" + " node with UUID: " + state.getIdentifier(), e);
+ }
+ }
+ }
+@@ -3383,7 +3390,7 @@
+ latcher = new CountDownLatch(1);
+ close();
+
+- isSuspended = true;
++ isSuspended.set(true);
+ }
+
+ /**
+@@ -3398,7 +3405,7 @@
+
+ latcher.countDown();
+
+- isSuspended = false;
++ isSuspended.set(false);
+ }
+ catch (IOException e)
+ {
+@@ -3415,7 +3422,7 @@
+ */
+ public boolean isSuspended()
+ {
+- return isSuspended;
++ return isSuspended.get();
+ }
+
+ /**
+@@ -3426,7 +3433,7 @@
+ */
+ private void waitForResuming() throws IOException
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ try
+ {
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5945)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
+@@ -1388,15 +1388,6 @@
+ */
+ void close()
+ {
+- // stop index merger
+- // when calling this method we must not lock this MultiIndex, otherwise
+- // a deadlock might occur
+- if (merger != null)
+- {
+- merger.dispose();
+- merger = null;
+- }
+-
+ synchronized (this)
+ {
+ // stop timer
+@@ -1465,6 +1456,14 @@
+ }
+ });
+ }
++ // stop index merger after all possible flushes.
++ // when calling this method we must not lock this MultiIndex, otherwise
++ // a deadlock might occur
++ if (merger != null)
++ {
++ merger.dispose();
++ merger = null;
++ }
+ }
+
+ /**
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5945)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
+@@ -104,6 +104,7 @@
+ import java.util.NoSuchElementException;
+ import java.util.Set;
+ import java.util.StringTokenizer;
++import java.util.concurrent.atomic.AtomicBoolean;
+
+ import javax.jcr.Node;
+ import javax.jcr.PropertyType;
+@@ -212,7 +213,7 @@
+ /**
+ * Indicates if component suspended or not.
+ */
+- protected boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
+ /**
+ * Indicates that node keep responsible for resuming.
+@@ -403,7 +404,7 @@
+ public void checkIndex(final InspectionReport report, final boolean isSystem) throws RepositoryException,
+ IOException
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ try
+ {
+@@ -414,7 +415,7 @@
+ // try resuming the workspace
+ try
+ {
+- if (isSystem && parentSearchManager != null && parentSearchManager.isSuspended)
++ if (isSystem && parentSearchManager != null && parentSearchManager.isSuspended.get())
+ {
+ parentSearchManager.resume();
+ }
+@@ -433,7 +434,7 @@
+ try
+ {
+ suspend();
+- if (isSystem && parentSearchManager != null && !parentSearchManager.isSuspended)
++ if (isSystem && parentSearchManager != null && !parentSearchManager.isSuspended.get())
+ {
+ parentSearchManager.suspend();
+ }
+@@ -1228,7 +1229,7 @@
+ */
+ public boolean isSuspended()
+ {
+- return isSuspended;
++ return isSuspended.get();
+ }
+
+ /**
+@@ -1303,10 +1304,10 @@
+ throw new IllegalStateException(
+ "Index is not in READ_WRITE mode and reindexing can't be launched. Please start reindexing on coordinator node.");
+ }
+- if (isSuspended || !handler.isOnline())
++ if (isSuspended.get() || !handler.isOnline())
+ {
+ throw new IllegalStateException("Can't start reindexing while index is "
+- + ((isSuspended) ? "SUSPENDED." : "already OFFLINE (it means that reindexing is in progress).") + ".");
++ + ((isSuspended.get()) ? "SUSPENDED." : "already OFFLINE (it means that reindexing is in progress).") + ".");
+ }
+
+ log.info("Starting hot reindexing on the " + handler.getContext().getRepositoryName() + "/"
+@@ -1542,27 +1543,27 @@
+ throw new SuspendException("Can't suspend index, while reindexing in progeress.");
+ }
+
+- if (!isSuspended)
++ if (!isSuspended.get())
+ {
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).suspend();
+ }
+
+- isSuspended = true;
++ isSuspended.set(true);
+ }
+ }
+
+ protected void resumeLocally() throws ResumeException
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).resume();
+ }
+
+- isSuspended = false;
++ isSuspended.set(false);
+ }
+ }
+
+@@ -1571,7 +1572,7 @@
+ */
+ public void onChange(TopologyChangeEvent event)
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ new Thread()
+ {
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5945)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
+@@ -141,7 +141,7 @@
+ /**
+ * Indicates if component suspended or not.
+ */
+- protected boolean isSuspended = false;
++ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
+
+ /**
+ * Allows to make all threads waiting until resume.
+@@ -927,7 +927,7 @@
+ */
+ public void save(final ItemStateChangesLog changesLog) throws RepositoryException
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ try
+ {
+@@ -971,7 +971,7 @@
+ {
+ workingThreads.decrementAndGet();
+
+- if (isSuspended && workingThreads.get() == 0)
++ if (isSuspended.get() && workingThreads.get() == 0)
+ {
+ synchronized (workingThreads)
+ {
+@@ -1987,15 +1987,15 @@
+ */
+ public boolean isSuspended()
+ {
+- return isSuspended;
++ return isSuspended.get();
+ }
+
+ private void suspendLocally() throws SuspendException
+ {
+- if (!isSuspended)
++ if (!isSuspended.get())
+ {
+ latcher = new CountDownLatch(1);
+- isSuspended = true;
++ isSuspended.set(true);
+
+ if (workingThreads.get() > 0)
+ {
+@@ -2022,10 +2022,10 @@
+
+ private void resumeLocally() throws ResumeException
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ latcher.countDown();
+- isSuspended = false;
++ isSuspended.set(false);
+ }
+ }
+
+@@ -2034,7 +2034,7 @@
+ */
+ public void onChange(TopologyChangeEvent event)
+ {
+- if (isSuspended)
++ if (isSuspended.get())
+ {
+ new Thread()
+ {
12 years, 1 month
exo-jcr SVN: r5947 - in jcr/branches/1.12.x/patch/1.12.13-GA: JCR-1718 and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-23 06:36:39 -0400 (Fri, 23 Mar 2012)
New Revision: 5947
Added:
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1718/
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1718/JCR-1718.patch
Log:
JCR-1718: patch proposed
Added: jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1718/JCR-1718.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1718/JCR-1718.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1718/JCR-1718.patch 2012-03-23 10:36:39 UTC (rev 5947)
@@ -0,0 +1,180 @@
+Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java
+===================================================================
+--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java (revision 5937)
++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java (working copy)
+@@ -17,15 +17,20 @@
+ package org.exoplatform.services.jcr.impl.core.query;
+
+ import org.exoplatform.services.jcr.JcrImplBaseTest;
++import org.exoplatform.services.jcr.access.PermissionType;
++import org.exoplatform.services.jcr.core.CredentialsImpl;
++import org.exoplatform.services.jcr.core.ExtendedNode;
+ import org.exoplatform.services.jcr.impl.core.query.lucene.TwoWayRangeIterator;
+ import org.exoplatform.services.log.ExoLogger;
+ import org.exoplatform.services.log.Log;
+
++import java.util.HashMap;
+ import java.util.NoSuchElementException;
+ import java.util.Random;
+
+ import javax.jcr.Node;
+ import javax.jcr.RepositoryException;
++import javax.jcr.Session;
+ import javax.jcr.query.Query;
+ import javax.jcr.query.QueryManager;
+ import javax.jcr.query.QueryResult;
+@@ -44,6 +49,8 @@
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestScoreNodeIterator");
+
+ private Random random = new Random();
++
++ private Session userSession;
+
+ private final int TEST_NODES_COUNT = 100;
+
+@@ -57,6 +64,12 @@
+ {
+ Node subnode = testRoot.addNode("TestNode" + String.format("%07d", i));
+ subnode.setProperty("val", i);
++ ExtendedNode subnode2 = (ExtendedNode)testRoot.addNode("TestNode2-" + String.format("%07d", i));
++ subnode2.setProperty("val", i);
++ subnode2.addMixin("exo:privilegeable");
++ HashMap<String, String[]> perm = new HashMap<String, String[]>();
++ perm.put("admin", PermissionType.ALL);
++ subnode2.setPermissions(perm);
+ }
+
+ }
+@@ -68,7 +81,15 @@
+ Node testRoot = root.addNode(testRootNodeName);
+ prepareRoot(testRoot);
+ root.save();
++ userSession = repository.login(new CredentialsImpl("john", "exo".toCharArray()), "ws");
+ }
++
++ @Override
++ protected void tearDown() throws Exception
++ {
++ userSession.logout();
++ super.tearDown();
++ }
+
+ // Check random skipping from start of set
+ public void testSkipFromStart() throws Exception
+@@ -259,7 +280,7 @@
+ protected void checkPosition(ScoreNodeTester testAction, long expectedPosition) throws RepositoryException
+ {
+
+- QueryManager qm = workspace.getQueryManager();
++ QueryManager qm = userSession.getWorkspace().getQueryManager();
+
+ // Doc order
+ String strDocOrder = "select * from nt:unstructured where jcr:path like '/" + testRootNodeName + "/%'";
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/QueryResultImpl.java (working copy)
+@@ -18,6 +18,7 @@
+
+ import org.exoplatform.services.jcr.access.AccessManager;
+ import org.exoplatform.services.jcr.access.PermissionType;
++import org.exoplatform.services.jcr.access.SystemIdentity;
+ import org.exoplatform.services.jcr.datamodel.InternalQName;
+ import org.exoplatform.services.jcr.datamodel.NodeData;
+ import org.exoplatform.services.jcr.datamodel.QPath;
+@@ -142,6 +143,11 @@
+ private final long limit;
+
+ /**
++ * If <code>true</code>, it means we're using a System session.
++ */
++ private final boolean isSystemSession;
++
++ /**
+ * Creates a new query result. The concrete sub class is responsible for
+ * calling {@link #getResults(long)} after this constructor had been called.
+ *
+@@ -182,6 +188,7 @@
+ this.docOrder = orderProps.length == 0 && documentOrder;
+ this.offset = offset;
+ this.limit = limit;
++ this.isSystemSession = SystemIdentity.SYSTEM.equals(session.getUserID());
+ }
+
+ /**
+@@ -376,7 +383,7 @@
+ break;
+ }
+ // check access
+- if (isAccessGranted(sn))
++ if (!docOrder || isAccessGranted(sn))
+ {
+ collector.add(sn);
+ }
+@@ -398,6 +405,10 @@
+ */
+ private boolean isAccessGranted(ScoreNode[] nodes) throws RepositoryException
+ {
++ if (isSystemSession)
++ {
++ return true;
++ }
+ for (int i = 0; i < nodes.length; i++)
+ {
+ try
+@@ -483,25 +494,16 @@
+ else
+ {
+ // attempt to get enough results
+- try
++ long expectedPosition = position + skipNum;
++ while (position < expectedPosition)
+ {
+- getResults(position + invalid + (int)skipNum);
+- if (resultNodes.size() >= position + skipNum)
++ fetchNext();
++ if (next == null)
+ {
+- // skip within already fetched results
+- position += skipNum - 1;
+- fetchNext();
+- }
+- else
+- {
+ // not enough results after getResults()
+ throw new NoSuchElementException();
+ }
+ }
+- catch (RepositoryException e)
+- {
+- throw new NoSuchElementException(e.getMessage());
+- }
+ }
+ }
+
+@@ -648,6 +650,25 @@
+ }
+ }
+ next = (ScoreNode[])resultNodes.get(nextPos);
++ try
++ {
++ if (!isAccessGranted(next))
++ {
++ next = null;
++ invalid++;
++ resultNodes.remove(nextPos);
++ if (log.isDebugEnabled())
++ {
++ log
++ .debug("The node is invalid since we don't have sufficient rights to access it, it will be removed from the results set");
++ }
++ }
++ }
++ catch (RepositoryException e)
++ {
++ log.error("Could not check access permission", e);
++ break;
++ }
+ }
+ position++;
+ }
12 years, 1 month
exo-jcr SVN: r5946 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: core/query/lucene and 1 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 06:16:40 -0400 (Fri, 23 Mar 2012)
New Revision: 5946
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
Log:
EXOJCR-1825 : field isSuspended is atomicBoolean now.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-03-23 09:22:00 UTC (rev 5945)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-03-23 10:16:40 UTC (rev 5946)
@@ -105,6 +105,7 @@
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.StringTokenizer;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jcr.Node;
import javax.jcr.PropertyType;
@@ -213,7 +214,7 @@
/**
* Indicates if component suspended or not.
*/
- protected boolean isSuspended = false;
+ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
/**
* Indicates that node keep responsible for resuming.
@@ -404,7 +405,7 @@
public void checkIndex(final InspectionReport report, final boolean isSystem) throws RepositoryException,
IOException
{
- if (isSuspended)
+ if (isSuspended.get())
{
try
{
@@ -415,7 +416,7 @@
// try resuming the workspace
try
{
- if (isSystem && parentSearchManager != null && parentSearchManager.isSuspended)
+ if (isSystem && parentSearchManager != null && parentSearchManager.isSuspended.get())
{
parentSearchManager.resume();
}
@@ -434,7 +435,7 @@
try
{
suspend();
- if (isSystem && parentSearchManager != null && !parentSearchManager.isSuspended)
+ if (isSystem && parentSearchManager != null && !parentSearchManager.isSuspended.get())
{
parentSearchManager.suspend();
}
@@ -955,8 +956,8 @@
if (parentSearchManager != null)
{
newChangesFilter =
- constuctor.newInstance(this, parentSearchManager, config, indexingTree, parentSearchManager
- .getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
+ constuctor.newInstance(this, parentSearchManager, config, indexingTree,
+ parentSearchManager.getIndexingTree(), handler, parentSearchManager.getHandler(), cfm);
}
}
catch (SecurityException e)
@@ -1228,7 +1229,7 @@
*/
public boolean isSuspended()
{
- return isSuspended;
+ return isSuspended.get();
}
/**
@@ -1303,10 +1304,10 @@
throw new IllegalStateException(
"Index is not in READ_WRITE mode and reindexing can't be launched. Please start reindexing on coordinator node.");
}
- if (isSuspended || !handler.isOnline())
+ if (isSuspended.get() || !handler.isOnline())
{
throw new IllegalStateException("Can't start reindexing while index is "
- + ((isSuspended) ? "SUSPENDED." : "already OFFLINE (it means that reindexing is in progress).") + ".");
+ + ((isSuspended.get()) ? "SUSPENDED." : "already OFFLINE (it means that reindexing is in progress).") + ".");
}
LOG.info("Starting hot reindexing on the " + handler.getContext().getRepositoryName() + "/"
@@ -1542,27 +1543,27 @@
throw new SuspendException("Can't suspend index, while reindexing in progeress.");
}
- if (!isSuspended)
+ if (!isSuspended.get())
{
if (handler instanceof Suspendable)
{
((Suspendable)handler).suspend();
}
- isSuspended = true;
+ isSuspended.set(true);
}
}
protected void resumeLocally() throws ResumeException
{
- if (isSuspended)
+ if (isSuspended.get())
{
if (handler instanceof Suspendable)
{
((Suspendable)handler).resume();
}
- isSuspended = false;
+ isSuspended.set(false);
}
}
@@ -1571,7 +1572,7 @@
*/
public void onChange(TopologyChangeEvent event)
{
- if (isSuspended)
+ if (isSuspended.get())
{
new Thread()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-23 09:22:00 UTC (rev 5945)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-23 10:16:40 UTC (rev 5946)
@@ -83,8 +83,19 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.PrivilegedAction;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicBoolean;
import javax.jcr.RepositoryException;
import javax.jcr.query.InvalidQueryException;
@@ -513,7 +524,7 @@
/**
* Indicates if component suspended or not.
*/
- protected volatile boolean isSuspended = false;
+ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);
protected final Set<String> recoveryFilterClasses;
@@ -3350,7 +3361,7 @@
latcher = new CountDownLatch(1);
close();
- isSuspended = true;
+ isSuspended.set(true);
}
/**
@@ -3365,7 +3376,7 @@
latcher.countDown();
- isSuspended = false;
+ isSuspended.set(false);
}
catch (IOException e)
{
@@ -3382,7 +3393,7 @@
*/
public boolean isSuspended()
{
- return isSuspended;
+ return isSuspended.get();
}
/**
@@ -3393,7 +3404,7 @@
*/
private void waitForResuming() throws IOException
{
- if (isSuspended)
+ if (isSuspended.get())
{
try
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-23 09:22:00 UTC (rev 5945)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-23 10:16:40 UTC (rev 5946)
@@ -141,7 +141,7 @@
/**
* Indicates if component suspended or not.
*/
- protected volatile boolean isSuspended = false;
+ protected final AtomicBoolean isSuspended = new AtomicBoolean(false);;
/**
* Allows to make all threads waiting until resume.
@@ -550,7 +550,7 @@
}
return null;
}
-
+
/**
* Get Items Cache.
*
@@ -730,8 +730,7 @@
* {@inheritDoc}
*/
public ItemData getItemData(final NodeData parentData, final QPathEntry name, final ItemType itemType,
- final boolean createNullItemData)
- throws RepositoryException
+ final boolean createNullItemData) throws RepositoryException
{
if (cache.isEnabled())
{
@@ -917,7 +916,7 @@
*/
public void save(final ItemStateChangesLog changesLog) throws RepositoryException
{
- if (isSuspended)
+ if (isSuspended.get())
{
try
{
@@ -961,7 +960,7 @@
{
workingThreads.decrementAndGet();
- if (isSuspended && workingThreads.get() == 0)
+ if (isSuspended.get() && workingThreads.get() == 0)
{
synchronized (workingThreads)
{
@@ -1915,7 +1914,6 @@
}
}
-
/**
* {@inheritDoc}
*/
@@ -1977,15 +1975,15 @@
*/
public boolean isSuspended()
{
- return isSuspended;
+ return isSuspended.get();
}
private void suspendLocally() throws SuspendException
{
- if (!isSuspended)
+ if (!isSuspended.get())
{
latcher = new CountDownLatch(1);
- isSuspended = true;
+ isSuspended.set(true);
if (workingThreads.get() > 0)
{
@@ -2012,10 +2010,10 @@
private void resumeLocally() throws ResumeException
{
- if (isSuspended)
+ if (isSuspended.get())
{
latcher.countDown();
- isSuspended = false;
+ isSuspended.set(false);
}
}
@@ -2024,7 +2022,7 @@
*/
public void onChange(TopologyChangeEvent event)
{
- if (isSuspended)
+ if (isSuspended.get())
{
new Thread()
{
@@ -2223,9 +2221,9 @@
: getNearestACAncestorAcl(node, search);
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
- .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(), node.getParentIdentifier(),
- new AccessControlList(acl.getOwner(), ancestorAcl.getPermissionEntries()));
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
+ node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ node.getParentIdentifier(), new AccessControlList(acl.getOwner(), ancestorAcl.getPermissionEntries()));
}
else if (!acl.hasOwner())
{
@@ -2249,9 +2247,9 @@
: getNearestACAncestorAcl(node, search);
node =
- new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
- .getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(), node.getParentIdentifier(),
- new AccessControlList(ancestorAcl.getOwner(), acl.getPermissionEntries()));
+ new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
+ node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(),
+ node.getParentIdentifier(), new AccessControlList(ancestorAcl.getOwner(), acl.getPermissionEntries()));
}
}
@@ -2453,7 +2451,7 @@
filterPermissions.add(holder.getId());
}
}
- }
+ }
}
filtersEnabled.set(true);
return true;
@@ -2501,7 +2499,7 @@
}
}
}
-
+
/**
* {@inheritDoc}
*/
12 years, 1 month
exo-jcr SVN: r5945 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: dataflow/persistent and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-23 05:22:00 -0400 (Fri, 23 Mar 2012)
New Revision: 5945
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
Log:
EXOJCR-1825 : field isSuspended is volatile now. Merger is disposed after flushing.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-03-22 15:12:39 UTC (rev 5944)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2012-03-23 09:22:00 UTC (rev 5945)
@@ -1420,15 +1420,6 @@
*/
void close()
{
- // stop index merger
- // when calling this method we must not lock this MultiIndex, otherwise
- // a deadlock might occur
- if (merger != null)
- {
- merger.dispose();
- merger = null;
- }
-
synchronized (this)
{
// stop timer
@@ -1498,6 +1489,15 @@
}
});
}
+
+ // stop index merger
+ // when calling this method we must not lock this MultiIndex, otherwise
+ // a deadlock might occur
+ if (merger != null)
+ {
+ merger.dispose();
+ merger = null;
+ }
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-22 15:12:39 UTC (rev 5944)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-23 09:22:00 UTC (rev 5945)
@@ -513,7 +513,7 @@
/**
* Indicates if component suspended or not.
*/
- protected boolean isSuspended = false;
+ protected volatile boolean isSuspended = false;
protected final Set<String> recoveryFilterClasses;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-22 15:12:39 UTC (rev 5944)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-23 09:22:00 UTC (rev 5945)
@@ -141,7 +141,7 @@
/**
* Indicates if component suspended or not.
*/
- protected boolean isSuspended = false;
+ protected volatile boolean isSuspended = false;
/**
* Allows to make all threads waiting until resume.
12 years, 1 month
exo-jcr SVN: r5944 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-22 11:12:39 -0400 (Thu, 22 Mar 2012)
New Revision: 5944
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-1748 : ensure index flushed before checking integrity
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-22 14:36:10 UTC (rev 5943)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-22 15:12:39 UTC (rev 5944)
@@ -860,6 +860,14 @@
}
}
+ void ensureFlushed() throws IOException
+ {
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
+ {
+ index.flush();
+ }
+ }
+
/**
* {@inheritDoc}
*/
@@ -956,6 +964,14 @@
// check relation Persistent Layer -> Index
// If current workspace is system, then need to invoke reader correspondent to system index
+ ensureFlushed();
+ if (isSystem)
+ {
+ if (getContext().getParentHandler() != null)
+ {
+ ((SearchIndex)getContext().getParentHandler()).ensureFlushed();
+ }
+ }
IndexReader indexReader = getIndexReader(isSystem);
try
{
12 years, 1 month
exo-jcr SVN: r5943 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2012-03-22 10:36:10 -0400 (Thu, 22 Mar 2012)
New Revision: 5943
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
Log:
EXOJCR-1822: Fix that replaces the annotation NamingContext with NameTemplate in case of the StandaloneContainer and RootContainer otherwise the related MBean has no name which prevents it to be registered to the MBeanServer
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/RootContainer.java 2012-03-22 14:36:10 UTC (rev 5943)
@@ -34,7 +34,7 @@
import org.exoplatform.container.xml.Configuration;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
-import org.exoplatform.management.jmx.annotations.NamingContext;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
import org.exoplatform.management.rest.annotations.RESTEndpoint;
import org.exoplatform.services.log.ExoLogger;
@@ -61,7 +61,7 @@
* tuan08(a)users.sourceforge.net Date: Jul 21, 2004 Time: 12:15:28 AM
*/
@Managed
-@NamingContext(@Property(key = "container", value = "root"))
+@NameTemplate(@Property(key = "container", value = "root"))
@RESTEndpoint(path = "rcontainer")
public class RootContainer extends ExoContainer
{
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/StandaloneContainer.java 2012-03-22 14:36:10 UTC (rev 5943)
@@ -29,7 +29,7 @@
import org.exoplatform.container.xml.Configuration;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
-import org.exoplatform.management.jmx.annotations.NamingContext;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
import org.exoplatform.management.jmx.annotations.Property;
import org.exoplatform.management.rest.annotations.RESTEndpoint;
import org.exoplatform.services.log.ExoLogger;
@@ -49,7 +49,7 @@
* @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov
* </a>
* @version $Id: StandaloneContainer.java 7168 2006-07-19 07:36:23Z peterit $
- * Singletone, context independent Exo Container with one configuration
+ * Singleton, context independent Exo Container with one configuration
* entry point. The configuration is set as follows: - client calls
* setConfigurationURL() or setConfigurationPath method BEFORE
* getInstance() - otherwise container in instantiation time looks for
@@ -58,7 +58,7 @@
* (from where JVM is started) for standalone. See
*/
@Managed
-@NamingContext(@Property(key = "container", value = "standalone"))
+@NameTemplate(@Property(key = "container", value = "standalone"))
@RESTEndpoint(path = "scontainer")
public class StandaloneContainer extends ExoContainer implements SessionManagerContainer
{
12 years, 1 month
exo-jcr SVN: r5942 - in kernel/trunk/exo.kernel.container/src: main/java/org/exoplatform/container/management and 9 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-03-22 10:20:46 -0400 (Thu, 22 Mar 2012)
New Revision: 5942
Added:
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java
kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1774
* EXOJCR-1781
* EXOJCR-1791
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/ConcurrentPicoContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -413,7 +413,7 @@
Map<Object, Object> map = depResolutionCtx.get();
if (map != null)
{
- Object result = map.get(componentType);
+ Object result = map.get(componentAdapter.getComponentKey());
if (result != null)
{
return result;
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management/ManagementContextImpl.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,7 +18,10 @@
*/
package org.exoplatform.container.management;
+import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.container.RootContainer;
import org.exoplatform.container.component.RequestLifeCycle;
import org.exoplatform.management.ManagementAware;
import org.exoplatform.management.ManagementContext;
@@ -31,6 +34,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -50,6 +54,11 @@
*/
private static final Log LOG = ExoLogger.getLogger("exo.kernel.container.ManagementContextImpl");
+ /**
+ * The previous container
+ */
+ private static final ThreadLocal<ExoContainer> previousContainer = new ThreadLocal<ExoContainer>();
+
/** . */
private final Map<Class<?>, Object> scopingDataList;
@@ -306,16 +315,48 @@
public void beforeInvoke(Object managedResource)
{
- ExoContainer container = findContainer();
+ final ExoContainer container = findContainer();
if (container != null)
{
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ ExoContainer oldContainer = ExoContainerContext.getCurrentContainerIfPresent();
+ if (!(oldContainer instanceof RootContainer))
+ {
+ previousContainer.set(oldContainer);
+ }
+ ExoContainerContext.setCurrentContainer(container);
+ return null;
+ }
+ });
RequestLifeCycle.begin(container);
}
}
public void afterInvoke(Object managedResource)
{
- RequestLifeCycle.end();
+ try
+ {
+ RequestLifeCycle.end();
+ }
+ finally
+ {
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ ExoContainer oldContainer = previousContainer.get();
+ if (oldContainer != null)
+ {
+ previousContainer.set(null);
+ }
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ return null;
+ }
+ });
+ }
}
@Override
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -131,12 +131,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -184,8 +184,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -131,12 +131,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -184,8 +184,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -200,8 +200,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -200,8 +200,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -203,8 +203,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_2_OLD.xsd 2012-03-22 14:20:46 UTC (rev 5942)
@@ -146,12 +146,12 @@
</xsd:complexType>
<xsd:complexType name="initParamsType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="object-param" type="objectParamType"/>
- <xsd:element name="properties-param" type="propertiesParamType"/>
- <xsd:element name="value-param" type="valueParamType"/>
- <xsd:element name="values-param" type="valuesParamType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="value-param" type="valueParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="values-param" type="valuesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="properties-param" type="propertiesParamType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="object-param" type="objectParamType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
</xsd:complexType>
<xsd:complexType name="componentPluginType">
@@ -203,8 +203,8 @@
<xsd:element name="jmx-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="show-deploy-info" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <xsd:element name="multi-instance" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="show-deploy-info" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="multi-instance" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="component-plugins" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/TestExoContainer.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,7 @@
import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.component.BaseComponentPlugin;
+import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.jmx.AbstractTestContainer;
import org.exoplatform.container.support.ContainerBuilder;
@@ -185,6 +186,19 @@
assertEquals(container.getComponentInstanceOfType(SOE1.class), soe2.soe1);
}
+ public void testStackOverFlow4()
+ {
+ final RootContainer container = createRootContainer("test-exo-container.xml", "testStackOverflowError");
+ MyService ms = (MyService)container.getComponentInstanceOfType(MyService.class);
+ assertNotNull(ms);
+ assertTrue(ms instanceof MyServiceImpl);
+ MyServiceImpl msi = (MyServiceImpl)ms;
+ assertNotNull(msi.componentPlugin);
+ assertTrue(msi.componentPlugin instanceof MyPlugin);
+ MyPlugin mp = (MyPlugin) msi.componentPlugin;
+ assertTrue(mp.svc == ms);
+ }
+
public void testCyclicRef()
{
final RootContainer container = createRootContainer("test-exo-container.xml", "testCyclicRef");
@@ -1005,4 +1019,44 @@
this.soe1 = (SOE1)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(SOE1.class);
}
}
+
+ public static class MyPlugin extends BaseComponentPlugin
+ {
+ MySpecialService svc;
+
+ public MyPlugin(MySpecialService svc)
+ {
+ this.svc = svc;
+ }
+ }
+
+ public static interface MyService
+ {
+ public void addPlugin(ComponentPlugin componentPlugin);
+ }
+
+ public static interface MySpecialService extends MyService
+ {
+ }
+
+ public static class MyServiceImpl implements MySpecialService, Startable
+ {
+ ComponentPlugin componentPlugin;
+ public MyServiceImpl()
+ {
+ }
+
+ public void addPlugin(ComponentPlugin componentPlugin)
+ {
+ this.componentPlugin = componentPlugin;
+ }
+
+ public void stop()
+ {
+ }
+
+ public void start()
+ {
+ }
+ }
}
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestValidation.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.container.configuration;
+
+import org.exoplatform.commons.utils.ExoProperties;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.container.xml.ValuesParam;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class TestValidation
+{
+ public TestValidation(InitParams params)
+ {
+ PropertiesParam pp = params.getPropertiesParam("properties-param");
+ ExoProperties ep = pp.getProperties();
+ check(ep.containsKey("p1"));
+ check(ep.containsKey("p2"));
+ check(ep.containsKey("p3"));
+ pp = params.getPropertiesParam("properties-param2");
+ ep = pp.getProperties();
+ check(ep.containsKey("p1"));
+ check(ep.containsKey("p2"));
+ check(ep.containsKey("p3"));
+ MyBean bean = (MyBean)params.getObjectParam("object-param").getObject();
+ check(bean.value.equals("value"));
+ bean = (MyBean)params.getObjectParam("object-param2").getObject();
+ check(bean.value.equals("value"));
+ ValueParam vp = params.getValueParam("value-param");
+ check(vp.getValue().equals("value"));
+ vp = params.getValueParam("value-param2");
+ check(vp.getValue().equals("value"));
+ ValuesParam vps = params.getValuesParam("values-param");
+ check(vps.getValues().get(0).equals("value1"));
+ check(vps.getValues().get(1).equals("value2"));
+ check(vps.getValues().get(2).equals("value3"));
+ vps = params.getValuesParam("values-param2");
+ check(vps.getValues().get(0).equals("value1"));
+ check(vps.getValues().get(1).equals("value2"));
+ check(vps.getValues().get(2).equals("value3"));
+ }
+
+ public void check(boolean ok)
+ {
+ if (!ok)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public static class MyBean
+ {
+ public String value;
+ }
+}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(18, count);
+ assertEquals(19, count);
+ try
+ {
+ File f = new File(baseDir, "invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_0/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(19, count);
+ assertEquals(20, count);
+ try
+ {
+ File f = new File(baseDir,"invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_1/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_2.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.configuration;
+import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.support.ContainerBuilder;
import org.exoplatform.test.BasicTestCase;
import java.io.File;
@@ -57,6 +59,26 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(20, count);
+ assertEquals(21, count);
+ try
+ {
+ File f = new File(baseDir, "invalid-configuration.xml.bad");
+ URL url = f.toURI().toURL();
+ assertFalse("XML configuration file " + url + " is valid", unmarshaller.isValid(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Expected
+ }
}
+
+ public void testInitParams() throws Exception
+ {
+ String baseDirPath = System.getProperty("basedir");
+ File file = new File(baseDirPath + "/src/test/resources/xsd_1_2/test-validation.xml");
+ URL url = file.toURI().toURL();
+ assertNotNull(url);
+ RootContainer container = new ContainerBuilder().withRoot(url).build();
+ container.getComponentInstanceOfType(TestValidation.class);
+ }
}
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/TestRegistration.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,12 +18,17 @@
*/
package org.exoplatform.container.jmx;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.RootContainer;
+import org.exoplatform.container.jmx.support.ExoContainerFinder;
import org.exoplatform.container.jmx.support.ManagedWithObjectNameTemplate;
import java.util.Set;
import javax.management.MBeanServer;
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectInstance;
import javax.management.ObjectName;
/**
@@ -43,9 +48,33 @@
MBeanServer server = root.getMBeanServer();
- Set set = server.queryMBeans(ObjectName.getInstance("exo:object=\"Foo\""), null);
+ Set<ObjectInstance> set = server.queryMBeans(ObjectName.getInstance("exo:object=\"Foo\""), null);
assertEquals(1, set.size());
+ ObjectInstance oi = set.iterator().next();
+ ExoContainer oldContainer = ExoContainerContext.getCurrentContainerIfPresent();
+
+ ExoContainer currentContainer = new ExoContainer();
+ ExoContainerContext.setCurrentContainer(currentContainer);
+ try
+ {
+ ExoContainerFinder proxyObject =
+ MBeanServerInvocationHandler.newProxyInstance(server, oi.getObjectName(),
+ ExoContainerFinder.class, false);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == currentContainer);
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == oldContainer);
+ ExoContainerContext.setCurrentContainer(null);
+ assertTrue("We expect to get the current exo container", oldContainer == proxyObject.getCurrentExoContainer());
+ assertTrue("We expect to get the previous exo container", ExoContainerContext.getCurrentContainerIfPresent() == oldContainer);
+ }
+ finally
+ {
+ ExoContainerContext.setCurrentContainer(oldContainer);
+ }
+
// Manual
root.registerComponentInstance("Bar", new ManagedWithObjectNameTemplate("Bar"));
Added: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ExoContainerFinder.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.container.jmx.support;
+
+import org.exoplatform.container.ExoContainer;
+
+/**
+ * @author <a href="mailto:nfilotto@exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public interface ExoContainerFinder
+{
+ ExoContainer getCurrentExoContainer();
+}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/jmx/support/ManagedWithObjectNameTemplate.java 2012-03-22 14:20:46 UTC (rev 5942)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.container.jmx.support;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.jmx.annotations.NameTemplate;
@@ -29,7 +31,7 @@
*/
@Managed
@NameTemplate(@Property(key = "object", value = "{Name}"))
-public class ManagedWithObjectNameTemplate
+public class ManagedWithObjectNameTemplate implements ExoContainerFinder
{
private String name;
@@ -45,6 +47,12 @@
}
@Managed
+ public ExoContainer getCurrentExoContainer()
+ {
+ return ExoContainerContext.getCurrentContainerIfPresent();
+ }
+
+ @Managed
public String getName()
{
return name;
Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/container/test-exo-container.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -87,4 +87,18 @@
<component profiles="testStartOrder">
<type>org.exoplatform.container.TestExoContainer$C2</type>
</component>
+ <component profiles="testStackOverflowError">
+ <key>org.exoplatform.container.TestExoContainer$MyService</key>
+ <type>org.exoplatform.container.TestExoContainer$MyServiceImpl</type>
+ </component>
+
+ <external-component-plugins profiles="testStackOverflowError">
+ <target-component>org.exoplatform.container.TestExoContainer$MyService</target-component>
+ <component-plugin>
+ <name>test.plugin</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.container.TestExoContainer$MyPlugin</type>
+ <description>User - Ticket Authenticator</description>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd http://www.exoplatform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd http://www.exoplatform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd http://www.exoplatform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-19.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd http://www.exoplatform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_1.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/invalid-configuration.xml.bad 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml 2012-03-22 14:10:55 UTC (rev 5941)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/sample-configuration-18.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -43,27 +43,6 @@
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
- <object-param>
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
<value-param>
<name>value</name>
<value>value</value>
@@ -85,6 +64,27 @@
<values-param profiles="a,b">
<name>values</name>
</values-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
</init-params>
</component>
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_2/test-validation.xml 2012-03-22 14:20:46 UTC (rev 5942)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.container.configuration.TestValidation</type>
+ <init-params>
+ <value-param>
+ <name>value-param</name>
+ <value>value</value>
+ </value-param>
+ <value-param>
+ <name>value-param2</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values-param</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <values-param>
+ <name>values-param2</name>
+ <value>value1</value>
+ <value>value2</value>
+ <value>value3</value>
+ </values-param>
+ <properties-param>
+ <name>properties-param</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <properties-param>
+ <name>properties-param2</name>
+ <property name="p1" value="v1"></property>
+ <property name="p2" value="v2"></property>
+ <property name="p3" value="v3"></property>
+ </properties-param>
+ <object-param>
+ <name>object-param</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ <object-param>
+ <name>object-param2</name>
+ <description>description</description>
+ <object type="org.exoplatform.container.configuration.TestValidation$MyBean">
+ <field name="value">
+ <string>value</string>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+</configuration>
\ No newline at end of file
12 years, 1 month
exo-jcr SVN: r5941 - in jcr/branches/1.12.x/patch/1.12.13-GA: JCR-1717 and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-22 10:10:55 -0400 (Thu, 22 Mar 2012)
New Revision: 5941
Added:
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/
jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
Log:
JCR-1717: patch proposed
Added: jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch
===================================================================
--- jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch (rev 0)
+++ jcr/branches/1.12.x/patch/1.12.13-GA/JCR-1717/JCR-1717.patch 2012-03-22 14:10:55 UTC (rev 5941)
@@ -0,0 +1,1475 @@
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/PersistentDataManager.java (working copy)
+@@ -20,6 +20,7 @@
+
+ import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
+ import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListenerFilter;
++import org.exoplatform.services.jcr.impl.ReadOnlySupport;
+
+ /**
+ * Created by The eXo Platform SAS.
+@@ -29,7 +30,7 @@
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter Nedonosko</a>
+ * @version $Id: PersistentDataManager.java 34801 2009-07-31 15:44:50Z dkatayev $
+ */
+-public interface PersistentDataManager extends DataManager
++public interface PersistentDataManager extends DataManager, ReadOnlySupport
+ {
+
+ void addItemPersistenceListener(ItemsPersistenceListener listener);
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java (working copy)
+@@ -39,6 +39,9 @@
+ import org.exoplatform.services.jcr.datamodel.QPath;
+ import org.exoplatform.services.jcr.datamodel.ValueData;
+ import org.exoplatform.services.jcr.impl.Constants;
++import org.exoplatform.services.jcr.impl.backup.ResumeException;
++import org.exoplatform.services.jcr.impl.backup.SuspendException;
++import org.exoplatform.services.jcr.impl.backup.Suspendable;
+ import org.exoplatform.services.jcr.impl.core.LocationFactory;
+ import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
+ import org.exoplatform.services.jcr.impl.core.SessionDataManager;
+@@ -86,7 +89,7 @@
+ * @version $Id: SearchManager.java 1008 2009-12-11 15:14:51Z nzamosenchuk $
+ */
+ @NonVolatile
+-public class SearchManager implements Startable, MandatoryItemsPersistenceListener
++public class SearchManager implements Startable, MandatoryItemsPersistenceListener, Suspendable
+ {
+
+ /**
+@@ -136,6 +139,11 @@
+
+ protected IndexerChangesFilter changesFilter;
+
++ /**
++ * Indicates if component suspended or not.
++ */
++ protected volatile boolean isSuspended = false;
++
+ private final ExoContainerContext ctx;
+
+ /**
+@@ -856,4 +864,62 @@
+ return false;
+ }
+
++ /**
++ * {@inheritDoc}
++ */
++ public void suspend() throws SuspendException
++ {
++ suspendLocally();
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public boolean isSuspended()
++ {
++ return isSuspended;
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public void resume() throws ResumeException
++ {
++ resumeLocally();
++ }
++
++ protected void suspendLocally() throws SuspendException
++ {
++ if (!isSuspended)
++ {
++ if (handler instanceof Suspendable)
++ {
++ ((Suspendable)handler).suspend();
++ }
++
++ isSuspended = true;
++ }
++ }
++
++ protected void resumeLocally() throws ResumeException
++ {
++ if (isSuspended)
++ {
++ if (handler instanceof Suspendable)
++ {
++ ((Suspendable)handler).resume();
++ }
++
++ isSuspended = false;
++ }
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public int getPriority()
++ {
++ return PRIORITY_NORMAL;
++ }
++
+ }
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java (working copy)
+@@ -45,6 +45,9 @@
+ import org.exoplatform.services.jcr.datamodel.PropertyData;
+ import org.exoplatform.services.jcr.datamodel.QPath;
+ import org.exoplatform.services.jcr.impl.Constants;
++import org.exoplatform.services.jcr.impl.backup.ResumeException;
++import org.exoplatform.services.jcr.impl.backup.SuspendException;
++import org.exoplatform.services.jcr.impl.backup.Suspendable;
+ import org.exoplatform.services.jcr.impl.core.LocationFactory;
+ import org.exoplatform.services.jcr.impl.core.SessionDataManager;
+ import org.exoplatform.services.jcr.impl.core.SessionImpl;
+@@ -78,6 +81,7 @@
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Set;
++import java.util.concurrent.CountDownLatch;
+
+ import javax.jcr.RepositoryException;
+ import javax.jcr.query.InvalidQueryException;
+@@ -89,7 +93,7 @@
+ * Implements a {@link org.apache.jackrabbit.core.query.QueryHandler} using
+ * Lucene.
+ */
+-public class SearchIndex extends AbstractQueryHandler implements IndexerIoModeListener
++public class SearchIndex extends AbstractQueryHandler implements IndexerIoModeListener, Suspendable
+ {
+
+ private static final DefaultQueryNodeFactory DEFAULT_QUERY_NODE_FACTORY = new DefaultQueryNodeFactory();
+@@ -448,6 +452,16 @@
+ private final ConfigurationManager cfm;
+
+ /**
++ * Waiting query execution until resume.
++ */
++ protected CountDownLatch latcher = null;
++
++ /**
++ * Indicates if component suspended or not.
++ */
++ protected volatile boolean isSuspended = false;
++
++ /**
+ * Working constructor.
+ *
+ * @throws RepositoryConfigurationException
+@@ -819,26 +833,29 @@
+ */
+ public void close()
+ {
+- if (synonymProviderConfigFs != null)
++ if (!closed)
+ {
+- try
++ if (synonymProviderConfigFs != null)
+ {
+- synonymProviderConfigFs.close();
++ try
++ {
++ synonymProviderConfigFs.close();
++ }
++ catch (IOException e)
++ {
++ log.warn("Exception while closing FileSystem", e);
++ }
+ }
+- catch (IOException e)
++ if (spellChecker != null)
+ {
+- log.warn("Exception while closing FileSystem", e);
++ spellChecker.close();
+ }
++ errorLog.close();
++ index.close();
++ getContext().destroy();
++ closed = true;
++ log.info("Index closed: " + path);
+ }
+- if (spellChecker != null)
+- {
+- spellChecker.close();
+- }
+- errorLog.close();
+- index.close();
+- getContext().destroy();
+- closed = true;
+- log.info("Index closed: " + path);
+ }
+
+ /**
+@@ -866,6 +883,8 @@
+ public MultiColumnQueryHits executeQuery(SessionImpl session, AbstractQueryImpl queryImpl, Query query,
+ QPath[] orderProps, boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
+ {
++ waitForResuming();
++
+ checkOpen();
+
+ Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
+@@ -914,6 +933,8 @@
+ public MultiColumnQueryHits executeQuery(SessionImpl session, MultiColumnQuery query, QPath[] orderProps,
+ boolean[] orderSpecs, long resultFetchHint) throws IOException, RepositoryException
+ {
++ waitForResuming();
++
+ checkOpen();
+
+ Sort sort = new Sort(createSortFields(orderProps, orderSpecs));
+@@ -2710,6 +2731,8 @@
+ */
+ public QueryHits executeQuery(Query query) throws IOException
+ {
++ waitForResuming();
++
+ checkOpen();
+
+ IndexReader reader = getIndexReader(true);
+@@ -2742,4 +2765,76 @@
+ log.error("Can not recover error log.", e);
+ }
+ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public void suspend() throws SuspendException
++ {
++ latcher = new CountDownLatch(1);
++ close();
++
++ isSuspended = true;
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public void resume() throws ResumeException
++ {
++ try
++ {
++ closed = false;
++ doInit();
++
++ latcher.countDown();
++
++ isSuspended = false;
++ }
++ catch (IOException e)
++ {
++ throw new ResumeException(e);
++ }
++ catch (RepositoryException e)
++ {
++ throw new ResumeException(e);
++ }
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public boolean isSuspended()
++ {
++ return isSuspended;
++ }
++
++ /**
++ * If component is suspended need to wait resuming and not allow
++ * execute query on closed index.
++ *
++ * @throws IOException
++ */
++ private void waitForResuming() throws IOException
++ {
++ if (isSuspended)
++ {
++ try
++ {
++ latcher.await();
++ }
++ catch (InterruptedException e)
++ {
++ throw new IOException(e);
++ }
++ }
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public int getPriority()
++ {
++ return PRIORITY_NORMAL;
++ }
+ }
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java (working copy)
+@@ -177,7 +177,7 @@
+ /**
+ * The <code>IndexMerger</code> for this <code>MultiIndex</code>.
+ */
+- private final IndexMerger merger;
++ private IndexMerger merger;
+
+ /**
+ * Timer to schedule flushes of this index after some idle time.
+@@ -224,7 +224,7 @@
+ * Flag indicating whether the index is stopped.
+ */
+ private volatile boolean stopped;
+-
++
+ /**
+ * The index format version of this multi index.
+ */
+@@ -270,12 +270,6 @@
+ // as of 1.5 deletable file is not used anymore
+ removeDeletable();
+
+- // initialize IndexMerger
+- merger = new IndexMerger(this);
+- merger.setMaxMergeDocs(handler.getMaxMergeDocs());
+- merger.setMergeFactor(handler.getMergeFactor());
+- merger.setMinMergeDocs(handler.getMinMergeDocs());
+-
+ IndexingQueueStore store = new IndexingQueueStore(indexDir);
+
+ // initialize indexing queue
+@@ -303,7 +297,6 @@
+ index.setUseCompoundFile(handler.getUseCompoundFile());
+ index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor());
+ indexes.add(index);
+- merger.indexAdded(index.getName(), index.getNumDocuments());
+ }
+
+ // init volatile index
+@@ -323,6 +316,7 @@
+ indexingQueue.initialize(this);
+ if (modeHandler.getMode() == IndexerIoMode.READ_WRITE)
+ {
++ // will also initialize IndexMerger
+ setReadWrite();
+ }
+ this.indexNames.setMultiIndex(this);
+@@ -926,12 +920,6 @@
+ {
+ if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE))
+ {
+-
+- // stop index merger
+- // when calling this method we must not lock this MultiIndex, otherwise
+- // a deadlock might occur
+- merger.dispose();
+-
+ synchronized (this)
+ {
+ // stop timer
+@@ -977,6 +965,14 @@
+ }
+ }
+ }
++ // stop index merger
++ // when calling this method we must not lock this MultiIndex, otherwise
++ // a deadlock might occur
++ if (merger != null)
++ {
++ merger.dispose();
++ merger = null;
++ }
+ this.stopped = true;
+ }
+
+@@ -1150,6 +1146,27 @@
+ }
+ }
+
++ /**
++ * Initialize IndexMerger.
++ */
++ private void initMerger() throws IOException
++ {
++ if (merger != null)
++ {
++ log.info("IndexMerger initialization called twice.");
++ }
++ merger = new IndexMerger(this);
++ merger.setMaxMergeDocs(handler.getMaxMergeDocs());
++ merger.setMergeFactor(handler.getMergeFactor());
++ merger.setMinMergeDocs(handler.getMinMergeDocs());
++
++ for (Object index : indexes)
++ {
++ merger.indexAdded(((PersistentIndex)index).getName(), ((PersistentIndex)index).getNumDocuments());
++ }
++ merger.start();
++ }
++
+ // -------------------------< internal
+ // >-------------------------------------
+
+@@ -1324,13 +1341,12 @@
+ * @throws RepositoryException
+ * if any other error occurs
+ */
+- private long createIndex(NodeData node, ItemDataConsumer stateMgr) throws IOException,
+- RepositoryException
++ private long createIndex(NodeData node, ItemDataConsumer stateMgr) throws IOException, RepositoryException
+ {
+ MultithreadedIndexing indexing = new MultithreadedIndexing(node, stateMgr);
+ return indexing.launch(false);
+ }
+-
++
+ /**
+ * Recursively creates an index starting with the NodeState
+ * <code>node</code>.
+@@ -1352,8 +1368,8 @@
+ * @throws InterruptedException
+ * if the task has been interrupted
+ */
+- private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr, final AtomicLong count) throws IOException,
+- RepositoryException, InterruptedException
++ private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr,
++ final AtomicLong count) throws IOException, RepositoryException, InterruptedException
+ {
+ if (stopped)
+ {
+@@ -1397,7 +1413,7 @@
+ }
+ }
+ }
+-
++
+ /**
+ * Recursively creates an index starting with the NodeState
+ * <code>node</code>.
+@@ -1421,9 +1437,8 @@
+ * @throws InterruptedException
+ * if the task has been interrupted
+ */
+- private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node,
+- final ItemDataConsumer stateMgr, final AtomicLong count, final NodeData nodeData)
+- throws RepositoryException, IOException, InterruptedException
++ private void createIndex(final Queue<Callable<Void>> tasks, final NodeData node, final ItemDataConsumer stateMgr,
++ final AtomicLong count, final NodeData nodeData) throws RepositoryException, IOException, InterruptedException
+ {
+ NodeData childState = (NodeData)stateMgr.getItemData(nodeData.getIdentifier());
+ if (childState == null)
+@@ -1937,8 +1952,8 @@
+ /**
+ * The maximum length of a AddNode String.
+ */
+- private static final int ENTRY_LENGTH =
+- Long.toString(Long.MAX_VALUE).length() + Action.ADD_NODE.length() + Constants.UUID_FORMATTED_LENGTH + 2;
++ private static final int ENTRY_LENGTH = Long.toString(Long.MAX_VALUE).length() + Action.ADD_NODE.length()
++ + Constants.UUID_FORMATTED_LENGTH + 2;
+
+ /**
+ * The uuid of the node to add.
+@@ -1952,7 +1967,7 @@
+ private Document doc;
+
+ private boolean synch;
+-
++
+ /**
+ * Creates a new AddNode action.
+ *
+@@ -2042,12 +2057,12 @@
+ {
+ synchronized (index)
+ {
+- index.volatileIndex.addDocuments(new Document[]{doc});
+- }
++ index.volatileIndex.addDocuments(new Document[]{doc});
++ }
+ }
+ else
+ {
+- index.volatileIndex.addDocuments(new Document[]{doc});
++ index.volatileIndex.addDocuments(new Document[]{doc});
+ }
+ }
+ }
+@@ -2305,8 +2320,8 @@
+ /**
+ * The maximum length of a DeleteNode String.
+ */
+- private static final int ENTRY_LENGTH =
+- Long.toString(Long.MAX_VALUE).length() + Action.DELETE_NODE.length() + Constants.UUID_FORMATTED_LENGTH + 2;
++ private static final int ENTRY_LENGTH = Long.toString(Long.MAX_VALUE).length() + Action.DELETE_NODE.length()
++ + Constants.UUID_FORMATTED_LENGTH + 2;
+
+ /**
+ * The uuid of the node to remove.
+@@ -2550,7 +2565,12 @@
+ protected void setReadOny()
+ {
+ // try to stop merger in safe way
+- merger.dispose();
++ if (merger != null)
++ {
++ merger.dispose();
++ merger = null;
++ }
++
+ flushTask.cancel();
+ FLUSH_TIMER.purge();
+ this.redoLog = null;
+@@ -2582,7 +2602,8 @@
+ attemptDelete();
+
+ // now that we are ready, start index merger
+- merger.start();
++ initMerger();
++
+ if (redoLogApplied)
+ {
+ // wait for the index merge to finish pending jobs
+@@ -2660,7 +2681,7 @@
+ }
+ }
+ }
+-
++
+ /**
+ * This class is used to index a node and its descendants nodes with several threads
+ */
+@@ -2670,27 +2691,27 @@
+ * This instance of {@link AtomicReference} will contain the exception meet if any exception has occurred
+ */
+ private final AtomicReference<Exception> exception = new AtomicReference<Exception>();
+-
++
+ /**
+ * The total amount of threads used for the indexing
+ */
+ private final int nThreads = Runtime.getRuntime().availableProcessors();
+-
++
+ /**
+ * The {@link CountDownLatch} used to notify that the indexing is over
+ */
+ private final CountDownLatch endSignal = new CountDownLatch(nThreads);
+-
++
+ /**
+ * The total amount of threads currently working
+ */
+ private final AtomicInteger runningThreads = new AtomicInteger();
+-
++
+ /**
+ * The total amount of nodes already indexed
+ */
+ private final AtomicLong count = new AtomicLong();
+-
++
+ /**
+ * The list of indexing tasks left to do
+ */
+@@ -2706,7 +2727,7 @@
+ {
+ if ((task = super.poll()) != null)
+ {
+- runningThreads.incrementAndGet();
++ runningThreads.incrementAndGet();
+ }
+ }
+ return task;
+@@ -2714,7 +2735,7 @@
+
+ @Override
+ public boolean offer(Callable<Void> o)
+- {
++ {
+ if (super.offer(o))
+ {
+ synchronized (runningThreads)
+@@ -2724,9 +2745,9 @@
+ return true;
+ }
+ return false;
+- }
++ }
+ };
+-
++
+ /**
+ * The task that all the indexing threads have to execute
+ */
+@@ -2782,7 +2803,7 @@
+ endSignal.countDown();
+ }
+ };
+-
++
+ /**
+ * Default constructor
+ * @param node
+@@ -2801,7 +2822,7 @@
+ }
+ });
+ }
+-
++
+ /**
+ * Launches the indexing
+ * @param asynchronous indicates whether or not the current thread needs to wait until the
+@@ -2853,7 +2874,7 @@
+ */
+ private void startThreads()
+ {
+- for (int i=0; i < nThreads; i++)
++ for (int i = 0; i < nThreads; i++)
+ {
+ (new Thread(indexingTask, "Indexing Thread #" + (i + 1))).start();
+ }
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java (working copy)
+@@ -137,6 +137,11 @@
+ private int state = OFFLINE;
+
+ /**
++ * Repository state. OFFLINE by default.
++ */
++ private boolean isOffline = true;
++
++ /**
+ * RepositoryImpl constructor.
+ *
+ * @param container Repository container
+@@ -579,7 +584,26 @@
+ */
+ public int getState()
+ {
+- return state;
++ if (isOffline)
++ {
++ return OFFLINE;
++ }
++
++ Integer state = null;
++ for (String workspaceName : getWorkspaceNames())
++ {
++ int workspaceState = getWorkspaceContainer(workspaceName).getState();
++ if (state == null)
++ {
++ state = workspaceState;
++ }
++ else if (state != workspaceState)
++ {
++ return UNDEFINED;
++ }
++ }
++
++ return state == null ? ONLINE : state;
+ }
+
+ /**
+@@ -587,22 +611,33 @@
+ */
+ public void setState(int state)
+ {
+- switch (state)
++ if (getState() != ONLINE && !(state == ONLINE || state == OFFLINE))
+ {
+- case ONLINE :
+- // set ONLINE all workspaces
+- setAllWorkspacesReadOnly(false);
+- break;
+- case OFFLINE :
+- // TODO do nothing
+- break;
+- case READONLY :
+- // set READONLY all workspaces
+- setAllWorkspacesReadOnly(true);
+- break;
++ throw new IllegalStateException("First switch repository to ONLINE and then to needed state.\n" + toString());
+ }
+
+- this.state = state;
++ String[] workspaces = getWorkspaceNames();
++ if (workspaces.length > 0)
++ {
++ try
++ {
++ // set state for all workspaces
++ for (String workspaceName : workspaces)
++ {
++ if (!workspaceName.equals(systemWorkspaceName))
++ {
++ getWorkspaceContainer(workspaceName).setState(state);
++ }
++ }
++ getWorkspaceContainer(systemWorkspaceName).setState(state);
++ }
++ catch (RepositoryException e)
++ {
++ throw new IllegalStateException(e);
++ }
++ }
++
++ isOffline = state == OFFLINE;
+ }
+
+ /**
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ReadOnlySupport.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ReadOnlySupport.java (revision 0)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ReadOnlySupport.java (revision 0)
+@@ -0,0 +1,52 @@
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: ReadOnlySupport.java 34360 20.03.2012 andrew.plotnikov $
++ *
++ */
++public interface ReadOnlySupport
++{
++ /**
++ * Status of write-operations restrictions.
++ *
++ * Read-only status is descriptive within the container, i.e. will not prevent any write
++ * operation.
++ *
++ * Used in DataManager implementations.
++ *
++ * @return true - if write-operations allowed, false - otherwise.
++ */
++ boolean isReadOnly();
++
++ /**
++ * Set status of write-operations restrictions.
++ *
++ * Read-only status is descriptive within the container, i.e. will not prevent any write
++ * operation.
++ *
++ * Used in DataManager implementations.
++ *
++ * @param status
++ * , true - if write-operations allowed, false - otherwise.
++ */
++ void setReadOnly(boolean status);
++}
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java (working copy)
+@@ -30,6 +30,9 @@
+ import org.exoplatform.services.jcr.datamodel.QPathEntry;
+ import org.exoplatform.services.jcr.datamodel.ValueData;
+ import org.exoplatform.services.jcr.impl.Constants;
++import org.exoplatform.services.jcr.impl.backup.ResumeException;
++import org.exoplatform.services.jcr.impl.backup.SuspendException;
++import org.exoplatform.services.jcr.impl.backup.Suspendable;
+ import org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.JBossCacheWorkspaceStorageCache;
+ import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
+ import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
+@@ -41,6 +44,7 @@
+ import java.util.concurrent.ConcurrentHashMap;
+ import java.util.concurrent.ConcurrentMap;
+ import java.util.concurrent.CountDownLatch;
++import java.util.concurrent.atomic.AtomicInteger;
+
+ import javax.jcr.RepositoryException;
+ import javax.transaction.TransactionManager;
+@@ -54,7 +58,7 @@
+ *
+ * @version $Id$
+ */
+-public class CacheableWorkspaceDataManager extends WorkspacePersistentDataManager
++public class CacheableWorkspaceDataManager extends WorkspacePersistentDataManager implements Suspendable
+ {
+
+ /**
+@@ -70,6 +74,21 @@
+ private TransactionManager transactionManager;
+
+ /**
++ * The amount of current working threads.
++ */
++ protected AtomicInteger workingThreads = new AtomicInteger();
++
++ /**
++ * Indicates if component suspended or not.
++ */
++ protected volatile boolean isSuspended = false;
++
++ /**
++ * Allows to make all threads waiting until resume.
++ */
++ protected CountDownLatch latcher = null;
++
++ /**
+ * ItemData request, used on get operations.
+ *
+ */
+@@ -536,6 +555,39 @@
+ @Override
+ public void save(final ItemStateChangesLog changesLog) throws RepositoryException
+ {
++ if (isSuspended)
++ {
++ try
++ {
++ latcher.await();
++ }
++ catch (InterruptedException e)
++ {
++ throw new RepositoryException(e);
++ }
++ }
++
++ workingThreads.incrementAndGet();
++ try
++ {
++ doSave(changesLog);
++ }
++ finally
++ {
++ workingThreads.decrementAndGet();
++
++ if (isSuspended && workingThreads.get() == 0)
++ {
++ synchronized (workingThreads)
++ {
++ workingThreads.notifyAll();
++ }
++ }
++ }
++ }
++
++ private void doSave(final ItemStateChangesLog changesLog) throws RepositoryException
++ {
+ if (isTxAware())
+ {
+ // save in dedicated XA transaction
+@@ -952,4 +1004,75 @@
+ conn.close();
+ }
+ }
+-}
+\ No newline at end of file
++
++ /**
++ * {@inheritDoc}
++ */
++ public void suspend() throws SuspendException
++ {
++ suspendLocally();
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public void resume() throws ResumeException
++ {
++ resumeLocally();
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public boolean isSuspended()
++ {
++ return isSuspended;
++ }
++
++ private void suspendLocally() throws SuspendException
++ {
++ if (!isSuspended)
++ {
++ latcher = new CountDownLatch(1);
++ isSuspended = true;
++
++ if (workingThreads.get() > 0)
++ {
++ synchronized (workingThreads)
++ {
++ while (workingThreads.get() > 0)
++ {
++ try
++ {
++ workingThreads.wait();
++ }
++ catch (InterruptedException e)
++ {
++ if (LOG.isTraceEnabled())
++ {
++ LOG.trace(e.getMessage(), e);
++ }
++ }
++ }
++ }
++ }
++ }
++ }
++
++ private void resumeLocally() throws ResumeException
++ {
++ if (isSuspended)
++ {
++ latcher.countDown();
++ isSuspended = false;
++ }
++ }
++
++ /**
++ * {@inheritDoc}
++ */
++ public int getPriority()
++ {
++ return PRIORITY_HIGH;
++ }
++}
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java (working copy)
+@@ -29,6 +29,7 @@
+ import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+ import org.exoplatform.services.jcr.config.RepositoryEntry;
+ import org.exoplatform.services.jcr.config.WorkspaceEntry;
++import org.exoplatform.services.jcr.core.ManageableRepository;
+ import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager;
+ import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
+ import org.exoplatform.services.jcr.impl.core.LocationFactory;
+@@ -412,6 +413,26 @@
+ }
+
+ /**
++ * {@inheritDoc}
++ */
++ @Override
++ public synchronized void stop()
++ {
++ RepositoryImpl repository = (RepositoryImpl)getComponentInstanceOfType(RepositoryImpl.class);
++
++ try
++ {
++ repository.setState(ManageableRepository.OFFLINE);
++ }
++ catch (IllegalStateException e)
++ {
++ log.error("Can not switch repository to OFFLINE", e);
++ }
++
++ super.stop();
++ }
++
++ /**
+ * Initialize worspaces (root node and jcr:system for system workspace).
+ * <p>
+ * Runs on container start.
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/ResumeException.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/ResumeException.java (revision 0)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/ResumeException.java (revision 0)
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: ResumeException.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public class ResumeException extends Exception
++{
++ /**
++ * Constructor ResumeException.
++ *
++ * @param cause
++ * the cause
++ */
++ public ResumeException(Throwable cause)
++ {
++ super(cause);
++ }
++
++ /**
++ * Constructor ResumeException.
++ *
++ * @param message
++ * the message
++ */
++ public ResumeException(String message)
++ {
++ super(message);
++ }
++
++ /**
++ * Constructor ResumeException.
++ *
++ * @param message
++ * the message
++ * @param cause
++ * the cause
++ */
++ public ResumeException(String message, Throwable cause)
++ {
++ super(message, cause);
++ }
++}
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java (revision 0)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/SuspendException.java (revision 0)
+@@ -0,0 +1,62 @@
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: SuspendException.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public class SuspendException extends Exception
++{
++ /**
++ * Constructor SuspendException.
++ *
++ * @param cause
++ * the cause
++ */
++ public SuspendException(Throwable cause)
++ {
++ super(cause);
++ }
++
++ /**
++ * Constructor SuspendException.
++ *
++ * @param message
++ * the message
++ */
++ public SuspendException(String message)
++ {
++ super(message);
++ }
++
++ /**
++ * Constructor SuspendException.
++ *
++ * @param message
++ * the message
++ * @param cause
++ * the cause
++ */
++ public SuspendException(String message, Throwable cause)
++ {
++ super(message, cause);
++ }
++}
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java (revision 0)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Suspendable.java (revision 0)
+@@ -0,0 +1,74 @@
++/*
++ * Copyright (C) 2012 eXo Platform SAS.
++ *
++ * This is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU Lesser General Public License as
++ * published by the Free Software Foundation; either version 2.1 of
++ * the License, or (at your option) any later version.
++ *
++ * This software is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this software; if not, write to the Free
++ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
++ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
++ */
++package org.exoplatform.services.jcr.impl.backup;
++
++/**
++ * @author <a href="mailto:aplotnikov@exoplatform.com">Andrey Plotnikov</a>
++ * @version $Id: Suspendable.java 34360 19.03.2012 andrew.plotnikov $
++ *
++ */
++public interface Suspendable
++{
++
++ /**
++ * Priority high constant.
++ */
++ public static final int PRIORITY_HIGH = 5;
++
++ /**
++ * Priority normal constant.
++ */
++ public static final int PRIORITY_NORMAL = 0;
++
++ /**
++ * Priority low constant.
++ */
++ public static final int PRIORITY_LOW = -5;
++
++ /**
++ * Suspend component.
++ *
++ * @throws SuspendException if error occurred
++ */
++ void suspend() throws SuspendException;
++
++ /**
++ * Resume component.
++ *
++ * @throws ResumeException if error occurred
++ */
++ void resume() throws ResumeException;
++
++ /**
++ * Indicates if component is suspended or not.
++ *
++ * @return
++ */
++ boolean isSuspended();
++
++ /**
++ * Priority of the component.
++ * Uses for suspend/resume comparator order.
++ * The higher number gives higher priority.
++ *
++ * @return
++ */
++ int getPriority();
++
++}
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/ManageableRepository.java (working copy)
+@@ -62,6 +62,16 @@
+ final int READONLY = 2;
+
+ /**
++ * Repository SUSPENDED status.
++ */
++ final int SUSPENDED = 3;
++
++ /**
++ * Repository UNDEFINED status.
++ */
++ final int UNDEFINED = 4;
++
++ /**
+ * Add the items persistence listener to the named workspace.
+ *
+ * @param workspaceName - name of workspace
+@@ -170,6 +180,9 @@
+ * Set repository state.
+ *
+ * @param repository state
++ * @throws IllegalStateException
++ * when value state incorrect or
++ * when we can't do suspend or resume operation in the component
+ */
+ void setState(int state);
+
+Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
+===================================================================
+--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (revision 5937)
++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java (working copy)
+@@ -18,8 +18,18 @@
+ */
+ package org.exoplatform.services.jcr.core;
+
++import org.exoplatform.services.jcr.impl.ReadOnlySupport;
+ import org.exoplatform.services.jcr.impl.WorkspaceContainer;
++import org.exoplatform.services.jcr.impl.backup.ResumeException;
++import org.exoplatform.services.jcr.impl.backup.SuspendException;
++import org.exoplatform.services.jcr.impl.backup.Suspendable;
+
++import java.util.Collections;
++import java.util.Comparator;
++import java.util.List;
++
++import javax.jcr.RepositoryException;
++
+ /**
+ * Created by The eXo Platform SAS .<br/> An entry point to the implementation, used for extending
+ * functionality
+@@ -54,6 +64,18 @@
+ }
+
+ /**
++ * Returns list of components of specific type.
++ *
++ * @param componentType
++ * component type
++ * @return List<Object>
++ */
++ public List getComponentInstancesOfType(Class componentType)
++ {
++ return container.getComponentInstancesOfType(componentType);
++ }
++
++ /**
+ * @param key
+ * - an internal key of internal component
+ * @return the component
+@@ -78,4 +100,190 @@
+ {
+ container.registerComponentInstance(key, component);
+ }
++
++ /**
++ * Returns current workspace state.
++ *
++ * @param state
++ * @throws RepositoryException
++ */
++ public int getState()
++ {
++ boolean hasROComponents = false;
++ boolean hasRWComponents = false;
++ List<ReadOnlySupport> readOnlyComponents = getComponentInstancesOfType(ReadOnlySupport.class);
++ for (ReadOnlySupport component : readOnlyComponents)
++ {
++ if (component.isReadOnly())
++ {
++ hasROComponents = true;
++ }
++ else
++ {
++ hasRWComponents = true;
++ }
++ }
++
++ boolean hasSuspendedComponents = false;
++ boolean hasResumedComponents = false;
++ List<Suspendable> suspendableComponents = getComponentInstancesOfType(Suspendable.class);
++ for (Suspendable component : suspendableComponents)
++ {
++ if (component.isSuspended())
++ {
++ hasSuspendedComponents = true;
++ }
++ else
++ {
++ hasResumedComponents = true;
++ }
++ }
++
++ if (hasSuspendedComponents && !hasResumedComponents && !hasROComponents)
++ {
++ return ManageableRepository.SUSPENDED;
++ }
++ else if (hasROComponents && !hasRWComponents && !hasSuspendedComponents)
++ {
++ return ManageableRepository.READONLY;
++ }
++ else if (!hasSuspendedComponents && !hasROComponents)
++ {
++ return ManageableRepository.ONLINE;
++ }
++ else
++ {
++ return ManageableRepository.UNDEFINED;
++ }
++ }
++
++ /**
++ * Set new workspace state.
++ *
++ * @param state
++ * @throws RepositoryException
++ */
++ public void setState(final int state) throws RepositoryException
++ {
++ try
++ {
++ switch (state)
++ {
++ case ManageableRepository.ONLINE :
++ setOnline();
++ break;
++ case ManageableRepository.OFFLINE :
++ suspend();
++ break;
++ case ManageableRepository.READONLY :
++ setReadOnly(true);
++ break;
++ case ManageableRepository.SUSPENDED :
++ suspend();
++ break;
++ }
++ }
++ catch (Exception e)
++ {
++ Throwable cause = e.getCause();
++ if (cause instanceof RepositoryException)
++ {
++ throw new RepositoryException(cause);
++ }
++ else
++ {
++ throw new RuntimeException(cause);
++ }
++ }
++ }
++
++ /**
++ * Set all components readonly.
++ */
++ private void setReadOnly(boolean readOnly)
++ {
++ List<ReadOnlySupport> components = getComponentInstancesOfType(ReadOnlySupport.class);
++ for (ReadOnlySupport component : components)
++ {
++ component.setReadOnly(readOnly);
++ }
++ }
++
++ /**
++ * Suspend all components in workspace.
++ *
++ * @throws RepositoryException
++ */
++ private void suspend() throws RepositoryException
++ {
++ List<Suspendable> components = getComponentInstancesOfType(Suspendable.class);
++ Comparator<Suspendable> c = new Comparator<Suspendable>()
++ {
++ public int compare(Suspendable s1, Suspendable s2)
++ {
++ return s2.getPriority() - s1.getPriority();
++ };
++ };
++ Collections.sort(components, c);
++
++ for (Suspendable component : components)
++ {
++ try
++ {
++ if (!component.isSuspended())
++ {
++ component.suspend();
++ }
++ }
++ catch (SuspendException e)
++ {
++ throw new RepositoryException("Can't suspend component", e);
++ }
++ }
++ }
++
++ /**
++ * Suspend all components in workspace.
++ *
++ * @throws RepositoryException
++ */
++ private void resume() throws RepositoryException
++ {
++ // components should be resumed in reverse order
++ List<Suspendable> components = getComponentInstancesOfType(Suspendable.class);
++ Comparator<Suspendable> c = new Comparator<Suspendable>()
++ {
++ public int compare(Suspendable s1, Suspendable s2)
++ {
++ return s1.getPriority() - s2.getPriority();
++ };
++ };
++ Collections.sort(components, c);
++
++ for (Suspendable component : components)
++ {
++ try
++ {
++ if (component.isSuspended())
++ {
++ component.resume();
++ }
++ }
++ catch (ResumeException e)
++ {
++ throw new RepositoryException("Can't resume component", e);
++ }
++ }
++ }
++
++ /**
++ * Set all components online.
++ *
++ * @throws RepositoryException
++ */
++ private void setOnline() throws RepositoryException
++ {
++ setReadOnly(false);
++ resume();
++ }
+ }
12 years, 1 month
exo-jcr SVN: r5940 - in jcr/trunk: applications/product-patches/as/jetty and 13 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2012-03-22 09:27:52 -0400 (Thu, 22 Mar 2012)
New Revision: 5940
Added:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/cache-server-configuration.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/distributed-cache-configuration.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/tcp-mux-v3.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/udp-mux-v3.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/tcp-mux-v3.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux-v3.xml
Removed:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml
Modified:
jcr/trunk/applications/product-patches/as/jboss/exo-configuration.xml
jcr/trunk/applications/product-patches/as/jetty/exo-configuration.xml
jcr/trunk/applications/product-patches/as/jonas/exo-configuration.xml
jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml
jcr/trunk/applications/product-patches/as/tomcat/exo-readme.txt
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration-ijdbc-ispn.xml
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config-ijdbc-ispn.xml
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
Log:
EXOJCR-1739: ported issues:
* EXOJCR-1726
* EXOJCR-1737
* EXOJCR-1742
* EXOJCR-1746
* EXOJCR-1753
Modified: jcr/trunk/applications/product-patches/as/jboss/exo-configuration.xml
===================================================================
--- jcr/trunk/applications/product-patches/as/jboss/exo-configuration.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/applications/product-patches/as/jboss/exo-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -1,24 +1,24 @@
<?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.
-
--->
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
@@ -204,7 +204,7 @@
</init-params>
</component>
- <component profiles="ispn,jbc">
+ <component profiles="jbc">
<key>org.exoplatform.services.rpc.RPCService</key>
<type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
<init-params>
@@ -222,6 +222,26 @@
</value-param>
</init-params>
</component>
+
+ <component profiles="ispn">
+ <key>org.exoplatform.services.rpc.RPCService</key>
+ <type>org.exoplatform.services.rpc.jgv3.RPCServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>jgroups-configuration</name>
+ <value>jar:/conf/udp-mux-v3.xml</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-cluster-name</name>
+ <value>RPCService-Cluster</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-default-timeout</name>
+ <value>0</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
<init-params>
@@ -353,9 +373,9 @@
<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>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
</component>
<component>
Modified: jcr/trunk/applications/product-patches/as/jetty/exo-configuration.xml
===================================================================
--- jcr/trunk/applications/product-patches/as/jetty/exo-configuration.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/applications/product-patches/as/jetty/exo-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -204,7 +204,7 @@
</init-params>
</component>
- <component profiles="ispn,jbc">
+ <component profiles="jbc">
<key>org.exoplatform.services.rpc.RPCService</key>
<type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
<init-params>
@@ -222,6 +222,26 @@
</value-param>
</init-params>
</component>
+
+ <component profiles="ispn">
+ <key>org.exoplatform.services.rpc.RPCService</key>
+ <type>org.exoplatform.services.rpc.jgv3.RPCServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>jgroups-configuration</name>
+ <value>jar:/conf/udp-mux-v3.xml</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-cluster-name</name>
+ <value>RPCService-Cluster</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-default-timeout</name>
+ <value>0</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
<init-params>
Modified: jcr/trunk/applications/product-patches/as/jonas/exo-configuration.xml
===================================================================
--- jcr/trunk/applications/product-patches/as/jonas/exo-configuration.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/applications/product-patches/as/jonas/exo-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -204,7 +204,7 @@
</init-params>
</component>
- <component profiles="ispn,jbc">
+ <component profiles="jbc">
<key>org.exoplatform.services.rpc.RPCService</key>
<type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
<init-params>
@@ -222,6 +222,26 @@
</value-param>
</init-params>
</component>
+
+ <component profiles="ispn">
+ <key>org.exoplatform.services.rpc.RPCService</key>
+ <type>org.exoplatform.services.rpc.jgv3.RPCServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>jgroups-configuration</name>
+ <value>jar:/conf/udp-mux-v3.xml</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-cluster-name</name>
+ <value>RPCService-Cluster</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-default-timeout</name>
+ <value>0</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
<init-params>
Modified: jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml
===================================================================
--- jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -1,24 +1,24 @@
<?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.
-
--->
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
@@ -220,7 +220,7 @@
</init-params>
</component>
- <component profiles="ispn,jbc">
+ <component profiles="jbc">
<key>org.exoplatform.services.rpc.RPCService</key>
<type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type>
<init-params>
@@ -238,6 +238,26 @@
</value-param>
</init-params>
</component>
+
+ <component profiles="ispn">
+ <key>org.exoplatform.services.rpc.RPCService</key>
+ <type>org.exoplatform.services.rpc.jgv3.RPCServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>jgroups-configuration</name>
+ <value>jar:/conf/udp-mux-v3.xml</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-cluster-name</name>
+ <value>RPCService-Cluster</value>
+ </value-param>
+ <value-param>
+ <name>jgroups-default-timeout</name>
+ <value>0</value>
+ </value-param>
+ </init-params>
+ </component>
+
<component>
<type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
<init-params>
@@ -369,9 +389,9 @@
<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>
+ <key>org.exoplatform.services.security.Authenticator</key>
+ <type>org.exoplatform.services.organization.auth.OrganizationAuthenticatorImpl</type>
</component>
<component>
Modified: jcr/trunk/applications/product-patches/as/tomcat/exo-readme.txt
===================================================================
--- jcr/trunk/applications/product-patches/as/tomcat/exo-readme.txt 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/applications/product-patches/as/tomcat/exo-readme.txt 2012-03-22 13:27:52 UTC (rev 5940)
@@ -11,3 +11,8 @@
* "eXo-ispn.bat run" to launch eXo JCR with the configuration for Infinispan
* "eXo-jbc.bat run" to launch eXo JCR with the configuration for JBoss Cache
+
+Notice!
+JCR Bundles for Infinispan and JBoss Cache differs by their dependencies.
+In ordrer to run eXo JCR with Infinispan configuration it must be deployed
+with "ispn" profile.
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -19,12 +19,21 @@
package org.exoplatform.services.jcr.config;
import org.exoplatform.commons.utils.SecurityHelper;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
+import org.exoplatform.management.jmx.annotations.Property;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
+import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;
+import java.io.IOException;
import java.io.InputStream;
+import java.io.StringWriter;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.util.LinkedHashMap;
@@ -40,9 +49,11 @@
* @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov </a>
* @version $Id: RepositoryServiceConfiguration.java 2038 2005-10-05 16:50:11Z geaz $
*/
-
+@Managed
+@NameTemplate(@Property(key = "service", value = "RepositoryServiceConfiguration"))
public class RepositoryServiceConfiguration extends AbstractRepositoryServiceConfiguration
{
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.RepositoryServiceConfiguration"); //NOSONAR
public RepositoryServiceConfiguration()
{
@@ -180,4 +191,37 @@
{
}
+ @Managed
+ @ManagedDescription("The configuration of all the repositories in XML format.")
+ public String getConfigurationXML()
+ {
+ StringWriter sw = new StringWriter();
+ try
+ {
+ IBindingFactory bfact = BindingDirectory.getFactory(RepositoryServiceConfiguration.class);
+ IMarshallingContext mctx = bfact.createMarshallingContext();
+ mctx.setIndent(2);
+ mctx.marshalDocument(this, "UTF-8", null, sw);
+ }
+ catch (Exception e)
+ {
+ LOG.warn("Cannot convert the configuration to XML format", e);
+ return null;
+ }
+ finally
+ {
+ try
+ {
+ sw.close();
+ }
+ catch (IOException ignore)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("An exception occurred: " + ignore.getMessage());
+ }
+ }
+ }
+ return sw.toString();
+ }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/WorkspaceContainerFacade.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -168,6 +168,7 @@
setOnline();
break;
case ManageableRepository.OFFLINE :
+ suspend();
break;
case ManageableRepository.SUSPENDED :
suspend();
@@ -214,7 +215,10 @@
{
try
{
- component.suspend();
+ if (!component.isSuspended())
+ {
+ component.suspend();
+ }
}
catch (SuspendException e)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -32,6 +32,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
+import org.exoplatform.services.jcr.core.ManageableRepository;
import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager;
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions;
@@ -487,6 +488,17 @@
@Override
public synchronized void stop()
{
+ RepositoryImpl repository = (RepositoryImpl)getComponentInstanceOfType(RepositoryImpl.class);
+
+ try
+ {
+ repository.setState(ManageableRepository.OFFLINE);
+ }
+ catch (RepositoryException e)
+ {
+ log.error("Can not switch repository to OFFLINE", e);
+ }
+
super.stop();
super.unregisterAllComponents();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/RepositoryImpl.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -415,7 +415,6 @@
public SessionImpl getDynamicSession(String workspaceName, Collection<MembershipEntry> membershipEntries)
throws RepositoryException
{
-
if (getState() == OFFLINE)
{
LOG.warn("Repository " + getName() + " is OFFLINE.");
@@ -743,10 +742,18 @@
throw new RepositoryException("First switch repository to ONLINE and then to needed state.\n" + toString());
}
- // set state for all workspaces
- for (String workspaceName : getWorkspaceNames())
+ String[] workspaces = getWorkspaceNames();
+ if (workspaces.length > 0)
{
- getWorkspaceContainer(workspaceName).setState(state);
+ // set state for all workspaces
+ for (String workspaceName : workspaces)
+ {
+ if (!workspaceName.equals(systemWorkspaceName))
+ {
+ getWorkspaceContainer(workspaceName).setState(state);
+ }
+ }
+ getWorkspaceContainer(systemWorkspaceName).setState(state);
}
isOffline = state == OFFLINE;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -1200,10 +1200,10 @@
*/
public void suspend() throws SuspendException
{
- isResponsibleForResuming = true;
-
if (rpcService != null)
{
+ isResponsibleForResuming = true;
+
try
{
rpcService.executeCommandOnAllNodes(suspend, true);
@@ -1274,13 +1274,13 @@
{
throw new ResumeException(e);
}
+
+ isResponsibleForResuming = false;
}
else
{
resumeLocally();
}
-
- isResponsibleForResuming = false;
}
/**
@@ -1541,32 +1541,29 @@
{
throw new SuspendException("Can't suspend index, while reindexing in progeress.");
}
- if (isSuspended)
- {
- throw new SuspendException("Component already suspended.");
- }
- if (handler instanceof Suspendable)
+ if (!isSuspended)
{
- ((Suspendable)handler).suspend();
- }
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).suspend();
+ }
- isSuspended = true;
+ isSuspended = true;
+ }
}
protected void resumeLocally() throws ResumeException
{
- if (!isSuspended)
+ if (isSuspended)
{
- throw new ResumeException("Component is not suspended.");
- }
+ if (handler instanceof Suspendable)
+ {
+ ((Suspendable)handler).resume();
+ }
- if (handler instanceof Suspendable)
- {
- ((Suspendable)handler).resume();
+ isSuspended = false;
}
-
- isSuspended = false;
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -960,6 +960,14 @@
finally
{
workingThreads.decrementAndGet();
+
+ if (isSuspended && workingThreads.get() == 0)
+ {
+ synchronized (workingThreads)
+ {
+ workingThreads.notifyAll();
+ }
+ }
}
}
@@ -1913,10 +1921,10 @@
*/
public void suspend() throws SuspendException
{
- isResponsibleForResuming = true;
-
if (rpcService != null)
{
+ isResponsibleForResuming = true;
+
try
{
rpcService.executeCommandOnAllNodes(suspend, true);
@@ -1955,13 +1963,13 @@
{
throw new ResumeException(e);
}
+
+ isResponsibleForResuming = false;
}
else
{
resumeLocally();
}
-
- isResponsibleForResuming = false;
}
/**
@@ -1974,36 +1982,41 @@
private void suspendLocally() throws SuspendException
{
- if (isSuspended)
+ if (!isSuspended)
{
- throw new SuspendException("Component already suspended.");
- }
+ latcher = new CountDownLatch(1);
+ isSuspended = true;
- latcher = new CountDownLatch(1);
- isSuspended = true;
-
- while (workingThreads.get() != 0)
- {
- try
+ if (workingThreads.get() > 0)
{
- Thread.sleep(50);
+ synchronized (workingThreads)
+ {
+ while (workingThreads.get() > 0)
+ {
+ try
+ {
+ workingThreads.wait();
+ }
+ catch (InterruptedException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace(e.getMessage(), e);
+ }
+ }
+ }
+ }
}
- catch (InterruptedException e)
- {
- throw new SuspendException(e);
- }
}
}
private void resumeLocally() throws ResumeException
{
- if (!isSuspended)
+ if (isSuspended)
{
- throw new ResumeException("Component is not suspended.");
+ latcher.countDown();
+ isSuspended = false;
}
-
- latcher.countDown();
- isSuspended = false;
}
/**
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/ChangesKey.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -37,7 +37,7 @@
{
private String wsId;
- ChangesKey()
+ public ChangesKey()
{
super();
}
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexInfosKey.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -30,7 +30,7 @@
*/
public class IndexInfosKey extends CacheKey
{
- IndexInfosKey()
+ public IndexInfosKey()
{
super();
}
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/core/query/ispn/IndexUpdateKey.java 2012-03-22 13:27:52 UTC (rev 5940)
@@ -31,7 +31,7 @@
public class IndexUpdateKey extends CacheKey
{
- IndexUpdateKey()
+ public IndexUpdateKey()
{
super();
}
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/cache-server-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/cache-server-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/cache-server-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
+ xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
+ <component>
+ <type>org.exoplatform.services.ispn.DistributedCacheManager</type>
+ <init-params>
+ <value-param>
+ <name>infinispan-configuration</name>
+ <value>jar:/conf/distributed-cache-configuration.xml</value>
+ </value-param>
+ <properties-param>
+ <name>parameters</name>
+ <description>The parameters of the configuration</description>
+ <property name="configurationFile" value="udp-mux-v3.xml"></property>
+ <property name="invalidationThreshold" value="0"></property>
+ <property name="numOwners" value="2"></property>
+ <property name="numVirtualNodes" value="1"></property>
+ </properties-param>
+ <properties-param profiles="tcp">
+ <name>parameters</name>
+ <description>The parameters of the configuration</description>
+ <property name="configurationFile" value="tcp-mux-v3.xml"></property>
+ <property name="invalidationThreshold" value="-1"></property>
+ <property name="numOwners" value="2"></property>
+ <property name="numVirtualNodes" value="1"></property>
+ </properties-param>
+ </init-params>
+ </component>
+ <component>
+ <key>org.infinispan.transaction.lookup.TransactionManagerLookup</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossStandaloneJTAManagerLookup</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.transaction.TransactionService</key>
+ <type>org.exoplatform.services.transaction.infinispan.JBossTransactionsService</type>
+ <init-params>
+ <value-param>
+ <name>timeout</name>
+ <value>3000</value>
+ </value-param>
+ </init-params>
+ </component>
+ <component>
+ <key>org.exoplatform.services.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="jcr-cache-server.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" />
+ </properties-param>
+ </init-params>
+ </component>
+</configuration>
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/distributed-cache-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/distributed-cache-configuration.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/distributed-cache-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2010 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
+ xmlns="urn:infinispan:config:5.1">
+ <global>
+ <globalJmxStatistics jmxDomain="exo" enabled="true" allowDuplicateDomains="true"/>
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="JCR-cluster" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="${configurationFile}"/>
+ </properties>
+ </transport>
+ <shutdown hookBehavior="DEFAULT"/>
+ </global>
+ <namedCache name="JCRCache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+ <jmxStatistics enabled="true"/>
+ <clustering mode="distribution">
+ <l1 enabled="true" invalidationThreshold="${invalidationThreshold}"/>
+ <hash numOwners="${numOwners}" numVirtualNodes="${numVirtualNodes}" rehashRpcTimeout="120000">
+ <groups enabled="true"/>
+ </hash>
+ <sync replTimeout="180000"/>
+ </clustering>
+ </namedCache>
+ <namedCache name="eXoCache">
+ <locking isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="120000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="true" />
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup" syncRollbackPhase="true" syncCommitPhase="true" eagerLockSingleNode="true" transactionMode="TRANSACTIONAL"/>
+ <jmxStatistics enabled="true"/>
+ <clustering mode="distribution">
+ <l1 enabled="true" invalidationThreshold="${invalidationThreshold}"/>
+ <hash numOwners="${numOwners}" numVirtualNodes="${numVirtualNodes}" rehashRpcTimeout="120000"/>
+ <sync replTimeout="180000"/>
+ </clustering>
+ </namedCache>
+</infinispan>
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/portal/exo-jcr-ispn-config.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -54,7 +54,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
</properties>
</cache>
@@ -63,7 +63,7 @@
<property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/production" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -72,7 +72,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -114,7 +114,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
</properties>
</cache>
@@ -123,7 +123,7 @@
<property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/backup" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -132,7 +132,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -174,7 +174,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-data.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
</properties>
</cache>
@@ -183,7 +183,7 @@
<property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/digital-assets" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -192,7 +192,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="jar:/conf/portal/cluster/infinispan-lock.xml" />
- <property name="jgroups-configuration" value="jar:/conf/portal/cluster/udp-mux.xml" />
+ <property name="jgroups-configuration" value="jar:/conf/udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/tcp-mux-v3.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/tcp-mux-v3.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/tcp-mux-v3.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,70 @@
+<!--
+ TCP based stack, with flow control and message bundling. This is usually used when IP
+ multicasting cannot be used in a network, e.g. because it is disabled (routers discard multicast).
+ Note that TCP.bind_addr and TCPPING.initial_hosts should be set, possibly via system properties, e.g.
+ -Djgroups.bind_addr=192.168.5.2 and -Djgroups.tcpping.initial_hosts=192.168.5.2[7800]
+ author: Bela Ban
+-->
+<config xmlns="urn:org:jgroups"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+ <TCP singleton_name="JCR-cluster"
+ bind_port="7800"
+ loopback="false"
+ recv_buf_size="${tcp.recv_buf_size:20M}"
+ send_buf_size="${tcp.send_buf_size:640K}"
+ discard_incompatible_packets="true"
+ max_bundle_size="64K"
+ max_bundle_timeout="30"
+ enable_bundling="true"
+ use_send_queues="true"
+ sock_conn_timeout="300"
+
+ timer_type="new"
+ timer.min_threads="4"
+ timer.max_threads="10"
+ timer.keep_alive_time="3000"
+ timer.queue_max_size="500"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="1"
+ thread_pool.max_threads="10"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="false"
+ thread_pool.queue_max_size="100"
+ thread_pool.rejection_policy="discard"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="discard"/>
+
+ <TCPPING timeout="3000"
+ initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800],localhost[7801]}"
+ port_range="1"
+ num_initial_members="3"/>
+ <MERGE2 min_interval="10000"
+ max_interval="30000"/>
+ <FD_SOCK/>
+ <FD timeout="3000" max_tries="3" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK use_mcast_xmit="false"
+ exponential_backoff="500"
+ discard_delivered_msgs="true"/>
+ <UNICAST />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="4M"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+
+ view_bundling="true"/>
+ <UFC max_credits="2M"
+ min_threshold="0.4"/>
+ <MFC max_credits="2M"
+ min_threshold="0.4"/>
+ <FRAG2 frag_size="60K" />
+ <pbcast.STATE_TRANSFER/>
+</config>
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/udp-mux-v3.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/udp-mux-v3.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/resources/conf/udp-mux-v3.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,74 @@
+
+<!--
+ Default stack using IP multicasting. It is similar to the "udp"
+ stack in stacks.xml, but doesn't use streaming state transfer and flushing
+ author: Bela Ban
+-->
+
+<config xmlns="urn:org:jgroups"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+ <UDP
+ singleton_name="JCR-cluster"
+ mcast_port="${jgroups.udp.mcast_port:45588}"
+ tos="8"
+ ucast_recv_buf_size="20M"
+ ucast_send_buf_size="640K"
+ mcast_recv_buf_size="25M"
+ mcast_send_buf_size="640K"
+ loopback="true"
+ discard_incompatible_packets="true"
+ max_bundle_size="64K"
+ max_bundle_timeout="30"
+ ip_ttl="${jgroups.udp.ip_ttl:8}"
+ enable_bundling="true"
+ enable_diagnostics="true"
+ thread_naming_pattern="cl"
+
+ timer_type="new"
+ timer.min_threads="4"
+ timer.max_threads="10"
+ timer.keep_alive_time="3000"
+ timer.queue_max_size="500"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="2"
+ thread_pool.max_threads="8"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="10000"
+ thread_pool.rejection_policy="discard"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="Run"/>
+
+ <PING timeout="2000"
+ num_initial_members="3"/>
+ <MERGE2 max_interval="30000"
+ min_interval="10000"/>
+ <FD_SOCK/>
+ <FD_ALL/>
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK exponential_backoff="300"
+ xmit_stagger_timeout="200"
+ use_mcast_xmit="false"
+ discard_delivered_msgs="true"/>
+ <UNICAST />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="4M"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ view_bundling="true"/>
+ <UFC max_credits="2M"
+ min_threshold="0.4"/>
+ <MFC max_credits="2M"
+ min_threshold="0.4"/>
+ <FRAG2 frag_size="60K" />
+ <pbcast.STATE_TRANSFER />
+ <!-- pbcast.FLUSH /-->
+</config>
\ No newline at end of file
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/tcp-mux-v3.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/tcp-mux-v3.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/tcp-mux-v3.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,70 @@
+<!--
+ TCP based stack, with flow control and message bundling. This is usually used when IP
+ multicasting cannot be used in a network, e.g. because it is disabled (routers discard multicast).
+ Note that TCP.bind_addr and TCPPING.initial_hosts should be set, possibly via system properties, e.g.
+ -Djgroups.bind_addr=192.168.5.2 and -Djgroups.tcpping.initial_hosts=192.168.5.2[7800]
+ author: Bela Ban
+-->
+<config xmlns="urn:org:jgroups"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+ <TCP singleton_name="JCR-cluster"
+ bind_port="7800"
+ loopback="false"
+ recv_buf_size="${tcp.recv_buf_size:20M}"
+ send_buf_size="${tcp.send_buf_size:640K}"
+ discard_incompatible_packets="true"
+ max_bundle_size="64K"
+ max_bundle_timeout="30"
+ enable_bundling="true"
+ use_send_queues="true"
+ sock_conn_timeout="300"
+
+ timer_type="new"
+ timer.min_threads="4"
+ timer.max_threads="10"
+ timer.keep_alive_time="3000"
+ timer.queue_max_size="500"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="1"
+ thread_pool.max_threads="10"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="false"
+ thread_pool.queue_max_size="100"
+ thread_pool.rejection_policy="discard"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="discard"/>
+
+ <TCPPING timeout="3000"
+ initial_hosts="${jgroups.tcpping.initial_hosts:localhost[7800],localhost[7801]}"
+ port_range="1"
+ num_initial_members="3"/>
+ <MERGE2 min_interval="10000"
+ max_interval="30000"/>
+ <FD_SOCK/>
+ <FD timeout="3000" max_tries="3" />
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK use_mcast_xmit="false"
+ exponential_backoff="500"
+ discard_delivered_msgs="true"/>
+ <UNICAST />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="4M"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+
+ view_bundling="true"/>
+ <UFC max_credits="2M"
+ min_threshold="0.4"/>
+ <MFC max_credits="2M"
+ min_threshold="0.4"/>
+ <FRAG2 frag_size="60K" />
+ <pbcast.STATE_TRANSFER/>
+</config>
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration-ijdbc-ispn.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration-ijdbc-ispn.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-configuration-ijdbc-ispn.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -231,7 +231,7 @@
<init-params>
<value-param>
<name>jgroups-configuration</name>
- <value>jar:/conf/standalone/cluster/udp-mux.xml</value>
+ <value>jar:/conf/standalone/cluster/udp-mux-v3.xml</value>
</value-param>
<value-param>
<name>jgroups-cluster-name</name>
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config-ijdbc-ispn.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config-ijdbc-ispn.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/test-jcr-config-ijdbc-ispn.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -55,7 +55,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ zz
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -65,7 +65,7 @@
<property name="index-dir" value="target/temp/index/db1/ws" />
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
</properties>
@@ -74,7 +74,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -114,7 +114,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -123,7 +123,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1/ws1" />
@@ -141,7 +141,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -181,7 +181,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -190,7 +190,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1/ws2" />
@@ -208,7 +208,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -272,7 +272,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -281,7 +281,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1/ws3" />
@@ -299,7 +299,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -356,7 +356,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -365,7 +365,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db2/ws" />
@@ -375,7 +375,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -421,7 +421,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -430,7 +430,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db2/ws1" />
@@ -440,7 +440,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -497,7 +497,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -506,7 +506,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1tck/ws" />
@@ -525,7 +525,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -572,7 +572,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -581,7 +581,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1tck/ws1" />
@@ -599,7 +599,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
@@ -646,7 +646,7 @@
class="org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan.ISPNCacheWorkspaceStorageCache">
<properties>
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-config.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="use-distributed-cache" value="${use-distributed-cache}" />
</properties>
@@ -655,7 +655,7 @@
<properties>
<property name="changesfilter-class" value="org.exoplatform.services.jcr.impl.core.query.ispn.ISPNIndexChangesFilter" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-indexer.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="max-volatile-time" value="60" />
<property name="index-dir" value="target/temp/index/db1tck/ws2" />
@@ -676,7 +676,7 @@
<properties>
<property name="time-out" value="15m" />
<property name="infinispan-configuration" value="conf/standalone/cluster/test-infinispan-lock.xml" />
- <property name="jgroups-configuration" value="udp-mux.xml" />
+ <property name="jgroups-configuration" value="udp-mux-v3.xml" />
<property name="infinispan-cluster-name" value="JCR-cluster" />
<property name="infinispan-cl-cache.jdbc.table.name" value="lk" />
<property name="infinispan-cl-cache.jdbc.table.create" value="true" />
Added: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux-v3.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux-v3.xml (rev 0)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux-v3.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -0,0 +1,74 @@
+
+<!--
+ Default stack using IP multicasting. It is similar to the "udp"
+ stack in stacks.xml, but doesn't use streaming state transfer and flushing
+ author: Bela Ban
+-->
+
+<config xmlns="urn:org:jgroups"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
+ <UDP
+ singleton_name="JCR-cluster"
+ mcast_port="${jgroups.udp.mcast_port:45588}"
+ tos="8"
+ ucast_recv_buf_size="20M"
+ ucast_send_buf_size="640K"
+ mcast_recv_buf_size="25M"
+ mcast_send_buf_size="640K"
+ loopback="true"
+ discard_incompatible_packets="true"
+ max_bundle_size="64K"
+ max_bundle_timeout="30"
+ ip_ttl="${jgroups.udp.ip_ttl:8}"
+ enable_bundling="true"
+ enable_diagnostics="true"
+ thread_naming_pattern="cl"
+
+ timer_type="new"
+ timer.min_threads="4"
+ timer.max_threads="10"
+ timer.keep_alive_time="3000"
+ timer.queue_max_size="500"
+
+ thread_pool.enabled="true"
+ thread_pool.min_threads="2"
+ thread_pool.max_threads="8"
+ thread_pool.keep_alive_time="5000"
+ thread_pool.queue_enabled="true"
+ thread_pool.queue_max_size="10000"
+ thread_pool.rejection_policy="discard"
+
+ oob_thread_pool.enabled="true"
+ oob_thread_pool.min_threads="1"
+ oob_thread_pool.max_threads="8"
+ oob_thread_pool.keep_alive_time="5000"
+ oob_thread_pool.queue_enabled="false"
+ oob_thread_pool.queue_max_size="100"
+ oob_thread_pool.rejection_policy="Run"/>
+
+ <PING timeout="2000"
+ num_initial_members="3"/>
+ <MERGE2 max_interval="30000"
+ min_interval="10000"/>
+ <FD_SOCK/>
+ <FD_ALL/>
+ <VERIFY_SUSPECT timeout="1500" />
+ <BARRIER />
+ <pbcast.NAKACK exponential_backoff="300"
+ xmit_stagger_timeout="200"
+ use_mcast_xmit="false"
+ discard_delivered_msgs="true"/>
+ <UNICAST />
+ <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+ max_bytes="4M"/>
+ <pbcast.GMS print_local_addr="true" join_timeout="3000"
+ view_bundling="true"/>
+ <UFC max_credits="2M"
+ min_threshold="0.4"/>
+ <MFC max_credits="2M"
+ min_threshold="0.4"/>
+ <FRAG2 frag_size="60K" />
+ <pbcast.STATE_TRANSFER />
+ <!-- pbcast.FLUSH /-->
+</config>
\ No newline at end of file
Deleted: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/test/resources/conf/standalone/cluster/udp-mux.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -1,74 +0,0 @@
-
-<!--
- Default stack using IP multicasting. It is similar to the "udp"
- stack in stacks.xml, but doesn't use streaming state transfer and flushing
- author: Bela Ban
--->
-
-<config xmlns="urn:org:jgroups"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.0.xsd">
- <UDP
- singleton_name="JCR-cluster"
- mcast_port="${jgroups.udp.mcast_port:45588}"
- tos="8"
- ucast_recv_buf_size="20M"
- ucast_send_buf_size="640K"
- mcast_recv_buf_size="25M"
- mcast_send_buf_size="640K"
- loopback="true"
- discard_incompatible_packets="true"
- max_bundle_size="64K"
- max_bundle_timeout="30"
- ip_ttl="${jgroups.udp.ip_ttl:8}"
- enable_bundling="true"
- enable_diagnostics="true"
- thread_naming_pattern="cl"
-
- timer_type="new"
- timer.min_threads="4"
- timer.max_threads="10"
- timer.keep_alive_time="3000"
- timer.queue_max_size="500"
-
- thread_pool.enabled="true"
- thread_pool.min_threads="2"
- thread_pool.max_threads="8"
- thread_pool.keep_alive_time="5000"
- thread_pool.queue_enabled="true"
- thread_pool.queue_max_size="10000"
- thread_pool.rejection_policy="discard"
-
- oob_thread_pool.enabled="true"
- oob_thread_pool.min_threads="1"
- oob_thread_pool.max_threads="8"
- oob_thread_pool.keep_alive_time="5000"
- oob_thread_pool.queue_enabled="false"
- oob_thread_pool.queue_max_size="100"
- oob_thread_pool.rejection_policy="Run"/>
-
- <PING timeout="2000"
- num_initial_members="3"/>
- <MERGE2 max_interval="30000"
- min_interval="10000"/>
- <FD_SOCK/>
- <FD_ALL/>
- <VERIFY_SUSPECT timeout="1500" />
- <BARRIER />
- <pbcast.NAKACK exponential_backoff="300"
- xmit_stagger_timeout="200"
- use_mcast_xmit="false"
- discard_delivered_msgs="true"/>
- <UNICAST />
- <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
- max_bytes="4M"/>
- <pbcast.GMS print_local_addr="true" join_timeout="3000"
- view_bundling="true"/>
- <UFC max_credits="2M"
- min_threshold="0.4"/>
- <MFC max_credits="2M"
- min_threshold="0.4"/>
- <FRAG2 frag_size="60K" />
- <pbcast.STATE_TRANSFER />
- <!-- pbcast.FLUSH /-->
-</config>
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2012-03-22 12:18:56 UTC (rev 5939)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2012-03-22 13:27:52 UTC (rev 5940)
@@ -510,4 +510,20 @@
</listitem>
</orderedlist>
</section>
+ <section>
+ <title>Getting the effective configuration at Runtime of all the
+ repositories</title>
+
+ <para>The effective configuration of all the repositories and their
+ workspaces can be known thanks to the method
+ <emphasis>getConfigurationXML</emphasis>() that is exposed through JMX at
+ the <emphasis>RepositoryServiceConfiguration</emphasis> level in case of a
+ <emphasis>PortalContainer</emphasis> the name of the related MBean will be
+ of type
+ <emphasis>exo:portal=${portal-container-name},service=RepositoryServiceConfiguration</emphasis>.
+ This method will give you the effective configuration in XML format that
+ has been really interpreted by the the JCR core. This could be helpful to
+ understand how your repositories/workspaces are configured especially if
+ you would like to overwrite the configuration for some reasons.</para>
+ </section>
</chapter>
12 years, 1 month