exo-jcr SVN: r1738 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-02-09 09:08:57 -0500 (Tue, 09 Feb 2010)
New Revision: 1738
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java
Log:
EXOJCR-395 : check index possition
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2010-02-09 13:44:35 UTC (rev 1737)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2010-02-09 14:08:57 UTC (rev 1738)
@@ -554,7 +554,7 @@
// check if doc is a descendant of one of the context nodes
pDocs = hResolver.getParents(doc, pDocs);
- if (pDocs.length == 0) {
+ if (pDocs.length == 0 && pDocs[0] > 0) {
return false;
}
@@ -566,7 +566,8 @@
while (pDocs.length != 0) {
boolean valid = false;
for (int i = 0; i < pDocs.length; i++) {
- if (ancestorCount >= minLevels && contextHits.get(pDocs[i])) {
+ int pDoci = pDocs[i];
+ if (pDoci > 0 && pDoci <= contextHits.size() && ancestorCount >= minLevels && contextHits.get(pDoci)) {
valid = true;
break;
}
14 years, 8 months
exo-jcr SVN: r1737 - in jcr/trunk/exo.jcr.component.core/src: test/resources/conf/standalone and 1 other directories.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-09 08:44:35 -0500 (Tue, 09 Feb 2010)
New Revision: 1737
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/PreNPostCacheLoader.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jbosscache-lock.xml
jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-lock.xml
Log:
EXOJCR-467: Use a decorator on the top of configured cache loaded used for the JCR locks
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-02-09 08:54:21 UTC (rev 1736)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-02-09 13:44:35 UTC (rev 1737)
@@ -55,11 +55,13 @@
import org.exoplatform.services.naming.InitialContextInitializer;
import org.exoplatform.services.transaction.TransactionService;
import org.jboss.cache.Cache;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.loader.CacheLoader;
+import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.lock.TimeoutException;
import org.picocontainer.Startable;
@@ -246,9 +248,9 @@
cache = factory.createCache(config.getLockManager());
+ cache.create();
// Add the cache loader needed to prevent TimeoutException
- addCacheLoaders();
- cache.create();
+ addCacheLoader();
cache.start();
createStructuredNode(lockRoot);
@@ -348,7 +350,7 @@
* This methods adds programmatically the required {@link CacheLoader} needed to prevent
* any {@link TimeoutException}
*/
- private void addCacheLoaders()
+ private void addCacheLoader()
{
CacheLoaderConfig config = cache.getConfiguration().getCacheLoaderConfig();
List<IndividualCacheLoaderConfig> oldConfigs;
@@ -356,37 +358,39 @@
{
if (log.isInfoEnabled())
{
- log.info("No cache loader has been defined, thus no pre and post cache loader will be added");
+ log.info("No cache loader has been defined, thus no need to encapsulate any cache loader.");
}
return;
}
- PreNPostCacheLoader preCL = new PreNPostCacheLoader(true);
+ CacheLoaderManager clm = ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().getComponent(CacheLoaderManager.class);
+ if (clm == null)
+ {
+ log.error("The CacheLoaderManager cannot be found");
+ }
+ CacheLoader currentCL = clm.getCacheLoader();
+ if (currentCL == null)
+ {
+ log.error("The CacheLoader cannot be found");
+ }
+
+ ControllerCacheLoader ccl = new ControllerCacheLoader(currentCL);
+ List<IndividualCacheLoaderConfig> newConfig = new ArrayList<IndividualCacheLoaderConfig>(1);
// create CacheLoaderConfig
- IndividualCacheLoaderConfig preCLConfig = new IndividualCacheLoaderConfig();
+ IndividualCacheLoaderConfig cclConfig = new IndividualCacheLoaderConfig();
// set CacheLoader
- preCLConfig.setCacheLoader(preCL);
+ cclConfig.setCacheLoader(ccl);
// set parameters
- preCLConfig.setFetchPersistentState(false);
- preCLConfig.setAsync(false);
- preCLConfig.setIgnoreModifications(true);
- preCLConfig.setPurgeOnStartup(false);
- PreNPostCacheLoader postCL = new PreNPostCacheLoader(false);
- // create CacheLoaderConfig
- IndividualCacheLoaderConfig postCLConfig = new IndividualCacheLoaderConfig();
- // set CacheLoader
- postCLConfig.setCacheLoader(postCL);
- // set parameters
- postCLConfig.setFetchPersistentState(false);
- postCLConfig.setAsync(false);
- postCLConfig.setIgnoreModifications(true);
- postCLConfig.setPurgeOnStartup(false);
- List<IndividualCacheLoaderConfig> newConfigs = new ArrayList<IndividualCacheLoaderConfig>(oldConfigs);
- newConfigs.add(0, preCLConfig);
- newConfigs.add(postCLConfig);
- config.setIndividualCacheLoaderConfigs(newConfigs);
+ cclConfig.setFetchPersistentState(clm.isFetchPersistentState());
+ cclConfig.setAsync(false);
+ cclConfig.setIgnoreModifications(false);
+ CacheLoaderConfig.IndividualCacheLoaderConfig first = config.getFirstCacheLoaderConfig();
+ cclConfig.setPurgeOnStartup(first != null && first.isPurgeOnStartup());
+ newConfig.add(cclConfig);
+ config.setIndividualCacheLoaderConfigs(newConfig);
+
if (log.isInfoEnabled())
{
- log.info("The pre and post cache loaders have been added");
+ log.info("The configured cache loader has been encapsulated successfully");
}
}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-02-09 13:44:35 UTC (rev 1737)
@@ -0,0 +1,314 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.core.lock.jbosscache;
+
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.CacheStatus;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Modification;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.RegionManager;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.loader.CacheLoader;
+import org.jboss.cache.lock.TimeoutException;
+
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This {@link CacheLoader} is used to encapsulate the {@link CacheLoader} used to persist the data of the Locks.
+ * This is used to prevent {@link TimeoutException} that occur when several threads try to access the same data
+ * at the same time and the data is missing in the local cache which is the case most of the time, since no data
+ * means that the node is not locked. Since all the lock data will be loaded at startup, this {@link CacheLoader}
+ * will only call the nested {@link CacheLoader} for read operations when the cache status is CacheStatus.STARTING,
+ * for all other status, we don't call the nested cache loader since if no data cans be found in the local cache,
+ * it means that there is no data to load because all the lock data has been loaded at startup.
+ *
+ * Created by The eXo Platform SAS
+ * Author : Nicolas Filotto
+ * nicolas.filotto(a)exoplatform.com
+ * 9 f�vr. 2010
+ */
+@SuppressWarnings("unchecked")
+public class ControllerCacheLoader implements CacheLoader
+{
+ /**
+ * The nested cache loader
+ */
+ private final CacheLoader cl;
+
+ /**
+ * The related cache
+ */
+ private CacheSPI cache;
+
+ /**
+ * The configuration of the current cache loader
+ */
+ private IndividualCacheLoaderConfig config;
+
+ /**
+ * The default constructor
+ * @param cl the cache loader that will be managed by the controller
+ */
+ public ControllerCacheLoader(CacheLoader cl)
+ {
+ this.cl = cl;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#commit(java.lang.Object)
+ */
+ public void commit(Object tx) throws Exception
+ {
+ cl.commit(tx);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#exists(org.jboss.cache.Fqn)
+ */
+ public boolean exists(Fqn name) throws Exception
+ {
+ if (cache.getCacheStatus() == CacheStatus.STARTING)
+ {
+ // Before calling the nested cache loader we first check if the data exists in the local cache
+ // in order to prevent multiple call to the cache store
+ NodeSPI<?, ?> node = cache.peek(name, false);
+ if (node != null)
+ {
+ // The node already exists in the local cache, so we return true
+ return true;
+ }
+ else
+ {
+ // The node doesn't exist in the local cache, so we need to check through the nested
+ // cache loader
+ return cl.exists(name);
+ }
+ }
+ // All the data is loaded at startup, so no need to call the nested cache loader for another
+ // cache status other than CacheStatus.STARTING
+ return false;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#get(org.jboss.cache.Fqn)
+ */
+ public Map<Object, Object> get(Fqn name) throws Exception
+ {
+ if (cache.getCacheStatus() == CacheStatus.STARTING)
+ {
+ // Before calling the nested cache loader we first check if the data exists in the local cache
+ // in order to prevent multiple call to the cache store
+ NodeSPI node = cache.peek(name, false);
+ if (node != null)
+ {
+ // The node already exists in the local cache, so we return the corresponding data
+ return node.getDataDirect();
+ }
+ else
+ {
+ // The node doesn't exist in the local cache, so we need to check through the nested
+ // cache loader
+ return cl.get(name);
+ }
+ }
+ // All the data is loaded at startup, so no need to call the nested cache loader for another
+ // cache status other than CacheStatus.STARTING
+ return null;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#getChildrenNames(org.jboss.cache.Fqn)
+ */
+ public Set<?> getChildrenNames(Fqn fqn) throws Exception
+ {
+ if (cache.getCacheStatus() == CacheStatus.STARTING)
+ {
+ // Try to get the list of children name from the nested cache loader
+ return cl.getChildrenNames(fqn);
+ }
+ // All the data is loaded at startup, so no need to call the nested cache loader for another
+ // cache status other than CacheStatus.STARTING
+ return null;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#getConfig()
+ */
+ public IndividualCacheLoaderConfig getConfig()
+ {
+ return config;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#loadEntireState(java.io.ObjectOutputStream)
+ */
+ public void loadEntireState(ObjectOutputStream os) throws Exception
+ {
+ cl.loadEntireState(os);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#loadState(org.jboss.cache.Fqn, java.io.ObjectOutputStream)
+ */
+ public void loadState(Fqn subtree, ObjectOutputStream os) throws Exception
+ {
+ cl.loadState(subtree, os);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#prepare(java.lang.Object, java.util.List, boolean)
+ */
+ public void prepare(Object tx, List<Modification> modifications, boolean onePhase) throws Exception
+ {
+ cl.prepare(tx, modifications, onePhase);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#put(java.util.List)
+ */
+ public void put(List<Modification> modifications) throws Exception
+ {
+ cl.put(modifications);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#put(org.jboss.cache.Fqn, java.util.Map)
+ */
+ public void put(Fqn name, Map<Object, Object> attributes) throws Exception
+ {
+ cl.put(name, attributes);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
+ */
+ public Object put(Fqn name, Object key, Object value) throws Exception
+ {
+ return cl.put(name, key, value);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#remove(org.jboss.cache.Fqn)
+ */
+ public void remove(Fqn fqn) throws Exception
+ {
+ cl.remove(fqn);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#remove(org.jboss.cache.Fqn, java.lang.Object)
+ */
+ public Object remove(Fqn fqn, Object key) throws Exception
+ {
+ return cl.remove(fqn, key);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#removeData(org.jboss.cache.Fqn)
+ */
+ public void removeData(Fqn fqn) throws Exception
+ {
+ cl.removeData(fqn);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#rollback(java.lang.Object)
+ */
+ public void rollback(Object tx)
+ {
+ cl.rollback(tx);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#setCache(org.jboss.cache.CacheSPI)
+ */
+ public void setCache(CacheSPI c)
+ {
+ cl.setCache(c);
+ this.cache = c;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#setConfig(org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig)
+ */
+ public void setConfig(IndividualCacheLoaderConfig config)
+ {
+ this.config = config;
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#setRegionManager(org.jboss.cache.RegionManager)
+ */
+ public void setRegionManager(RegionManager manager)
+ {
+ cl.setRegionManager(manager);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#storeEntireState(java.io.ObjectInputStream)
+ */
+ public void storeEntireState(ObjectInputStream is) throws Exception
+ {
+ cl.storeEntireState(is);
+ }
+
+ /**
+ * @see org.jboss.cache.loader.CacheLoader#storeState(org.jboss.cache.Fqn, java.io.ObjectInputStream)
+ */
+ public void storeState(Fqn subtree, ObjectInputStream is) throws Exception
+ {
+ cl.storeState(subtree, is);
+ }
+
+ /**
+ * @see org.jboss.cache.Lifecycle#create()
+ */
+ public void create() throws Exception
+ {
+ cl.create();
+ }
+
+ /**
+ * @see org.jboss.cache.Lifecycle#destroy()
+ */
+ public void destroy()
+ {
+ cl.destroy();
+ }
+
+ /**
+ * @see org.jboss.cache.Lifecycle#start()
+ */
+ public void start() throws Exception
+ {
+ cl.start();
+ }
+
+ /**
+ * @see org.jboss.cache.Lifecycle#stop()
+ */
+ public void stop()
+ {
+ cl.stop();
+ }
+
+}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/PreNPostCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/PreNPostCacheLoader.java 2010-02-09 08:54:21 UTC (rev 1736)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/PreNPostCacheLoader.java 2010-02-09 13:44:35 UTC (rev 1737)
@@ -1,287 +0,0 @@
-/*
- * Copyright (C) 2003-2010 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.services.jcr.impl.core.lock.jbosscache;
-
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Modification;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.RegionManager;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
-import org.jboss.cache.loader.CacheLoader;
-import org.jboss.cache.lock.TimeoutException;
-
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This {@link CacheLoader} is used to encapsulate the {@link CacheLoader} used to persist the data of the Locks.
- * This is used to prevent {@link TimeoutException} that occur when several threads try to access the same data
- * at the same time and the data is missing in the local cache which is the case most of the time, since no data
- * means that the node is not locked. This {@link CacheLoader} will then check if some data exists before calling
- * the main {@link CacheLoader} that is used to persist the data and if no data exist either in the local cache and
- * the main {@link CacheLoader}, this {@link CacheLoader} will load dummy data to indicate that the data has already
- * been loaded.
- *
- * Created by The eXo Platform SAS
- * Author : Nicolas Filotto
- * nicolas.filotto(a)exoplatform.com
- * 4 f�vr. 2010
- */
-@SuppressWarnings("unchecked")
-public class PreNPostCacheLoader implements CacheLoader
-{
- /**
- * The configuration of the current cache loader
- */
- private IndividualCacheLoaderConfig config;
-
- /**
- * Indicates if this cache loader is called before the main cache loader of after the main cache loader
- */
- private boolean preCacheLoader;
-
- /**
- * The related cache
- */
- private CacheSPI cache;
-
- /**
- * The default constructor
- * @param preCacheLoader indicates if this cache loader must be added before the main cache loader or after it.
- * <code>true</code> means that it has been added before the main cache loader.
- */
- public PreNPostCacheLoader(boolean preCacheLoader)
- {
- this.preCacheLoader = preCacheLoader;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#commit(java.lang.Object)
- */
- public void commit(Object tx) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#exists(org.jboss.cache.Fqn)
- */
- public boolean exists(Fqn name) throws Exception
- {
- if (preCacheLoader)
- {
- // Before calling the main cache loader we first check if the data exists in the local cache
- // in order to prevent multiple call to the cache store
- return cache.peek(name, false) != null;
- }
- else
- {
- // The main cache loader has been called but no data could find into the cache store
- // so to prevent a multiple useless call, we return an empty map to enforce JBC to create
- // a node that will indicate that the data has already been loaded but no data was found
- return true;
- }
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#get(org.jboss.cache.Fqn)
- */
- public Map<Object, Object> get(Fqn name) throws Exception
- {
- if (preCacheLoader)
- {
- // Before calling the main cache loader we first check if the data exists in the local cache
- // in order to prevent multiple call to the cache store
- NodeSPI<Object, Object> node = cache.peek(name, false);
- if (node != null)
- {
- // The node exists which means that the data has already been loaded, so we return the data
- // already loaded
- return node.getDataDirect();
- }
- else
- {
- // No data has been loaded, so we can call the main cache loader
- return null;
- }
- }
- else
- {
- // The main cache loader has been called but no data could find into the cache store
- // so to prevent a multiple useless call, we return an empty map to enforce JBC to create
- // a node that will indicate that the data has already been loaded but no data was found
- return Collections.emptyMap();
- }
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#getChildrenNames(org.jboss.cache.Fqn)
- */
- public Set<?> getChildrenNames(Fqn fqn) throws Exception
- {
- return null;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#getConfig()
- */
- public IndividualCacheLoaderConfig getConfig()
- {
- return config;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#loadEntireState(java.io.ObjectOutputStream)
- */
- public void loadEntireState(ObjectOutputStream os) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#loadState(org.jboss.cache.Fqn, java.io.ObjectOutputStream)
- */
- public void loadState(Fqn subtree, ObjectOutputStream os) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#prepare(java.lang.Object, java.util.List, boolean)
- */
- public void prepare(Object tx, List<Modification> modifications, boolean onePhase) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#put(java.util.List)
- */
- public void put(List<Modification> modifications) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#put(org.jboss.cache.Fqn, java.util.Map)
- */
- public void put(Fqn name, Map<Object, Object> attributes) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
- */
- public Object put(Fqn name, Object key, Object value) throws Exception
- {
- return null;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#remove(org.jboss.cache.Fqn)
- */
- public void remove(Fqn fqn) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#remove(org.jboss.cache.Fqn, java.lang.Object)
- */
- public Object remove(Fqn fqn, Object key) throws Exception
- {
- return null;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#removeData(org.jboss.cache.Fqn)
- */
- public void removeData(Fqn fqn) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#rollback(java.lang.Object)
- */
- public void rollback(Object tx)
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#setCache(org.jboss.cache.CacheSPI)
- */
- public void setCache(CacheSPI cache)
- {
- this.cache = cache;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#setConfig(org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig)
- */
- public void setConfig(IndividualCacheLoaderConfig config)
- {
- this.config = config;
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#setRegionManager(org.jboss.cache.RegionManager)
- */
- public void setRegionManager(RegionManager manager)
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#storeEntireState(java.io.ObjectInputStream)
- */
- public void storeEntireState(ObjectInputStream is) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.loader.CacheLoader#storeState(org.jboss.cache.Fqn, java.io.ObjectInputStream)
- */
- public void storeState(Fqn subtree, ObjectInputStream is) throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.Lifecycle#create()
- */
- public void create() throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.Lifecycle#destroy()
- */
- public void destroy()
- {
- }
-
- /**
- * @see org.jboss.cache.Lifecycle#start()
- */
- public void start() throws Exception
- {
- }
-
- /**
- * @see org.jboss.cache.Lifecycle#stop()
- */
- public void stop()
- {
- }
-}
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jbosscache-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jbosscache-lock.xml 2010-02-09 08:54:21 UTC (rev 1736)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/cluster/test-jbosscache-lock.xml 2010-02-09 13:44:35 UTC (rev 1737)
@@ -11,6 +11,10 @@
</clustering>
<loaders passivation="false" shared="true">
+ <!-- All the data of the JCR locks needs to be loaded at startup -->
+ <preload>
+ <node fqn="/" />
+ </preload>
<!--
For another cache-loader class you should use another template with
cache-loader specific parameters
@@ -31,12 +35,4 @@
</properties>
</loader>
</loaders>
- <!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- eventQueueSize="1000000">
- <property name="maxNodes" value="200000" />
- <property name="timeToLive" value="120000" />
- </default>
- </eviction>
</jbosscache>
Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-lock.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2010-02-09 08:54:21 UTC (rev 1736)
+++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2010-02-09 13:44:35 UTC (rev 1737)
@@ -5,6 +5,10 @@
lockAcquisitionTimeout="20000" />
<loaders passivation="false" shared="true">
+ <!-- All the data of the JCR locks needs to be loaded at startup -->
+ <preload>
+ <node fqn="/" />
+ </preload>
<!--
For another cache-loader class you should use another template with
cache-loader specific parameters
@@ -25,12 +29,4 @@
</properties>
</loader>
</loaders>
- <!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- eventQueueSize="1000000">
- <property name="maxNodes" value="10000" />
- <property name="timeToLive" value="120000" />
- </default>
- </eviction>
</jbosscache>
14 years, 8 months
exo-jcr SVN: r1736 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-02-09 03:54:21 -0500 (Tue, 09 Feb 2010)
New Revision: 1736
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/TestEditedParentSearch.java
Log:
EXOJCR-395 : add info
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/TestEditedParentSearch.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/TestEditedParentSearch.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/TestEditedParentSearch.java 2010-02-09 08:54:21 UTC (rev 1736)
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.cluster.functional;
+
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+import org.exoplatform.services.jcr.core.CredentialsImpl;
+import org.exoplatform.services.jcr.impl.core.ItemImpl;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+import javax.jcr.Node;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public class TestEditedParentSearch extends JcrImplBaseTest
+{
+ /**
+ * Maximum number of nodes.
+ */
+ private static final int MAX_NODES_COUNT = 1000;
+
+ private static final String TEST_ROOT = "TestEditedParentSearch";
+
+ private static final String PROP1_NAME = "p1";
+
+ private static final String PROP2_NAME = "p2";
+
+ private static final String PROP1_VALUE = "v1";
+
+ private static final String PROP2_VALUE = "v2";
+
+ private List<String> paths;
+
+ /**
+ * Test Eduted parent search.
+ * @throws Exception
+ */
+ public void testEditedParentSearch() throws Exception
+ {
+ Node testRoot = root.addNode(TEST_ROOT);
+ session.save();
+ paths = new ArrayList<String>();
+
+ System.out.println("Initial (y/n) :");
+ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
+ String line = reader.readLine();
+ if (line.equals("y"))
+ {
+
+ for (int i = 0; i < MAX_NODES_COUNT; i++)
+ {
+ Node nodel1 = testRoot.addNode("NODE_L1_" + i);
+ Node nodel2 = nodel1.addNode("Node_L2");
+ nodel2.setProperty(PROP2_NAME, PROP2_VALUE);
+ session.save();
+ paths.add(nodel2.getPath());
+ }
+ }
+ else
+ {
+ for (int i = 0; i < MAX_NODES_COUNT; i++)
+ {
+ paths.add("/" + TEST_ROOT + "/" + "NODE_L1_" + i + "/" + "Node_L2");
+ }
+
+ }
+ Thread searchAgent = new Thread(new SearchAgent());
+ searchAgent.setName("searchAgent");
+ Thread editAgent = new Thread(new EditAgent());
+ editAgent.setName("editAgent");
+ editAgent.start();
+ searchAgent.start();
+
+ Thread.sleep(60 * 60 * 1000);
+ }
+
+ private class EditAgent implements Runnable
+ {
+
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run()
+ {
+
+ CredentialsImpl agentCredentials = new CredentialsImpl("admin", "admin".toCharArray());
+ Random random = new Random();
+
+ try
+ {
+ SessionImpl editSession = (SessionImpl)repository.login(agentCredentials, "ws");
+ while (true)
+ {
+
+ ItemImpl item = editSession.getItem(paths.get(random.nextInt(paths.size())));
+ NodeImpl parentNode = item.getParent();
+ parentNode.setProperty(PROP1_NAME, PROP1_VALUE);
+ editSession.save();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private class SearchAgent implements Runnable
+ {
+
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run()
+ {
+ try
+ {
+ CredentialsImpl agentCredentials = new CredentialsImpl("admin", "admin".toCharArray());
+ SessionImpl searchSession = (SessionImpl)repository.login(agentCredentials, "ws");
+ while (true)
+ {
+
+ Node testRoot = searchSession.getRootNode().getNode(TEST_ROOT);
+ // prepare nodes
+
+ Query q =
+ searchSession.getWorkspace().getQueryManager().createQuery(
+ "SELECT * FROM nt:base WHERE " + PROP2_NAME + "='" + PROP2_VALUE + "' AND jcr:path LIKE '"
+ + testRoot.getPath() + "/%'", Query.SQL);
+ long start = System.currentTimeMillis();
+ QueryResult res = q.execute();
+ long sqlsize = res.getNodes().getSize();
+ log.info("size=" + sqlsize + " time=" + (System.currentTimeMillis() - start));
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+ }
+
+}
Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/functional/TestEditedParentSearch.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 8 months
exo-jcr SVN: r1735 - parent/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-02-08 11:59:56 -0500 (Mon, 08 Feb 2010)
New Revision: 1735
Modified:
parent/trunk/pom.xml
Log:
Add clover2 plugin settings for sonar
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2010-02-08 16:51:54 UTC (rev 1734)
+++ parent/trunk/pom.xml 2010-02-08 16:59:56 UTC (rev 1735)
@@ -123,7 +123,11 @@
<maven.test.failure.ignore>false</maven.test.failure.ignore>
<surefire.useFile>true</surefire.useFile>
<exo.test.includes>Test*</exo.test.includes>
-
+ <!-- maven-clover2-plugin -->
+ <!-- where snapshots are stored to use clover optimization -->
+ <maven.clover.snapshot>${user.home}/.clover/${project.groupId}-${project.artifactId}/clover.snapshot</maven.clover.snapshot>
+ <!-- where historical data are stored -->
+ <maven.clover.historyDir>${user.home}/.clover/${project.groupId}-${project.artifactId}/clover.history</maven.clover.historyDir>
<!-- Defaut compiler settings -->
<maven.compiler.optimize>true</maven.compiler.optimize>
<maven.compiler.source>1.5</maven.compiler.source>
@@ -143,6 +147,7 @@
<!-- Plugins versions are defined in properties to reuse them between build and reporting parts if necessary -->
<version.animalsniffer.plugin>1.2</version.animalsniffer.plugin>
+ <version.clover2.plugin>2.6.3</version.clover2.plugin>
<jibx.plugin.version>1.2.1</jibx.plugin.version>
<javacc.plugin.version>2.5</javacc.plugin.version>
<jaxb2.plugin.version>0.1</jaxb2.plugin.version>
@@ -170,6 +175,11 @@
<version>${version.animalsniffer.plugin}</version>
</plugin>
<plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ <version>${version.clover2.plugin}</version>
+ </plugin>
+ <plugin>
<groupId>org.jibx</groupId>
<artifactId>maven-jibx-plugin</artifactId>
<version>${jibx.plugin.version}</version>
14 years, 8 months
exo-jcr SVN: r1734 - parent/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-02-08 11:51:54 -0500 (Mon, 08 Feb 2010)
New Revision: 1734
Modified:
parent/trunk/pom.xml
Log:
EXOJCR-454 : Replace the old plugin from java.net by the new enforcer rule from mojo available in central repo
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2010-02-08 16:17:05 UTC (rev 1733)
+++ parent/trunk/pom.xml 2010-02-08 16:51:54 UTC (rev 1734)
@@ -368,25 +368,36 @@
<doUpdate>false</doUpdate>
</configuration>
</plugin>
- <plugin>
- <groupId>org.jvnet</groupId>
- <artifactId>animal-sniffer</artifactId>
- <executions>
- <execution>
- <id>check-java-compatibility</id>
- <phase>compile</phase>
- <goals>
- <goal>check</goal>
- </goals>
- <configuration>
- <signature>
- <groupId>org.jvnet.animal-sniffer</groupId>
- <artifactId>java1.5</artifactId>
- <version>1.0</version>
- </signature>
- </configuration>
- </execution>
- </executions>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>animal-sniffer-enforcer-rule</artifactId>
+ <version>1.5</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>check-java15</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <checkSignatureRule implementation="org.codehaus.mojo.animal_sniffer.enforcer.CheckSignatureRule">
+ <signature>
+ <groupId>org.codehaus.mojo.signature</groupId>
+ <artifactId>java15</artifactId>
+ <version>1.0</version>
+ </signature>
+ <ignoreDependencies>true</ignoreDependencies>
+ </checkSignatureRule>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
14 years, 8 months
exo-jcr SVN: r1733 - parent/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-02-08 11:17:05 -0500 (Mon, 08 Feb 2010)
New Revision: 1733
Modified:
parent/trunk/pom.xml
Log:
EXOJCR-454 : Remove duplicated settings with jboss parent upgrade
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2010-02-08 16:15:48 UTC (rev 1732)
+++ parent/trunk/pom.xml 2010-02-08 16:17:05 UTC (rev 1733)
@@ -147,25 +147,6 @@
<javacc.plugin.version>2.5</javacc.plugin.version>
<jaxb2.plugin.version>0.1</jaxb2.plugin.version>
- <!--
- <assembly.plugin.version>2.2-beta-4</assembly.plugin.version>
- <buildnumber.plugin.version>1.0-beta-3</buildnumber.plugin.version>
- <clean.plugin.version>2.3</clean.plugin.version>
- <checkstyle.plugin.version>2.3</checkstyle.plugin.version>
- <compiler.plugin.version>2.0.2</compiler.plugin.version>
- <ear.plugin.version>2.3.2</ear.plugin.version>
- <enforcer.plugin.version>1.0-beta-1</enforcer.plugin.version>
- <install.plugin.version>2.3</install.plugin.version>
- <jar.plugin.version>2.2</jar.plugin.version>
- <javadoc.plugin.version>2.6</javadoc.plugin.version>
- <project.info.reports.plugin.version>2.1.2</project.info.reports.plugin.version>
- <release.plugin.version>2.0-beta-9</release.plugin.version>
- <site.plugin.version>2.0.1</site.plugin.version>
- <surefire.plugin.version>2.4.3</surefire.plugin.version>
- <surefire.report.plugin.version>2.4.3</surefire.report.plugin.version>
- <taglist.plugin.version>2.3</taglist.plugin.version>
- <war.plugin.version>2.1-beta-1</war.plugin.version>
- -->
</properties>
<dependencyManagement>
14 years, 8 months
exo-jcr SVN: r1732 - parent/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-02-08 11:15:48 -0500 (Mon, 08 Feb 2010)
New Revision: 1732
Modified:
parent/trunk/pom.xml
Log:
EXOJCR-454 : Remove duplicated settings with jboss parent upgrade
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2010-02-08 15:49:38 UTC (rev 1731)
+++ parent/trunk/pom.xml 2010-02-08 16:15:48 UTC (rev 1732)
@@ -137,8 +137,17 @@
<!-- Will be an entry in the POM in the future -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- maven-release-plugin settings -->
+ <arguments>-Prelease -DskipTests</arguments>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+
<!-- Plugins versions are defined in properties to reuse them between build and reporting parts if necessary -->
- <animalsniffer.plugin.version>1.2</animalsniffer.plugin.version>
+ <version.animalsniffer.plugin>1.2</version.animalsniffer.plugin>
+ <jibx.plugin.version>1.2.1</jibx.plugin.version>
+ <javacc.plugin.version>2.5</javacc.plugin.version>
+ <jaxb2.plugin.version>0.1</jaxb2.plugin.version>
+
+ <!--
<assembly.plugin.version>2.2-beta-4</assembly.plugin.version>
<buildnumber.plugin.version>1.0-beta-3</buildnumber.plugin.version>
<clean.plugin.version>2.3</clean.plugin.version>
@@ -148,10 +157,7 @@
<enforcer.plugin.version>1.0-beta-1</enforcer.plugin.version>
<install.plugin.version>2.3</install.plugin.version>
<jar.plugin.version>2.2</jar.plugin.version>
- <javacc.plugin.version>2.5</javacc.plugin.version>
<javadoc.plugin.version>2.6</javadoc.plugin.version>
- <jaxb2.plugin.version>0.1</jaxb2.plugin.version>
- <jibx.plugin.version>1.2.1</jibx.plugin.version>
<project.info.reports.plugin.version>2.1.2</project.info.reports.plugin.version>
<release.plugin.version>2.0-beta-9</release.plugin.version>
<site.plugin.version>2.0.1</site.plugin.version>
@@ -159,6 +165,7 @@
<surefire.report.plugin.version>2.4.3</surefire.report.plugin.version>
<taglist.plugin.version>2.3</taglist.plugin.version>
<war.plugin.version>2.1-beta-1</war.plugin.version>
+ -->
</properties>
<dependencyManagement>
@@ -179,40 +186,18 @@
<plugin>
<groupId>org.jvnet</groupId>
<artifactId>animal-sniffer</artifactId>
- <version>${animalsniffer.plugin.version}</version>
+ <version>${version.animalsniffer.plugin}</version>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clean-plugin</artifactId>
- <version>${clean.plugin.version}</version>
+ <groupId>org.jibx</groupId>
+ <artifactId>maven-jibx-plugin</artifactId>
+ <version>${jibx.plugin.version}</version>
</plugin>
- <!-- Compilation Plugin Configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${compiler.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>${enforcer.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <version>${install.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <version>${jar.plugin.version}</version>
<configuration>
- <configuration>
- <source>${maven.compiler.source}</source>
- <target>${maven.compiler.target}</target>
- </configuration>
<archive>
- <!-- Manifest management -->
<manifestEntries>
<SCM-URL>${project.scm.connection}</SCM-URL>
<Specification-Title>${exo.product.name}</Specification-Title>
@@ -226,35 +211,18 @@
</configuration>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>${release.plugin.version}</version>
- <!-- We can use properties to set it because
- config is already set in jboss-parent -->
- <configuration>
- <useReleaseProfile>false</useReleaseProfile>
- <arguments>-Prelease -Dmaven.test.skip=true</arguments>
- <autoVersionSubmodules>true</autoVersionSubmodules>
- </configuration>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javacc-maven-plugin</artifactId>
+ <version>${javacc.plugin.version}</version>
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>${site.plugin.version}</version>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <version>${jaxb2.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <!-- Version from JBoss -->
- <configuration>
- <!-- This is a workaroud for MSOURCES-44 -->
- <includePom>true</includePom>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.plugin.version}</version>
<configuration>
<includes>
<include>**/${exo.test.includes}.java</include>
@@ -264,7 +232,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>${war.plugin.version}</version>
<configuration>
<archive>
<manifestEntries>
@@ -279,51 +246,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <version>${buildnumber.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>${javacc.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.jibx</groupId>
- <artifactId>maven-jibx-plugin</artifactId>
- <version>${jibx.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>${jaxb2.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>${checkstyle.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>${javadoc.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- <version>${taglist.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ear-plugin</artifactId>
- <version>${ear.plugin.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.plugin.version}</version>
- </plugin>
</plugins>
</pluginManagement>
</build>
14 years, 8 months
exo-jcr SVN: r1731 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-02-08 10:49:38 -0500 (Mon, 08 Feb 2010)
New Revision: 1731
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
Log:
EXOJCR-305: To avoid calling the LockManager for new nodes, we first check if the node is new before calling the LockManager, if the node is new we try to check its parent node until we find an old node to test
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-02-08 15:41:54 UTC (rev 1730)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-02-08 15:49:38 UTC (rev 1731)
@@ -1355,10 +1355,41 @@
{
checkValid();
- return session.getLockManager().isLocked((NodeData)this.getData());
+ return isLocked(this);
}
/**
+ * Checks if a given node is locked only if the node is not new otherwise, we check the first
+ * ancestor that is not new
+ * @param node the node to check
+ * @return <code>true</code> if the node is locked, <code>false</code> otherwise
+ * @throws RepositoryException if an error occurs
+ */
+ private boolean isLocked(NodeImpl node) throws RepositoryException
+ {
+ if (dataManager.isNew(node.getInternalIdentifier()))
+ {
+ // The node is new, so we will check directly its parent instead
+ NodeImpl parent = node.getParent();
+ if (parent == null)
+ {
+ // The node is the root node and is new, so we consider it as unlocked
+ return false;
+ }
+ else
+ {
+ // the node has a parent that we need to test
+ return isLocked(parent);
+ }
+ }
+ else
+ {
+ // The node already exists so we need to check if it is locked
+ return session.getLockManager().isLocked((NodeData)node.getData());
+ }
+ }
+
+ /**
* {@inheritDoc}
*/
public boolean isNode()
14 years, 8 months
exo-jcr SVN: r1730 - parent/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-02-08 10:41:54 -0500 (Mon, 08 Feb 2010)
New Revision: 1730
Modified:
parent/trunk/pom.xml
Log:
EXOJCR-454 : Ensure Java 6 is used to build
Modified: parent/trunk/pom.xml
===================================================================
--- parent/trunk/pom.xml 2010-02-08 15:38:50 UTC (rev 1729)
+++ parent/trunk/pom.xml 2010-02-08 15:41:54 UTC (rev 1730)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
- <version>5-beta-1</version>
+ <version>5-beta-5</version>
</parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
@@ -128,13 +128,17 @@
<maven.compiler.optimize>true</maven.compiler.optimize>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
-
+ <!-- maven-enforcer-plugin -->
+ <!-- Java 6 is required to build our projects -->
+ <jdk.min.version>1.6</jdk.min.version>
+
<!-- Encoding used for files in the project -->
<!-- Standard property supported by many plugins : compiler, resources, ... -->
<!-- Will be an entry in the POM in the future -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- Plugins versions are defined in propertiesto reuse them between build and reporting parts if necessary -->
+ <!-- Plugins versions are defined in properties to reuse them between build and reporting parts if necessary -->
+ <animalsniffer.plugin.version>1.2</animalsniffer.plugin.version>
<assembly.plugin.version>2.2-beta-4</assembly.plugin.version>
<buildnumber.plugin.version>1.0-beta-3</buildnumber.plugin.version>
<clean.plugin.version>2.3</clean.plugin.version>
@@ -173,6 +177,11 @@
<pluginManagement>
<plugins>
<plugin>
+ <groupId>org.jvnet</groupId>
+ <artifactId>animal-sniffer</artifactId>
+ <version>${animalsniffer.plugin.version}</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${clean.plugin.version}</version>
@@ -459,7 +468,6 @@
<plugin>
<groupId>org.jvnet</groupId>
<artifactId>animal-sniffer</artifactId>
- <version>1.2</version>
<executions>
<execution>
<id>check-java-compatibility</id>
14 years, 8 months
exo-jcr SVN: r1729 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-02-08 10:38:50 -0500 (Mon, 08 Feb 2010)
New Revision: 1729
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponceTimeTest.java
Log:
EXOJCR-395 : remove log
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponceTimeTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponceTimeTest.java 2010-02-08 15:31:16 UTC (rev 1728)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/cluster/load/query/JcrQueryAvgResponceTimeTest.java 2010-02-08 15:38:50 UTC (rev 1729)
@@ -60,7 +60,7 @@
/**
* 2min default time of work of one iteration.
*/
- private static final int ITERATION_TIME = 20 * 60 * 1000;
+ private static final int ITERATION_TIME = 60 * 1000;
/**
* How much thread will be added on the next iteration.
@@ -88,7 +88,7 @@
public void testname() throws Exception
{
QueryAvgResponceTimeTest test =
- new QueryAvgResponceTimeTest(repository, ITERATION_GROWING_POLL, ITERATION_TIME, 15, READ_VALUE);
+ new QueryAvgResponceTimeTest(repository, ITERATION_GROWING_POLL, ITERATION_TIME, 5, READ_VALUE);
test.testResponce();
}
@@ -239,7 +239,7 @@
QueryResult res = q.execute();
long sqlsize = res.getNodes().getSize();
result.add(new WorkerResult(true, System.currentTimeMillis() - start));
- log.info(word + " found:" + sqlsize + " time=" + (System.currentTimeMillis() - start));
+ //log.info(word + " found:" + sqlsize + " time=" + (System.currentTimeMillis() - start));
}
catch (Exception e)
14 years, 8 months