exo-jcr SVN: r5417 - in kernel/branches/2.4.x: exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl and 8 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-04 06:37:05 -0500 (Wed, 04 Jan 2012)
New Revision: 5417
Added:
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ClassLoading.java
Modified:
kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/Log4JConfigurator.java
kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java
kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/CronJob.java
kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/PeriodJob.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/services/log/LogConfigurationInitializer.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLCollection.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLMap.java
kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLObject.java
Log:
EXOJCR-1580: Make eXo JCR supports JBoss AS7
Added: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ClassLoading.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ClassLoading.java (rev 0)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/ClassLoading.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -0,0 +1,209 @@
+/*
+ * 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.commons.utils;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: ClassLoading.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class ClassLoading
+{
+ /**
+ * The logger
+ */
+ private static final Log LOG = ExoLogger.getLogger("org.exoplatform.commons.utils.ClassLoader");
+
+ /**
+ * Loads the class using the ClassLoader corresponding to the caller object first,
+ * if class not found we try with Thread's context ClassLoader (TCCL).
+ * If the TCCL doesn't exist or the class still cannot be found, we use the
+ * System class loader.
+ *
+ * @param type FQN of class to load
+ * @param callerObject the object from which we want to load the class
+ * @return Loaded class
+ * @throws ClassNotFoundException
+ */
+ public static Class<?> forName(String type, Object callerObject) throws ClassNotFoundException
+ {
+ return forName(type, callerObject.getClass());
+ }
+
+ /**
+ * Loads the class using the ClassLoader corresponding to the caller class first,
+ * if class not found we try with Thread's context ClassLoader (TCCL).
+ * If the TCCL doesn't exist or the class still cannot be found, we use the
+ * System class loader.
+ *
+ * @param type FQN of class to load
+ * @param callerClass the class from which we want to load the class
+ * @return Loaded class
+ * @throws ClassNotFoundException
+ */
+ public static Class<?> forName(String type, Class<?> callerClass) throws ClassNotFoundException
+ {
+ try
+ {
+ // We first try with the local class loader
+ return Class.forName(type, true, callerClass.getClassLoader());
+ }
+ catch (ClassNotFoundException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The class " + type + " could not be found in the Class loader of " + callerClass);
+ }
+ // Then we try with the Thread Context Class loader
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ if (cl != null)
+ {
+ return Class.forName(type, true, cl);
+ }
+ else if (LOG.isTraceEnabled())
+ {
+ LOG.trace("No thread context Class loader could be found to load the class " + type);
+ }
+ }
+ catch (ClassNotFoundException e1)
+ {
+ // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The class " + type + " could not be found in the thread context Class loader");
+ }
+ cl = null;
+ }
+ // Finally we test with the system class loader
+ try
+ {
+ cl = ClassLoader.getSystemClassLoader();
+ }
+ catch (Exception e1)
+ {
+ // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The system Class loader could not be found to load the class " + type, e1);
+ }
+ }
+ if (cl != null)
+ {
+ return Class.forName(type, true, cl);
+ }
+ else if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The system Class loader could not be found to load the class " + type);
+ }
+ throw e;
+ }
+ }
+
+ /**
+ * Loads the class using the ClassLoader corresponding to the caller object first,
+ * if class not found we try with Thread's context ClassLoader (TCCL).
+ * If the TCCL doesn't exist or the class still cannot be found, we use the
+ * System class loader.
+ *
+ * @param type FQN of class to load
+ * @param callerObject the object from which we want to load the class
+ * @return Loaded class
+ * @throws ClassNotFoundException
+ */
+ public static Class<?> loadClass(String type, Object callerObject) throws ClassNotFoundException
+ {
+ return loadClass(type, callerObject.getClass());
+ }
+
+ /**
+ * Loads the class using the ClassLoader corresponding to the caller class first,
+ * if class not found we try with Thread's context ClassLoader (TCCL).
+ * If the TCCL doesn't exist or the class still cannot be found, we use the
+ * System class loader.
+ *
+ * @param type FQN of class to load
+ * @param callerClass the class from which we want to load the class
+ * @return Loaded class
+ * @throws ClassNotFoundException
+ */
+ public static Class<?> loadClass(String type, Class<?> callerClass) throws ClassNotFoundException
+ {
+ ClassLoader localCl = callerClass.getClassLoader();
+ try
+ {
+ return localCl.loadClass(type);
+ }
+ catch (ClassNotFoundException e)
+ {
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The class " + type + " could not be found in the Class loader of " + callerClass);
+ }
+ // Then we try with the Thread Context Class loader
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ if (cl != null)
+ {
+ return cl.loadClass(type);
+ }
+ else if (LOG.isTraceEnabled())
+ {
+ LOG.trace("No thread context Class loader could be found to load the class " + type);
+ }
+ }
+ catch (ClassNotFoundException e1)
+ {
+ // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The class " + type + " could not be found in the thread context Class loader");
+ }
+ cl = null;
+ }
+ // Finally we test with the system class loader
+ try
+ {
+ cl = ClassLoader.getSystemClassLoader();
+ }
+ catch (Exception e1)
+ {
+ // ignore me
+ if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The system Class loader could not be found to load the class " + type, e1);
+ }
+ }
+ if (cl != null)
+ {
+ return cl.loadClass(type);
+ }
+ else if (LOG.isTraceEnabled())
+ {
+ LOG.trace("The system Class loader could not be found to load the class " + type);
+ }
+ throw e;
+ }
+ }
+
+}
Modified: kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/Log4JConfigurator.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/Log4JConfigurator.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.commons/src/main/java/org/exoplatform/services/log/impl/Log4JConfigurator.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.log.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.log.AbstractLogConfigurator;
@@ -43,7 +44,7 @@
{
try
{
- Class<?> propertyConfiguratorClass = Class.forName("org.apache.log4j.PropertyConfigurator");
+ Class<?> propertyConfiguratorClass = ClassLoading.forName("org.apache.log4j.PropertyConfigurator", Log4JConfigurator.class);
Method m = propertyConfiguratorClass.getMethod("configure", Properties.class);
m.invoke(null, properties);
}
Modified: kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl/CacheServiceImpl.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.cache.impl;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.management.annotations.ManagedBy;
@@ -47,6 +48,7 @@
* Created by The eXo Platform SAS. Author : Tuan Nguyen
* tuan08(a)users.sourceforge.net Sat, Sep 13, 2003 @ Time: 1:12:22 PM
*/
+@SuppressWarnings("deprecation")
@ManagedBy(CacheServiceManaged.class)
public class CacheServiceImpl implements CacheService
{
@@ -175,9 +177,8 @@
// we assume that we expect to use the default cache factory
try
{
- final ClassLoader cl = Thread.currentThread().getContextClassLoader();
// We check if the given implementation is a known class
- Class implClass = cl.loadClass(safeConfig.getImplementation());
+ Class<?> implClass = ClassLoading.loadClass(safeConfig.getImplementation(), this);
// Implementation is an existing class
if (ExoCache.class.isAssignableFrom(implClass))
{
@@ -239,6 +240,7 @@
/**
* {@inheritDoc}
*/
+ @SuppressWarnings({"rawtypes", "unchecked"})
public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitException
{
final ExoCache simple = createCacheInstance(config);
@@ -246,11 +248,6 @@
simple.setLabel(config.getLabel());
simple.setMaxSize(config.getMaxSize());
simple.setLiveTime(config.getLiveTime());
- // simple.setReplicated(config.isRepicated());
- // simple.setDistributed(config.isDistributed());
- // if (simple.isDistributed()) {
- // simple.addCacheListener(distrbutedListener_);
- // }
simple.setLogEnabled(config.isLogEnabled());
if (simple.isLogEnabled())
{
@@ -265,7 +262,7 @@
* @return a new instance of ExoCache
* @throws ExoCacheInitException if any exception happens while initializing the cache
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
private ExoCache createCacheInstance(ExoCacheConfig config) throws ExoCacheInitException
{
if (config.getImplementation() == null)
@@ -276,10 +273,9 @@
else
{
// An implementation has been defined
- final ClassLoader cl = Thread.currentThread().getContextClassLoader();
try
{
- final Class clazz = cl.loadClass(config.getImplementation());
+ final Class<?> clazz = ClassLoading.loadClass(config.getImplementation(), this);
return (ExoCache)clazz.newInstance();
}
catch (Exception e)
Modified: kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/CronJob.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/CronJob.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/CronJob.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.scheduler;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.ExoProperties;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
@@ -42,7 +43,7 @@
String jobName = props.getProperty("jobName");
String jobGroup = props.getProperty("groupName");
String jobClass = props.getProperty("job");
- Class clazz = Class.forName(jobClass);
+ Class<?> clazz = ClassLoading.forName(jobClass, this);
jinfo_ = new JobInfo(jobName, jobGroup, clazz);
expression_ = props.getProperty("expression");
Modified: kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/PeriodJob.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/PeriodJob.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/PeriodJob.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.scheduler;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.ExoProperties;
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
@@ -47,7 +48,7 @@
String jobName = props.getProperty("jobName");
String jobGroup = props.getProperty("groupName");
String jobClass = props.getProperty("job");
- Class clazz = Class.forName(jobClass);
+ Class<?> clazz = ClassLoading.forName(jobClass, this);
jinfo_ = new JobInfo(jobName, jobGroup, clazz);
Date startTime = getDate(props.getProperty("startTime"));
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/jmx/MX4JComponentAdapter.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.container.jmx;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.component.ComponentLifecycle;
@@ -54,7 +55,7 @@
private Log log = ExoLogger.getLogger("exo.kernel.container.MX4JComponentAdapter");
- public MX4JComponentAdapter(Object key, Class implementation)
+ public MX4JComponentAdapter(Object key, Class<?> implementation)
{
super(key, implementation);
}
@@ -83,7 +84,7 @@
if (key instanceof String)
componentKey = (String)key;
else
- componentKey = ((Class)key).getName();
+ componentKey = ((Class<?>)key).getName();
manager = (ConfigurationManager)exocontainer.getComponentInstanceOfType(ConfigurationManager.class);
component = manager.getComponent(componentKey);
if (component != null)
@@ -150,11 +151,11 @@
try
{
- Class pluginClass = Class.forName(plugin.getType());
+ Class<?> pluginClass = ClassLoading.forName(plugin.getType(), this);
ComponentPlugin cplugin = (ComponentPlugin)container.createComponent(pluginClass, plugin.getInitParams());
cplugin.setName(plugin.getName());
cplugin.setDescription(plugin.getDescription());
- Class clazz = component.getClass();
+ Class<?> clazz = component.getClass();
final Method m = getSetMethod(clazz, plugin.getSetMethod(), pluginClass);
if (m == null)
@@ -195,7 +196,7 @@
* @param pluginClass the {@link Class} of the plugin
* @return the "set method" corresponding to the given context
*/
- private Method getSetMethod(Class clazz, String name, Class pluginClass)
+ private Method getSetMethod(Class<?> clazz, String name, Class<?> pluginClass)
{
Method[] methods = clazz.getMethods();
Method bestCandidate = null;
@@ -204,7 +205,7 @@
{
if (name.equals(m.getName()))
{
- Class[] types = m.getParameterTypes();
+ Class<?>[] types = m.getParameterTypes();
if (types != null && types.length == 1 && ComponentPlugin.class.isAssignableFrom(types[0]))
{
int currentDepth = getClosestMatchDepth(pluginClass, types[0]);
@@ -230,7 +231,7 @@
* @param type the class from which the plugin must be assignable
* @return The total amount of times we had to up the hierarchy of the plugin
*/
- private static int getClosestMatchDepth(Class pluginClass, Class type)
+ private static int getClosestMatchDepth(Class<?> pluginClass, Class<?> type)
{
return getClosestMatchDepth(pluginClass, type, 0);
}
@@ -243,7 +244,7 @@
* @param depth the current amount of times that we had to up the hierarchy of the plugin
* @return The total amount of times we had to up the hierarchy of the plugin
*/
- private static int getClosestMatchDepth(Class pluginClass, Class type, int depth)
+ private static int getClosestMatchDepth(Class<?> pluginClass, Class<?> type, int depth)
{
if (pluginClass == null || pluginClass.isAssignableFrom(type))
{
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/monitor/jvm/J2EEServerInfo.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.container.monitor.jvm;
-import org.exoplatform.commons.utils.PrivilegedSystemHelper;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -28,7 +27,6 @@
import java.lang.reflect.Method;
import java.net.URI;
import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
import javax.management.MBeanServer;
@@ -70,125 +68,140 @@
public J2EEServerInfo()
{
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
- String jonasHome = PrivilegedSystemHelper.getProperty("jonas.base");
- String jbossHome = PrivilegedSystemHelper.getProperty("jboss.home.dir");
- String jettyHome = PrivilegedSystemHelper.getProperty("jetty.home");
- String websphereHome = PrivilegedSystemHelper.getProperty("was.install.root");
- String weblogicHome = PrivilegedSystemHelper.getProperty("wls.home");
- String glassfishHome = PrivilegedSystemHelper.getProperty("com.sun.aas.instanceRoot");
- String catalinaHome = PrivilegedSystemHelper.getProperty("catalina.home");
- String testHome = PrivilegedSystemHelper.getProperty("maven.exoplatform.dir");
+ String jonasHome = System.getProperty("jonas.base");
+ String jbossHome = System.getProperty("jboss.home.dir");
+ String jettyHome = System.getProperty("jetty.home");
+ String websphereHome = System.getProperty("was.install.root");
+ String weblogicHome = System.getProperty("wls.home");
+ String glassfishHome = System.getProperty("com.sun.aas.instanceRoot");
+ String catalinaHome = System.getProperty("catalina.home");
+ String testHome = System.getProperty("maven.exoplatform.dir");
- // The name of the configuration directory
- final String confDirName = PrivilegedSystemHelper.getProperty(EXO_CONF_DIR_NAME_PARAM, "exo-conf");
- if (jonasHome != null)
- {
- serverName_ = "jonas";
- serverHome_ = jonasHome;
- }
- else if (jbossHome != null)
- {
- serverName_ = "jboss";
- serverHome_ = jbossHome;
+ // The name of the configuration directory
+ final String confDirName = System.getProperty(EXO_CONF_DIR_NAME_PARAM, "exo-conf");
+ if (jonasHome != null)
+ {
+ serverName_ = "jonas";
+ serverHome_ = jonasHome;
+ }
+ else if (jbossHome != null)
+ {
+ serverName_ = "jboss";
+ serverHome_ = jbossHome;
- // try find and use jboss.server.config.url
- // based on http://www.jboss.org/community/docs/DOC-10730
- String jbossConfigUrl = PrivilegedSystemHelper.getProperty("jboss.server.config.url");
- if (jbossConfigUrl != null)
- {
- try
+ // try find and use jboss.server.config.url
+ // based on http://www.jboss.org/community/docs/DOC-10730
+ String jbossConfigUrl = System.getProperty("jboss.server.config.url");
+ if (jbossConfigUrl != null)
+ {
+ try
+ {
+ exoConfDir_ = new File(new File(new URI(jbossConfigUrl)), confDirName).getAbsolutePath();
+ }
+ catch (Throwable e)
+ {
+ // don't care about it
+ }
+ }
+ else
+ {
+ // New variable that exists only since JBoss AS 7
+ String jbossConfigDir = System.getProperty("jboss.server.config.dir");
+ if (jbossConfigDir != null)
+ {
+ try
+ {
+ exoConfDir_ = new File(jbossConfigDir, confDirName).getAbsolutePath();
+ }
+ catch (Throwable e)
+ {
+ // don't care about it
+ }
+ }
+ }
+ try
+ {
+ Class<?> clazz = Thread.currentThread().getContextClassLoader()
+ .loadClass("org.jboss.mx.util.MBeanServerLocator");
+ Method m = clazz.getMethod("locateJBoss");
+ mbeanServer = (MBeanServer)m.invoke(null);
+ }
+ catch (ClassNotFoundException ignore)
+ {
+ // We assume that JBoss AS 7 or higher is currently used
+ // since this class has been removed starting from this version
+ // of JBoss AS
+ log.debug(ignore.getLocalizedMessage(), ignore);
+ }
+ catch (Exception ignore)
+ {
+ log.error(ignore.getLocalizedMessage(), ignore);
+ }
+ }
+ else if (jettyHome != null)
{
- exoConfDir_ = new File(new File(new URI(jbossConfigUrl)), confDirName).getAbsolutePath();
+ serverName_ = "jetty";
+ serverHome_ = jettyHome;
}
- catch (Throwable e)
+ else if (websphereHome != null)
{
- // don't care about it
+ serverName_ = "websphere";
+ serverHome_ = websphereHome;
}
- }
-
- //
- try
- {
- Class clazz = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Class>()
+ else if (weblogicHome != null)
{
- public Class run() throws Exception
- {
- return Thread.currentThread().getContextClassLoader()
- .loadClass("org.jboss.mx.util.MBeanServerLocator");
- }
- });
+ serverName_ = "weblogic";
+ serverHome_ = weblogicHome;
+ }
+ else if (glassfishHome != null)
+ {
+ serverName_ = "glassfish";
+ serverHome_ = glassfishHome;
+ }
+ else if (catalinaHome != null)
+ {
+ // Catalina has to be processed at the end as other servers may embed it
+ serverName_ = "tomcat";
+ serverHome_ = catalinaHome;
+ }
+ else if (testHome != null)
+ {
+ serverName_ = "test";
+ serverHome_ = testHome;
+ }
+ else
+ {
+ // throw new UnsupportedOperationException("unknown server platform") ;
+ serverName_ = "standalone";
+ serverHome_ = System.getProperty("user.dir");
+ }
+ if (exoConfDir_ == null)
+ {
+ exoConfDir_ = serverHome_ + "/" + confDirName;
+ }
+ if (mbeanServer == null)
+ {
+ mbeanServer = ManagementFactory.getPlatformMBeanServer();
+ }
- Method m = clazz.getMethod("locateJBoss");
- mbeanServer = (MBeanServer)m.invoke(null);
- }
- catch (Exception ignore)
- {
- log.error(ignore.getLocalizedMessage(), ignore);
- }
- }
- else if (jettyHome != null)
- {
- serverName_ = "jetty";
- serverHome_ = jettyHome;
- }
- else if (websphereHome != null)
- {
- serverName_ = "websphere";
- serverHome_ = websphereHome;
- }
- else if (weblogicHome != null)
- {
- serverName_ = "weblogic";
- serverHome_ = weblogicHome;
- }
- else if (glassfishHome != null)
- {
- serverName_ = "glassfish";
- serverHome_ = glassfishHome;
- }
- else if (catalinaHome != null)
- {
- // Catalina has to be processed at the end as other servers may embed it
- serverName_ = "tomcat";
- serverHome_ = catalinaHome;
- }
- else if (testHome != null)
- {
- serverName_ = "test";
- serverHome_ = testHome;
- }
- else
- {
- // throw new UnsupportedOperationException("unknown server platform") ;
- serverName_ = "standalone";
- serverHome_ = PrivilegedSystemHelper.getProperty("user.dir");
- }
- if (exoConfDir_ == null)
- {
- exoConfDir_ = serverHome_ + "/" + confDirName;
- }
- if (mbeanServer == null)
- {
- mbeanServer = SecurityHelper.doPrivilegedAction(new PrivilegedAction<MBeanServer>()
- {
- public MBeanServer run()
+ String exoConfHome = System.getProperty(EXO_CONF_PARAM);
+ if (exoConfHome != null && exoConfHome.length() > 0)
{
- return ManagementFactory.getPlatformMBeanServer();
+ log.info("Override exo-conf directory '" + exoConfDir_ + "' with location '" + exoConfHome
+ + "'");
+ exoConfDir_ = exoConfHome;
}
- });
- }
- String exoConfHome = PrivilegedSystemHelper.getProperty(EXO_CONF_PARAM);
- if (exoConfHome != null && exoConfHome.length() > 0)
- {
- log.info("Override exo-conf directory '" + exoConfDir_ + "' with location '" + exoConfHome
- + "'");
- exoConfDir_ = exoConfHome;
- }
-
- serverHome_ = serverHome_.replace('\\', '/');
- exoConfDir_ = exoConfDir_.replace('\\', '/');
+ serverHome_ = serverHome_.replace('\\', '/');
+ exoConfDir_ = exoConfDir_.replace('\\', '/');
+ return null;
+ }
+ });
}
/**
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/util/ContainerUtil.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.container.util;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.PropertiesLoader;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.commons.utils.Tools;
@@ -132,7 +133,7 @@
{
try
{
- Class clazz = Class.forName(plugin.getType());
+ Class<?> clazz = ClassLoading.forName(plugin.getType(), ContainerUtil.class);
org.exoplatform.container.ContainerLifecyclePlugin cplugin =
(org.exoplatform.container.ContainerLifecyclePlugin)container
.createComponent(clazz, plugin.getInitParams());
@@ -146,17 +147,16 @@
}
}
- static public void addComponentLifecyclePlugin(ExoContainer container, ConfigurationManager conf)
+ public static void addComponentLifecyclePlugin(ExoContainer container, ConfigurationManager conf)
{
Collection plugins = conf.getConfiguration().getComponentLifecyclePlugins();
Iterator i = plugins.iterator();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
while (i.hasNext())
{
ComponentLifecyclePlugin plugin = (ComponentLifecyclePlugin)i.next();
try
{
- Class classType = loader.loadClass(plugin.getType());
+ Class<?> classType = ClassLoading.loadClass(plugin.getType(), ContainerUtil.class);
org.exoplatform.container.component.ComponentLifecyclePlugin instance =
(org.exoplatform.container.component.ComponentLifecyclePlugin)classType.newInstance();
container.addComponentLifecylePlugin(instance);
@@ -168,13 +168,12 @@
}
}
- static public void addComponents(ExoContainer container, ConfigurationManager conf)
+ public static void addComponents(ExoContainer container, ConfigurationManager conf)
{
Collection components = conf.getComponents();
if (components == null)
return;
Iterator i = components.iterator();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
while (i.hasNext())
{
Component component = (Component)i.next();
@@ -182,7 +181,7 @@
String key = component.getKey();
try
{
- Class classType = loader.loadClass(type);
+ Class<?> classType = ClassLoading.loadClass(type, ContainerUtil.class);
if (key == null)
{
if (component.isMultiInstance())
@@ -199,7 +198,7 @@
{
try
{
- Class keyType = loader.loadClass(key);
+ Class<?> keyType = ClassLoading.loadClass(key, ContainerUtil.class);
if (component.isMultiInstance())
{
container.registerComponent(new ConstructorInjectionComponentAdapter(keyType, classType));
@@ -310,5 +309,5 @@
}
}
return props;
- }
+ }
}
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/container/xml/ObjectParam.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -19,6 +19,7 @@
package org.exoplatform.container.xml;
import org.apache.commons.beanutils.PropertyUtils;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -83,7 +84,7 @@
Property prop = null;
try
{
- Class clazz = Class.forName(type);
+ Class<?> clazz = ClassLoading.forName(type, this);
object_ = clazz.newInstance();
for (int i = 0; i < properties_.size(); i++)
{
@@ -157,7 +158,7 @@
fullName.append(".");
fullName.append(className);
- Class clazz = Class.forName(fullName.toString());
+ Class clazz = ClassLoading.forName(fullName.toString(), this);
return clazz.newInstance();
}
}
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/services/log/LogConfigurationInitializer.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/services/log/LogConfigurationInitializer.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/services/log/LogConfigurationInitializer.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.log;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
import org.exoplatform.container.xml.ValueParam;
@@ -167,7 +168,7 @@
Properties props;
if (configurer != null && properties != null)
{
- LogConfigurator conf = (LogConfigurator)Class.forName(configurer).newInstance();
+ LogConfigurator conf = (LogConfigurator)ClassLoading.forName(configurer, this).newInstance();
props = new Properties();
props.putAll(properties);
conf.configure(props);
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLCollection.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLCollection.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLCollection.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.xml.object;
+import org.exoplatform.commons.utils.ClassLoading;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.IUnmarshallingContext;
@@ -70,7 +71,7 @@
public Collection getCollection() throws Exception
{
- Class clazz = Class.forName(type_);
+ Class<?> clazz = ClassLoading.forName(type_, this);
Collection collection = (Collection)clazz.newInstance();
for (int i = 0; i < list_.size(); i++)
{
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLMap.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLMap.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLMap.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.xml.object;
+import org.exoplatform.commons.utils.ClassLoading;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
@@ -73,7 +75,7 @@
public Map getMap() throws Exception
{
- Class clazz = Class.forName(type_);
+ Class<?> clazz = ClassLoading.forName(type_, this);
Map map = (Map)clazz.newInstance();
for (int i = 0; i < listmap.size(); i++)
{
Modified: kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLObject.java
===================================================================
--- kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLObject.java 2012-01-03 14:51:49 UTC (rev 5416)
+++ kernel/branches/2.4.x/exo.kernel.container/src/main/java/org/exoplatform/xml/object/XMLObject.java 2012-01-04 11:37:05 UTC (rev 5417)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.xml.object;
+import org.exoplatform.commons.utils.ClassLoading;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -172,7 +173,7 @@
public Object toObject() throws Exception
{
- Class clazz = Class.forName(type);
+ Class<?> clazz = ClassLoading.forName(type, this);
Map fields = getFields(clazz);
Object instance = clazz.newInstance();
Iterator i = fields_.values().iterator();
12 years, 4 months
exo-jcr SVN: r5416 - in jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core/nodetype and 1 other directories.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-01-03 09:51:49 -0500 (Tue, 03 Jan 2012)
New Revision: 5416
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/PropertyTypeRegistry.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java
Log:
EXOJCR-932: Fixed incomplete PropertyTypeRegistry
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java 2012-01-03 14:38:49 UTC (rev 5415)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/core/nodetype/NodeTypeDataManager.java 2012-01-03 14:51:49 UTC (rev 5416)
@@ -21,6 +21,7 @@
import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.NodeData;
+import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerListener;
import java.io.InputStream;
import java.util.List;
@@ -230,4 +231,7 @@
PlainChangesLog updateNodeType(NodeTypeData ancestorDefinition, NodeTypeData recipientDefinition,
Map<InternalQName, NodeTypeData> volatileNodeTypes) throws ConstraintViolationException, RepositoryException;
+ void addListener(NodeTypeManagerListener listener);
+
+ void removeListener(NodeTypeManagerListener listener);
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2012-01-03 14:38:49 UTC (rev 5415)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2012-01-03 14:51:49 UTC (rev 5416)
@@ -634,6 +634,15 @@
nodeTypeDataValidator.validateNodeType(nodeTypes);
nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
+
+ for (NodeTypeData nodeType : nodeTypes)
+ {
+ for (NodeTypeManagerListener listener : listeners.values())
+ {
+ listener.nodeTypeRegistered(nodeType.getName());
+ }
+ }
+
return nodeTypes;
}
@@ -651,6 +660,14 @@
nodeTypeRepository.registerNodeType(nodeTypes, this, accessControlPolicy, alreadyExistsBehaviour);
+ for (NodeTypeData nodeType : nodeTypes)
+ {
+ for (NodeTypeManagerListener listener : listeners.values())
+ {
+ listener.nodeTypeRegistered(nodeType.getName());
+ }
+ }
+
return nodeTypes;
}
@@ -750,9 +767,8 @@
new PropertyDefinitionComparator(this, dataManager, itemAutocreator, affectedNodes, locationFactory);
changesLog.addAll(propertyDefinitionComparator.compare(recipientDefinition,
getAllPropertyDefinitions(ancestorAllNodeTypeNames), getAllPropertyDefinitions(recipienAllNodeTypeNames))
+ .getAllStates());
- .getAllStates());
-
return changesLog;
}
@@ -884,6 +900,11 @@
throw new RepositoryException(message.toString());
}
this.nodeTypeRepository.unregisterNodeType(nodeType);
+
+ for (NodeTypeManagerListener listener : listeners.values())
+ {
+ listener.nodeTypeUnregistered(nodeType.getName());
+ }
}
/**
@@ -976,10 +997,8 @@
affectedNodes, this.locationFactory);
changesLog.addAll(propertyDefinitionComparator.compare(recipientDefinition,
getAllPropertyDefinitions(ancestorDefinition.getName()),
- volatileNodeTypeDataManager.getAllPropertyDefinitions(recipientDefinition.getName()))
+ volatileNodeTypeDataManager.getAllPropertyDefinitions(recipientDefinition.getName())).getAllStates());
- .getAllStates());
-
// notify listeners about changes
if (!Arrays.deepEquals(recipientDefinition.getDeclaredSupertypeNames(), ancestorDefinition
.getDeclaredSupertypeNames()))
@@ -1035,6 +1054,11 @@
this.nodeTypeRepository.addNodeType(recipientDefinition, volatileNodeTypes);
+ for (NodeTypeManagerListener listener : listeners.values())
+ {
+ listener.nodeTypeReRegistered(recipientDefinition.getName());
+ }
+
return changesLog;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/PropertyTypeRegistry.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/PropertyTypeRegistry.java 2012-01-03 14:38:49 UTC (rev 5415)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/PropertyTypeRegistry.java 2012-01-03 14:51:49 UTC (rev 5416)
@@ -67,6 +67,8 @@
{
this.registry = reg;
fillCache();
+
+ registry.addListener(this);
}
/**
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java 2012-01-03 14:38:49 UTC (rev 5415)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/QueryHandlerContext.java 2012-01-03 14:51:49 UTC (rev 5416)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager;
import org.exoplatform.services.jcr.dataflow.ItemDataConsumer;
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
-import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManagerImpl;
import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTableResolver;
import org.exoplatform.services.rpc.RPCService;
@@ -144,7 +143,7 @@
this.repositoryName = repositoryName;
this.workspaceName = workspaceName;
this.recoveryFilterUsed = useIndexRecoveryFilters;
- ((NodeTypeDataManagerImpl)this.nodeTypeDataManager).addListener(propRegistry);
+ this.nodeTypeDataManager.addListener(propRegistry);
}
/**
@@ -246,7 +245,7 @@
*/
public void destroy()
{
- ((NodeTypeDataManagerImpl)this.nodeTypeDataManager).removeListener(propRegistry);
+ this.nodeTypeDataManager.removeListener(propRegistry);
}
public DocumentReaderService getExtractor()
12 years, 4 months
exo-jcr SVN: r5415 - jcr/branches/1.15.x/exo.jcr.component.core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-03 09:38:49 -0500 (Tue, 03 Jan 2012)
New Revision: 5415
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
Log:
EXOJCR-1702: Removed old LockManager and old-style LockManager configuration support
Modified: jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-03 14:33:36 UTC (rev 5414)
+++ jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-03 14:38:49 UTC (rev 5415)
@@ -2,4 +2,5 @@
* Removed StorageUpdateManager class
* "update-storage" parameter in Workspace data container configuration is not supported anymore
* Removed LockPersister
-* Removed LockManagerImpl which was the default lock manager
\ No newline at end of file
+* Removed LockManagerImpl
+* If lock manager is not configured we will have RepositoryConfigurationException at startup
\ No newline at end of file
12 years, 4 months
exo-jcr SVN: r5414 - in jcr/branches/1.15.x: applications/product-patches/as/jboss/bin and 26 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-01-03 09:33:36 -0500 (Tue, 03 Jan 2012)
New Revision: 5414
Added:
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jbosscache-lock.xml
jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jbosscache-lock.xml
jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jbosscache-lock.xml
jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jbosscache-lock.xml
Removed:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockPersisterEntry.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockPersister.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/lock/
Modified:
jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf
jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf.bat
jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-configuration.xml
jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-readme.txt
jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-configuration.xml
jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-readme.txt
jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/nt/jonas.bat
jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/unix/jonas
jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-configuration.xml
jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-readme.txt
jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.bat
jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.sh
jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-configuration.xml
jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-readme.txt
jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockManagerEntry.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/binding.xml
jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/configuration.xml
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/lock/TestLockImpl.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/ProxyWorkspaceDataReceiver.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataManagerProxy.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml
jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config.xml
jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jcr-config.xml
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr-with-gtn/how-to-extend-my-gatein-instance.xml
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/backup-client.xml
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jcr-framework-config.xml
Log:
EXOJCR-1702: Removed old LockManager and old-style LockManager configuration support
Modified: jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf 2012-01-03 14:33:36 UTC (rev 5414)
@@ -53,6 +53,6 @@
# Add the eXo variables
JAVA_OPTS="$JAVA_OPTS -Dexo.profiles=$1 -Dexo.jcr.parent.dir=../server/default/data"
-if [ "$1" = "jbc" ] || [ "$1" = "ispn" ]; then
+if [ "$1" = "ispn" ]; then
shift
fi
\ No newline at end of file
Modified: jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf.bat
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf.bat 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jboss/bin/run.conf.bat 2012-01-03 14:33:36 UTC (rev 5414)
@@ -57,7 +57,6 @@
rem # Add the eXo variables
set "JAVA_OPTS=%JAVA_OPTS% -Dexo.profiles=%1 -Dexo.jcr.parent.dir=../server/default/data"
-if ""%1"" == ""jbc"" shift
if ""%1"" == ""ispn"" shift
:JAVA_OPTS_SET
Modified: jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-configuration.xml
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-configuration.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-configuration.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -58,18 +58,13 @@
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-config.xml</value>
+ <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
</value-param>
<value-param profiles="ispn">
<name>conf-path</name>
<description>JCR configuration file</description>
<value>jar:/conf/portal/exo-jcr-ispn-config.xml</value>
</value-param>
- <value-param profiles="jbc">
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
- </value-param>
</init-params>
</component>
Modified: jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-readme.txt
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-readme.txt 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jboss/exo-readme.txt 2012-01-03 14:33:36 UTC (rev 5414)
@@ -4,12 +4,10 @@
In Unix environment
-* "./run.sh" to launch eXo JCR with the default configuration
+* "./run.sh" to launch eXo JCR with the configuration for JBoss Cache
* "./run.sh ispn" to launch eXo JCR with the configuration for Infinispan
-* "./run.sh jbc" to launch eXo JCR with the configuration for JBoss Cache
In Windows environment
-* "run.bat" to launch eXo JCR with the default configuration
+* "run.bat" to launch eXo JCR with the configuration for JBoss Cache
* "run.bat ispn" to launch eXo JCR with the configuration for Infinispan
-* "run.bat jbc" to launch eXo JCR with the configuration for JBoss Cache
Modified: jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-configuration.xml
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-configuration.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-configuration.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -58,18 +58,13 @@
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-config.xml</value>
+ <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
</value-param>
<value-param profiles="ispn">
<name>conf-path</name>
<description>JCR configuration file</description>
<value>jar:/conf/portal/exo-jcr-ispn-config.xml</value>
</value-param>
- <value-param profiles="jbc">
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
- </value-param>
</init-params>
</component>
Modified: jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-readme.txt
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-readme.txt 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jetty/exo-readme.txt 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,15 +1,13 @@
Thank you for your interest in eXo JCR
-To launch it, execute the following command:
+To launch it, go to the bin directory and execute the following command:
In Unix environment
-* "./eXo.sh" to launch eXo JCR with the default configuration
-* "./eXo.sh ispn" to launch eXo JCR with the configuration for Infinispan
-* "./eXo.sh jbc" to launch eXo JCR with the configuration for JBoss Cache
+* "./run.sh" to launch eXo JCR with the configuration for JBoss Cache
+* "./run.sh ispn" to launch eXo JCR with the configuration for Infinispan
In Windows environment
-* "eXo.bat" to launch eXo JCR with the default configuration
-* "eXo.bat ispn" to launch eXo JCR with the configuration for Infinispan
-* "eXo.bat jbc" to launch eXo JCR with the configuration for JBoss Cache
+* "run.bat" to launch eXo JCR with the configuration for JBoss Cache
+* "run.bat ispn" to launch eXo JCR with the configuration for Infinispan
Modified: jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/nt/jonas.bat
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/nt/jonas.bat 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/nt/jonas.bat 2012-01-03 14:33:36 UTC (rev 5414)
@@ -82,7 +82,6 @@
cd %JONAS_ROOT%/bin
set JONAS_OPTS=%JONAS_OPTS% -Dorg.exoplatform.services.log.Log=org.apache.commons.logging.impl.SimpleLog -Djava.awt.headless=true -Dexo.profiles=%1 -Djava.net.preferIPv4Stack=true -Dexo.jcr.parent.dir=../..
set JAVA_OPTS=%JAVA_OPTS% -Xmx512M
-if ""%1"" == ""jbc"" shift
if ""%1"" == ""ispn"" shift
Rem ------------------------ End eXo configuration -----------------------------
Modified: jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/unix/jonas
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/unix/jonas 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jonas/bin/unix/jonas 2012-01-03 14:33:36 UTC (rev 5414)
@@ -81,7 +81,7 @@
cd $JONAS_ROOT/bin
JONAS_OPTS="$JONAS_OPTS -Dorg.exoplatform.services.log.Log=org.apache.commons.logging.impl.SimpleLog -Djava.awt.headless=true -Dexo.profiles=$1 -Djava.net.preferIPv4Stack=true -Dexo.jcr.parent.dir=.."
JAVA_OPTS="$JAVA_OPTS -Xmx512M"
-if [ "$1" = "jbc" ] || [ "$1" = "ispn" ]; then
+if [ "$1" = "ispn" ]; then
shift
fi
Modified: jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-configuration.xml
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-configuration.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-configuration.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -58,18 +58,13 @@
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-config.xml</value>
+ <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
</value-param>
<value-param profiles="ispn">
<name>conf-path</name>
<description>JCR configuration file</description>
<value>jar:/conf/portal/exo-jcr-ispn-config.xml</value>
</value-param>
- <value-param profiles="jbc">
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
- </value-param>
</init-params>
</component>
Modified: jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-readme.txt
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-readme.txt 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/jonas/exo-readme.txt 2012-01-03 14:33:36 UTC (rev 5414)
@@ -2,12 +2,10 @@
In Unix environment, go in the directory bin/unix then execute the following command:
-* "./jonas start" to launch eXo JCR with the default configuration
+* "./jonas start" to launch eXo JCR with the configuration for JBoss Cache
* "./jonas ispn start" to launch eXo JCR with the configuration for Infinispan
-* "./jonas jbc start" to launch eXo JCR with the configuration for JBoss Cache
In Windows environment, go in the directory bin\nt then execute the following command:
-* "jonas.bat start" to launch eXo JCR with the default configuration
+* "jonas.bat start" to launch eXo JCR with the configuration for JBoss Cache
* "jonas.bat ispn start" to launch eXo JCR with the configuration for Infinispan
-* "jonas.bat jbc start" to launch eXo JCR with the configuration for JBoss Cache
Modified: jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.bat
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.bat 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.bat 2012-01-03 14:33:36 UTC (rev 5414)
@@ -10,7 +10,6 @@
set SECURITY_OPTS="-Djava.security.auth.login.config=%TOMCAT_HOME%\conf\jaas.conf"
set EXO_OPTS=-Dexo.product.developing=true -Dexo.profiles=%1 -Djava.net.preferIPv4Stack=true
set JAVA_OPTS=-Xshare:auto -Xms128m -Xmx512m %LOG_OPTS% %SECURITY_OPTS% %EXO_OPTS%
-if ""%1"" == ""jbc"" shift
if ""%1"" == ""ispn"" shift
rem Launches the server
Modified: jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.sh
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.sh 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/tomcat/bin/eXo.sh 2012-01-03 14:33:36 UTC (rev 5414)
@@ -6,7 +6,7 @@
LOG_OPTS="-Dorg.exoplatform.services.log.Log=org.apache.commons.logging.impl.SimpleLog"
SECURITY_OPTS="-Djava.security.auth.login.config=$PRGDIR/../conf/jaas.conf"
EXO_OPTS="-Dexo.product.developing=true -Dexo.profiles=$1 -Djava.net.preferIPv4Stack=true"
-if [ "$1" = "jbc" ] || [ "$1" = "ispn" ]; then
+if [ "$1" = "ispn" ]; then
shift
fi
Modified: jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-configuration.xml
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-configuration.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-configuration.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -58,18 +58,13 @@
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-config.xml</value>
+ <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
</value-param>
<value-param profiles="ispn">
<name>conf-path</name>
<description>JCR configuration file</description>
<value>jar:/conf/portal/exo-jcr-ispn-config.xml</value>
</value-param>
- <value-param profiles="jbc">
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-jbc-config.xml</value>
- </value-param>
</init-params>
</component>
Modified: jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-readme.txt
===================================================================
--- jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-readme.txt 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/applications/product-patches/as/tomcat/exo-readme.txt 2012-01-03 14:33:36 UTC (rev 5414)
@@ -4,12 +4,10 @@
In Unix environment
-* "./eXo.sh run" to launch eXo JCR with the default configuration
-* "./eXo.sh ispn run" to launch eXo JCR with the configuration for Infinispan
-* "./eXo.sh jbc run" to launch eXo JCR with the configuration for JBoss Cache
+* "./run.sh" to launch eXo JCR with the configuration for JBoss Cache
+* "./run.sh ispn" to launch eXo JCR with the configuration for Infinispan
In Windows environment
-* "eXo.bat run" to launch eXo JCR with the default configuration
-* "eXo.bat ispn run" to launch eXo JCR with the configuration for Infinispan
-* "eXo.bat jbc run" to launch eXo JCR with the configuration for JBoss Cache
+* "run.bat" to launch eXo JCR with the configuration for JBoss Cache
+* "run.bat ispn" to launch eXo JCR with the configuration for Infinispan
Modified: jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/developer-notes.txt 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,4 +1,5 @@
* Removed JCR_SCONTAINER table
* Removed StorageUpdateManager class
* "update-storage" parameter in Workspace data container configuration is not supported anymore
-* Removed support of FileSystemLockPersister
\ No newline at end of file
+* Removed LockPersister
+* Removed LockManagerImpl which was the default lock manager
\ No newline at end of file
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockManagerEntry.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockManagerEntry.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockManagerEntry.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -24,29 +24,4 @@
*/
public class LockManagerEntry extends MappedParametrizedObjectEntry
{
-
- private long timeout = -1;
-
- private LockPersisterEntry persister;
-
- public long getTimeout()
- {
- return timeout;
- }
-
- public void setTimeout(long timeout)
- {
- this.timeout = timeout;
- }
-
- public LockPersisterEntry getPersister()
- {
- return persister;
- }
-
- public void setPersister(LockPersisterEntry persister)
- {
- this.persister = persister;
- }
-
}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockPersisterEntry.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockPersisterEntry.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/LockPersisterEntry.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.config;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey Kabashnyuk</a>
- * @version $Id: LockPersisterEntry.java 13891 2008-05-05 16:02:30Z pnedonosko $
- */
-public class LockPersisterEntry extends MappedParametrizedObjectEntry
-{
-
-}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -44,7 +44,6 @@
import org.exoplatform.services.jcr.impl.core.SessionRegistry;
import org.exoplatform.services.jcr.impl.core.WorkspaceInitializer;
import org.exoplatform.services.jcr.impl.core.access.DefaultAccessManagerImpl;
-import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;
import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder;
import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManagerImpl;
import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl;
@@ -302,6 +301,7 @@
throw new RepositoryConfigurationException("Class not found for workspace data container "
+ wsConfig.getUniqueName() + " : " + e);
}
+
// cache type
try
{
@@ -324,22 +324,6 @@
workspaceContainer.registerComponentImplementation(LocalWorkspaceDataManagerStub.class);
workspaceContainer.registerComponentImplementation(ObservationManagerRegistry.class);
- // Lock manager and Lock persister is a optional parameters
- if (wsConfig.getLockManager() != null && wsConfig.getLockManager().getPersister() != null)
- {
- try
- {
- final Class<?> lockPersister = Class.forName(wsConfig.getLockManager().getPersister().getType());
- workspaceContainer.registerComponentImplementation(lockPersister);
- }
- catch (ClassNotFoundException e)
- {
- throw new RepositoryConfigurationException("Class not found for workspace lock persister "
- + wsConfig.getLockManager().getPersister().getType() + ", container " + wsConfig.getUniqueName()
- + " : " + e);
- }
- }
-
if (wsConfig.getLockManager() != null && wsConfig.getLockManager().getType() != null)
{
try
@@ -355,8 +339,10 @@
}
else
{
- workspaceContainer.registerComponentImplementation(LockManagerImpl.class);
+ throw new RepositoryConfigurationException(
+ "The configuration of lock manager is expected in container " + wsConfig.getUniqueName());
}
+
// Query handler
if (wsConfig.getQueryHandler() != null)
{
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,319 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.core.lock;
-
-import org.exoplatform.commons.utils.PrivilegedFileHelper;
-import org.exoplatform.commons.utils.SecurityHelper;
-import org.exoplatform.services.jcr.config.LockPersisterEntry;
-import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
-import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
-import org.exoplatform.services.jcr.datamodel.ItemType;
-import org.exoplatform.services.jcr.datamodel.NodeData;
-import org.exoplatform.services.jcr.datamodel.PropertyData;
-import org.exoplatform.services.jcr.datamodel.QPath;
-import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.jcr.impl.core.query.SearchManager;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
-import org.exoplatform.services.jcr.observation.ExtendedEvent;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.security.IdentityConstants;
-
-import java.io.File;
-import java.io.IOException;
-import java.security.PrivilegedExceptionAction;
-import java.util.ArrayList;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.lock.LockException;
-
-/**
- * Store information about locks on file system. After start and before stop it remove all lock
- * properties in repository
- *
- * @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey Kabashnyuk</a>
- * @version $Id: FileSystemLockPersister.java 11907 2008-03-13 15:36:21Z ksm $
- */
-public class FileSystemLockPersister implements LockPersister
-{
- /**
- * Name of the parameter.
- */
- private static final String PARAM_ROOT_DIR = "path";
-
- /**
- * logger.
- */
- private final Log log = ExoLogger.getLogger("exo.jcr.component.core.FileSystemLockPersister");
-
- /**
- * The directory which stores information of the locks.
- */
- private File rootDir;
-
- /**
- * Data manager.
- */
- private final WorkspacePersistentDataManager dataManager;
-
- /**
- * Lock persister configuration.
- */
- private final LockPersisterEntry config;
-
- /**
- * @param dataManager
- * @param config
- * @throws RepositoryConfigurationException
- * @throws RepositoryException
- */
- public FileSystemLockPersister(WorkspacePersistentDataManager dataManager, WorkspaceEntry config)
- throws RepositoryConfigurationException, RepositoryException
- {
- this.dataManager = dataManager;
- this.config = config.getLockManager().getPersister();
- init();
- }
-
- /**
- * @param dataManager
- * @param config
- * @param searchManager
- * @throws RepositoryConfigurationException
- * @throws RepositoryException
- */
- public FileSystemLockPersister(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- SearchManager searchManager) throws RepositoryConfigurationException, RepositoryException
- {
- this.dataManager = dataManager;
- this.config = config.getLockManager().getPersister();
- init();
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.exoplatform.services.jcr.impl.core.lock.LockPersister#add(org.exoplatform.services.jcr.
- * impl.core.lock.LockData)
- */
- public void add(LockData lock) throws LockException
- {
- log.debug("add event fire");
- final File lockFile = new File(rootDir, lock.getNodeIdentifier());
-
- if (PrivilegedFileHelper.exists(lockFile))
- {
- throw new LockException("Persistent lock information already exists");
- }
-
- try
- {
- SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
- {
- public Void run() throws Exception
- {
- lockFile.createNewFile();
- return null;
- }
- });
- }
- catch (IOException e)
- {
- throw new LockException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see
- * org.exoplatform.services.jcr.impl.core.lock.LockPersister#remove(org.exoplatform.services.jcr
- * .impl.core.lock.LockData)
- */
- public void remove(LockData lock) throws LockException
- {
- log.debug("remove event fire");
- File lockFile = new File(rootDir, lock.getNodeIdentifier());
- if (!PrivilegedFileHelper.exists(lockFile))
- {
- // throw new LockException("Persistent lock information not exists");
- log.warn("Persistent lock information for node " + lock.getNodeIdentifier() + " doesn't exists");
- return;
- }
- if (!PrivilegedFileHelper.delete(lockFile))
- {
- throw new LockException("Fail to remove lock information");
- }
-
- }
-
- /*
- * (non-Javadoc)
- * @see org.exoplatform.services.jcr.impl.core.lock.LockPersister#removeAll()
- */
- public void removeAll() throws LockException
- {
- if (log.isDebugEnabled())
- {
- log.debug("Removing all locks");
- }
-
- TransactionChangesLog transactionChangesLog = new TransactionChangesLog();
-
- String[] list = PrivilegedFileHelper.list(rootDir);
-
- try
- {
- for (int i = 0; i < list.length; i++)
- {
- PlainChangesLog plainChangesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), IdentityConstants.SYSTEM, ExtendedEvent.UNLOCK);
-
- NodeData lockedNodeData = (NodeData)dataManager.getItemData(list[i]);
- // No item no problem
- if (lockedNodeData != null)
- {
- PropertyData dataLockIsDeep =
- (PropertyData)dataManager.getItemData(lockedNodeData, new QPathEntry(Constants.JCR_LOCKISDEEP, 0),
- ItemType.PROPERTY);
-
- if (dataLockIsDeep != null)
- {
- plainChangesLog.add(ItemState.createDeletedState(new TransientPropertyData(QPath.makeChildPath(
- lockedNodeData.getQPath(), Constants.JCR_LOCKISDEEP), dataLockIsDeep.getIdentifier(), 0,
- dataLockIsDeep.getType(), dataLockIsDeep.getParentIdentifier(), dataLockIsDeep.isMultiValued())));
- }
-
- PropertyData dataLockOwner =
- (PropertyData)dataManager.getItemData(lockedNodeData, new QPathEntry(Constants.JCR_LOCKOWNER, 0),
- ItemType.PROPERTY);
- if (dataLockOwner != null)
- {
- plainChangesLog.add(ItemState.createDeletedState(new TransientPropertyData(QPath.makeChildPath(
- lockedNodeData.getQPath(), Constants.JCR_LOCKOWNER), dataLockOwner.getIdentifier(), 0,
- dataLockOwner.getType(), dataLockOwner.getParentIdentifier(), dataLockOwner.isMultiValued())));
- }
-
- if (plainChangesLog.getSize() > 0)
- {
- transactionChangesLog.addLog(plainChangesLog);
- }
- }
- }
-
- if (transactionChangesLog.getSize() > 0)
- {
- dataManager.save(transactionChangesLog);
- }
-
- // remove files
- for (int i = 0; i < list.length; i++)
- {
- File lockFile = new File(rootDir, list[i]);
- if (!PrivilegedFileHelper.exists(lockFile))
- {
- log.warn("Persistent lock information for node id " + list[i] + " doesn't exists");
- }
- if (!PrivilegedFileHelper.delete(lockFile))
- {
- throw new LockException("Fail to remove lock information");
- }
- }
- }
- catch (RepositoryException e)
- {
- log.error("Unable to remove lock files due to error " + e, e);
- throw new LockException(e);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#start()
- */
- public void start()
- {
- if (log.isDebugEnabled())
- {
- log.debug("Starting FileSystemLockPersister");
- }
- try
- {
- removeAll();
- }
- catch (LockException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
-
- }
-
- /*
- * (non-Javadoc)
- * @see org.picocontainer.Startable#stop()
- */
- public void stop()
- {
- if (log.isDebugEnabled())
- {
- log.debug("Stoping FileSystemLockPersister");
- }
- if (log.isDebugEnabled())
- {
- log.debug("FileSystemLockPersister stoped");
- }
- }
-
- /**
- * Initialize directory tree for storing lock information.
- *
- * @throws RepositoryConfigurationException
- * @throws RepositoryException
- */
- private void init() throws RepositoryConfigurationException, RepositoryException
- {
- String root = config.getParameterValue(PARAM_ROOT_DIR);
-
- if (root == null)
- {
- throw new RepositoryConfigurationException("Repository service configuration." + " Source name ("
- + PARAM_ROOT_DIR + ") is expected");
- }
- rootDir = new File(root);
- if (PrivilegedFileHelper.exists(rootDir))
- {
- if (!PrivilegedFileHelper.isDirectory(rootDir))
- {
- throw new RepositoryConfigurationException("'" + root + "' is not a directory");
- }
- }
- else
- {
- if (!PrivilegedFileHelper.mkdirs(rootDir))
- {
- throw new RepositoryException("Can't create dir" + root);
- }
- }
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,757 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.core.lock;
-
-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.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.core.ExtendedSession;
-import org.exoplatform.services.jcr.dataflow.ChangesLogIterator;
-import org.exoplatform.services.jcr.dataflow.CompositeChangesLog;
-import org.exoplatform.services.jcr.dataflow.DataManager;
-import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
-import org.exoplatform.services.jcr.dataflow.PlainChangesLog;
-import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl;
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
-import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
-import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
-import org.exoplatform.services.jcr.datamodel.InternalQName;
-import org.exoplatform.services.jcr.datamodel.ItemData;
-import org.exoplatform.services.jcr.datamodel.ItemType;
-import org.exoplatform.services.jcr.datamodel.NodeData;
-import org.exoplatform.services.jcr.datamodel.PropertyData;
-import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.jcr.impl.core.NodeImpl;
-import org.exoplatform.services.jcr.impl.core.SessionDataManager;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.dataflow.TransientItemData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
-import org.exoplatform.services.jcr.observation.ExtendedEvent;
-import org.exoplatform.services.jcr.util.IdGenerator;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.security.IdentityConstants;
-import org.picocontainer.Startable;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.AccessDeniedException;
-import javax.jcr.RepositoryException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.lock.Lock;
-import javax.jcr.lock.LockException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * @author <a href="mailto:gennady.azarenkov@exoplatform.com">Gennady Azarenkov</a>
- * @version $Id: LockManagerImpl.java 12096 2008-03-19 11:42:40Z gazarenkov $
- */
-@Managed
-@NameTemplate(@Property(key = "service", value = "lockmanager"))
-public class LockManagerImpl implements WorkspaceLockManager, ItemsPersistenceListener, Startable
-{
- /**
- * Default lock time out. 30min
- */
- public static final long DEFAULT_LOCK_TIMEOUT = 1000 * 60 * 30;
-
- // Search constants
- /**
- * The exact lock token.
- */
- private static final int SEARCH_EXECMATCH = 1;
-
- /**
- * Lock token of closed parent
- */
- private static final int SEARCH_CLOSEDPARENT = 2;
-
- /**
- * Lock token of closed child
- */
- private static final int SEARCH_CLOSEDCHILD = 4;
-
- /**
- * Logger
- */
- private final Log log = ExoLogger.getLogger("exo.jcr.component.core.LockManagerImpl");
-
- /**
- * Map NodeIdentifier -- lockData
- */
- private final Map<String, LockData> locks;
-
- /**
- * Data manager.
- */
- private final DataManager dataManager;
-
- /**
- * Map NodeIdentifier -- lockData
- */
- private final Map<String, LockData> pendingLocks;
-
- /**
- * Map lockToken --lockData
- */
- private final Map<String, LockData> tokensMap;
-
- /**
- * Run time lock time out.
- */
- private long lockTimeOut;
-
- /**
- * Lock remover thread.
- */
- private LockRemover lockRemover;
-
- /**
- * Lock persister instance.
- */
- private final LockPersister persister;
-
- /**
- * Constructor for workspace without LockPersister
- *
- * @param dataManager
- * @param config
- */
- public LockManagerImpl(WorkspacePersistentDataManager dataManager, WorkspaceEntry config,
- LockRemoverHolder lockRemoverHolder)
- {
- this(dataManager, config, null, lockRemoverHolder);
- }
-
- public LockManagerImpl(WorkspacePersistentDataManager dataManager, WorkspaceEntry config, LockPersister persister,
- LockRemoverHolder lockRemoverHolder)
- {
-
- this.dataManager = dataManager;
- this.persister = persister;
- if (config.getLockManager() != null)
- {
- lockTimeOut =
- config.getLockManager().getTimeout() > 0 ? config.getLockManager().getTimeout() : DEFAULT_LOCK_TIMEOUT;
- }
- else
- lockTimeOut = DEFAULT_LOCK_TIMEOUT;
-
- locks = new HashMap<String, LockData>();
- pendingLocks = new HashMap<String, LockData>();
- tokensMap = new HashMap<String, LockData>();
-
- dataManager.addItemPersistenceListener(this);
- lockRemover = lockRemoverHolder.getLockRemover(this);
- }
-
- public synchronized void addLockToken(String sessionId, String lt)
- {
- LockData currLock = tokensMap.get(lt);
- if (currLock != null)
- {
- currLock.addLockHolder(sessionId);
- }
- }
-
- public synchronized Lock addPendingLock(NodeImpl node, boolean isDeep, boolean isSessionScoped, long timeOut)
- throws LockException
- {
- LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
- if (lData != null)
- {
- if (lData.getNodeIdentifier().equals(node.getInternalIdentifier()))
- {
- throw new LockException("Node already locked: " + node.getData().getQPath());
- }
- else if (lData.isDeep())
- {
- throw new LockException("Parent node has deep lock.");
- }
- }
-
- if (isDeep && getLockData((NodeData)node.getData(), SEARCH_CLOSEDCHILD) != null)
- {
- throw new LockException("Some child node is locked.");
- }
-
- String lockToken = IdGenerator.generate();
- lData =
- new LockData(node.getInternalIdentifier(), lockToken, isDeep, isSessionScoped, node.getSession().getUserID(),
- timeOut > 0 ? timeOut : lockTimeOut);
-
- lData.addLockHolder(node.getSession().getId());
- pendingLocks.put(node.getInternalIdentifier(), lData);
- tokensMap.put(lockToken, lData);
-
- LockImpl lock = new LockImpl(node.getSession(), lData);
- return lock;
- }
-
- public LockImpl getLock(NodeImpl node) throws LockException, RepositoryException
- {
-
- LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
-
- if (lData == null || (!node.getInternalIdentifier().equals(lData.getNodeIdentifier()) && !lData.isDeep()))
- {
- throw new LockException("Node not locked: " + node.getData().getQPath());
-
- }
- return new LockImpl(node.getSession(), lData);
- }
-
- public synchronized String[] getLockTokens(String sessionID)
- {
- List<String> retval = new ArrayList<String>();
-
- for (LockData lockData : locks.values())
- {
- if (lockData.isLockHolder(sessionID))
- retval.add(lockData.getLockToken(sessionID));
-
- }
- return retval.toArray(new String[retval.size()]);
- }
-
- public boolean holdsLock(NodeData node) throws RepositoryException
- {
- return getLockData(node, SEARCH_EXECMATCH) != null;
- }
-
- public boolean isLocked(NodeData node)
- {
- LockData lData = getLockData(node, SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
-
- if (lData == null || (!node.getIdentifier().equals(lData.getNodeIdentifier()) && !lData.isDeep()))
- {
- return false;
- }
- return true;
- }
-
- public boolean isLockHolder(NodeData node, String sessionId)// throws RepositoryException
- {
- LockData lData = getLockData(node, SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
- return lData != null && lData.isLockHolder(sessionId);
- }
-
- public synchronized void onCloseSession(ExtendedSession session)
- {
- // List<String> deadLocksList = new ArrayList<String>();
- SessionImpl sessionImpl = (SessionImpl)session;
- for (Iterator<Map.Entry<String, LockData>> entries = locks.entrySet().iterator(); entries.hasNext();)
- {
- Map.Entry<String, LockData> entry = entries.next();
- LockData lockData = entry.getValue();
- if (lockData.isLive())
- {
- if (lockData.isLockHolder(session.getId()))
- {
- if (lockData.isSessionScoped())
- {
- // if no session currently holds lock except this
- try
- {
- ((NodeImpl)sessionImpl.getTransientNodesManager().getItemByIdentifier(
- lockData.getNodeIdentifier(), false)).unlock();
- }
- catch (UnsupportedRepositoryOperationException e)
- {
- log.error(e.getLocalizedMessage());
- }
- catch (LockException e)
- {
- log.error(e.getLocalizedMessage());
- }
- catch (AccessDeniedException e)
- {
- log.error(e.getLocalizedMessage());
- }
- catch (RepositoryException e)
- {
- log.error(e.getLocalizedMessage());
- }
-
- }
- else
- {
- lockData.removeLockHolder(session.getId());
- }
- }
- }
- else
- {
- entries.remove();
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void onSaveItems(ItemStateChangesLog changesLog)
- {
- List<PlainChangesLog> chengesLogList = new ArrayList<PlainChangesLog>();
- if (changesLog instanceof TransactionChangesLog)
- {
- ChangesLogIterator logIterator = ((TransactionChangesLog)changesLog).getLogIterator();
-
- while (logIterator.hasNextLog())
- {
- chengesLogList.add(logIterator.nextLog());
- }
- }
- else if (changesLog instanceof PlainChangesLog)
- {
- chengesLogList.add((PlainChangesLog)changesLog);
- }
- else if (changesLog instanceof CompositeChangesLog)
- {
- for (ChangesLogIterator iter = ((CompositeChangesLog)changesLog).getLogIterator(); iter.hasNextLog();)
- {
- chengesLogList.add(iter.nextLog());
- }
- }
-
- for (PlainChangesLog currChangesLog : chengesLogList)
- {
- String nodeIdentifier;
- try
- {
- switch (currChangesLog.getEventType())
- {
- case ExtendedEvent.LOCK :
- if (currChangesLog.getSize() < 2)
- {
- log.error("Incorrect changes log of type ExtendedEvent.LOCK size=" + currChangesLog.getSize()
- + "<2 \n" + currChangesLog.dump());
- break;
- }
- nodeIdentifier = currChangesLog.getAllStates().get(0).getData().getParentIdentifier();
-
- if (pendingLocks.containsKey(nodeIdentifier))
- {
- internalLock(nodeIdentifier);
- }
- else
- {
- log.warn("No lock in pendingLocks for identifier " + nodeIdentifier
- + " Probably lock come from replication.");
-
- String lockToken = IdGenerator.generate();
- ItemState ownerState = getItemState(currChangesLog, Constants.JCR_LOCKOWNER);
- ItemState isDeepState = getItemState(currChangesLog, Constants.JCR_LOCKISDEEP);
- if (ownerState != null && isDeepState != null)
- {
-
- String owner =
- new String(((((PersistedPropertyData)(ownerState.getData())).getValues()).get(0))
- .getAsByteArray(), Constants.DEFAULT_ENCODING);
-
- boolean isDeep =
- Boolean.valueOf(
- new String(((((PersistedPropertyData)(isDeepState.getData())).getValues()).get(0))
- .getAsByteArray(), Constants.DEFAULT_ENCODING)).booleanValue();
-
- createRemoteLock(currChangesLog.getSessionId(), nodeIdentifier, lockToken, isDeep, false, owner);
- }
- }
- break;
- case ExtendedEvent.UNLOCK :
- if (currChangesLog.getSize() < 2)
- {
- log.error("Incorrect changes log of type ExtendedEvent.UNLOCK size=" + currChangesLog.getSize()
- + "<2 \n" + currChangesLog.dump());
- break;
- }
-
- internalUnLock(currChangesLog.getSessionId(), currChangesLog.getAllStates().get(0).getData()
- .getParentIdentifier());
- break;
- default :
- HashSet<String> removedLock = new HashSet<String>();
- for (ItemState itemState : currChangesLog.getAllStates())
- {
- // this is a node and node is locked
- if (itemState.getData().isNode() && locks.containsKey(itemState.getData().getIdentifier()))
- {
- nodeIdentifier = itemState.getData().getIdentifier();
- if (itemState.isDeleted())
- {
- removedLock.add(nodeIdentifier);
- }
- else if (itemState.isAdded() || itemState.isRenamed() || itemState.isUpdated())
- {
- removedLock.remove(nodeIdentifier);
- }
- }
- }
- for (String identifier : removedLock)
- {
- internalUnLock(currChangesLog.getSessionId(), identifier);
- }
- break;
- }
- }
- catch (LockException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
- catch (UnsupportedEncodingException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
- catch (IllegalStateException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
- catch (IOException e)
- {
- log.error(e.getLocalizedMessage(), e);
- }
- }
- }
-
- /**
- * @param sessionId
- * @param lt
- */
- public synchronized void removeLockToken(String sessionId, String lt)
- {
- LockData lData = tokensMap.get(lt);
- if (lData != null && lData.isLockHolder(sessionId))
- {
- lData.removeLockHolder(sessionId);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void start()
- {
- lockRemover.start();
- }
-
- // Quick method. We need to reconstruct
- synchronized List<LockData> getLockList()
- {
- return new ArrayList<LockData>(locks.values());
- }
-
- /**
- * {@inheritDoc}
- */
- public synchronized void removeExpired()
- {
- final List<String> removeLockList = new ArrayList<String>();
-
- for (LockData lock : locks.values())
- {
- if (!lock.isSessionScoped() && lock.getTimeToDeath() < 0)
- {
- removeLockList.add(lock.getNodeIdentifier());
- }
- }
-
- for (String rLock : removeLockList)
- {
- removeLock(rLock);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void stop()
- {
- lockRemover.stop();
-
- locks.clear();
- pendingLocks.clear();
- tokensMap.clear();
- }
-
- /**
- * Copy <code>PropertyData prop<code> to new TransientItemData
- *
- * @param prop
- * @return
- * @throws RepositoryException
- */
- private TransientItemData copyItemData(PropertyData prop) throws RepositoryException
- {
-
- if (prop == null)
- return null;
-
- // make a copy, value may be null for deleting items
- TransientPropertyData newData =
- new TransientPropertyData(prop.getQPath(), prop.getIdentifier(), prop.getPersistedVersion(), prop.getType(),
- prop.getParentIdentifier(), prop.isMultiValued(), prop.getValues());
-
- return newData;
- }
-
- /**
- * Search item with name <code>itemName<code> in changesLog
- *
- * @param changesLog
- * @param itemName
- * @return Item
- */
- private ItemState getItemState(PlainChangesLog changesLog, InternalQName itemName)
- {
- List<ItemState> allStates = changesLog.getAllStates();
- for (int i = allStates.size() - 1; i >= 0; i--)
- {
- ItemState state = allStates.get(i);
- if (state.getData().getQPath().getName().equals(itemName))
- return state;
- }
- return null;
- }
-
- /**
- * Search lock in maps.
- *
- * @param data
- * @param searchType
- * @return
- */
- private LockData getLockData(NodeData data, int searchType)
- {
- if (data == null || locks.size() == 0)
- return null;
- LockData retval = null;
- try
- {
- if ((searchType & SEARCH_EXECMATCH) != 0)
- {
- retval = locks.get(data.getIdentifier());
- }
- if (retval == null && (searchType & SEARCH_CLOSEDPARENT) != 0)
- {
-
- NodeData parentData = (NodeData)dataManager.getItemData(data.getParentIdentifier());
- if (parentData != null)
- {
- retval = locks.get(parentData.getIdentifier());
- // parent not found try to fo upper
- if (retval == null)
- {
- retval = getLockData(parentData, SEARCH_CLOSEDPARENT);
- }
- }
- }
- if (retval == null && (searchType & SEARCH_CLOSEDCHILD) != 0)
- {
-
- List<NodeData> childData = dataManager.getChildNodesData(data);
- for (NodeData nodeData : childData)
- {
- retval = locks.get(nodeData.getIdentifier());
- if (retval != null)
- break;
- }
- if (retval == null)
- {
- // child not found try to find diper
- for (NodeData nodeData : childData)
- {
- retval = getLockData(nodeData, SEARCH_CLOSEDCHILD);
- if (retval != null)
- break;
- }
- }
- }
- }
- catch (RepositoryException e)
- {
- return null;
- }
-
- return retval;
- }
-
- /**
- * Internal lock
- *
- * @param nodeIdentifier
- * @throws LockException
- */
- private synchronized void internalLock(String nodeIdentifier) throws LockException
- {
- LockData ldata = pendingLocks.get(nodeIdentifier);
- if (ldata != null)
- {
- locks.put(nodeIdentifier, ldata);
-
- if (persister != null)
- {
- persister.add(ldata);
- }
- pendingLocks.remove(nodeIdentifier);
- }
- else
- {
- throw new LockException("No lock in pending locks");
- }
- }
-
- /**
- * Internal unlock.
- *
- * @param sessionId
- * @param nodeIdentifier
- * @throws LockException
- */
- private synchronized void internalUnLock(String sessionId, String nodeIdentifier) throws LockException
- {
- LockData lData = locks.get(nodeIdentifier);
-
- if (lData != null)
- {
- tokensMap.remove(lData.getLockToken(sessionId));
- locks.remove(nodeIdentifier);
-
- lData.setLive(false);
- if (persister != null)
- {
- persister.remove(lData);
- }
- lData = null;
- }
- }
-
- /**
- * For locks comes from remote JCRs (replication usecase)
- *
- * @param sessionId
- * String
- * @param nodeIdentifier
- * String
- * @param lockToken
- * String
- * @param isDeep
- * boolean
- * @param sessionScoped
- * boolean
- * @param owner
- * String
- * @return LockData
- */
- private synchronized LockData createRemoteLock(String sessionId, String nodeIdentifier, String lockToken,
- boolean isDeep, boolean sessionScoped, String owner)
- {
- LockData lData = new LockData(nodeIdentifier, lockToken, isDeep, sessionScoped, owner, lockTimeOut);
- lData.addLockHolder(sessionId);
- locks.put(nodeIdentifier, lData);
- tokensMap.put(lockToken, lData);
-
- return lData;
- }
-
- /**
- * Remove lock, used by Lock remover.
- *
- * @param nodeIdentifier String
- */
- protected void removeLock(String nodeIdentifier)
- {
- try
- {
- NodeData nData = (NodeData)dataManager.getItemData(nodeIdentifier);
- PlainChangesLog changesLog =
- new PlainChangesLogImpl(new ArrayList<ItemState>(), IdentityConstants.SYSTEM, ExtendedEvent.UNLOCK);
-
- ItemData lockOwner =
- copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKOWNER, 1),
- ItemType.PROPERTY));
-
- changesLog.add(ItemState.createDeletedState(lockOwner));
-
- ItemData lockIsDeep =
- copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKISDEEP, 1),
- ItemType.PROPERTY));
- changesLog.add(ItemState.createDeletedState(lockIsDeep));
-
- // lock probably removed by other thread
- if (lockOwner == null && lockIsDeep == null)
- return;
- dataManager.save(new TransactionChangesLog(changesLog));
- }
- catch (RepositoryException e)
- {
- log.error("Error occur during removing lock" + e.getLocalizedMessage());
- }
- }
-
- @Managed
- @ManagedDescription("The number of active locks")
- public int getNumLocks()
- {
- return locks.size();
- }
-
- @Managed
- @ManagedDescription("Remove the expired locks")
- public void cleanExpiredLocks()
- {
- removeExpired();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isTXAware()
- {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public SessionLockManager getSessionLockManager(String sessionId, SessionDataManager transientManager)
- {
- return new SessionLockManagerImpl(sessionId, this, transientManager);
- }
-
- /**
- * {@inheritDoc}
- */
- public void closeSessionLockManager(String sessionId)
- {
- //do nothing
- }
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockPersister.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockPersister.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockPersister.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.core.lock;
-
-import org.picocontainer.Startable;
-
-import javax.jcr.lock.LockException;
-
-/**
- * Class for storing information about locks And will be notified about add and removing a lock
- *
- * @author <a href="mailto:Sergey.Kabashnyuk@gmail.com">Sergey Kabashnyuk</a>
- * @version $Id: LockPersister.java 11907 2008-03-13 15:36:21Z ksm $
- */
-public interface LockPersister extends Startable
-{
- /**
- * Add lock information to the persistent storage
- *
- * @param lock
- * @throws LockException
- */
- void add(LockData lock) throws LockException;
-
- /**
- * Remove lock from persistent storage
- *
- * @param lock
- * @throws LockException
- */
- void remove(LockData lock) throws LockException;
-
- /**
- * Remove all locks from persistent storage
- *
- * @throws LockException
- */
- void removeAll() throws LockException;
-
-}
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,133 +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;
-
-import org.exoplatform.services.jcr.core.ExtendedSession;
-import org.exoplatform.services.jcr.datamodel.NodeData;
-import org.exoplatform.services.jcr.impl.core.NodeImpl;
-import org.exoplatform.services.jcr.impl.core.SessionDataManager;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.lock.Lock;
-import javax.jcr.lock.LockException;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * <br/>Date:
- *
- * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
- * @version $Id$
- */
-public class SessionLockManagerImpl extends AbstractSessionLockManager
-{
-
- private final String sessionId;
-
- private final LockManagerImpl lockManager;
-
- /**
- * Constructor
- */
- public SessionLockManagerImpl(String sessionId, LockManagerImpl lockManager, SessionDataManager transientManager)
- {
- super(transientManager);
- this.sessionId = sessionId;
- this.lockManager = lockManager;
- }
-
- /**
- * {@inheritDoc}
- */
- public Lock addLock(NodeImpl node, boolean isDeep, boolean isSessionScoped, long timeOut) throws LockException,
- RepositoryException
- {
- return lockManager.addPendingLock(node, isDeep, isSessionScoped, timeOut);
- }
-
- /**
- * {@inheritDoc}
- */
- public void addLockToken(String lt)
- {
- lockManager.addLockToken(sessionId, lt);
- }
-
- /**
- * {@inheritDoc}
- */
- public LockImpl getLock(NodeImpl node) throws LockException, RepositoryException
- {
- return lockManager.getLock(node);
- }
-
- /**
- * {@inheritDoc}
- */
- public String[] getLockTokens()
- {
- return lockManager.getLockTokens(sessionId);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean holdsLock(NodeData node) throws RepositoryException
- {
- return lockManager.holdsLock(node);
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean isPersistedLockHolder(NodeData node)// throws RepositoryException
- {
- return lockManager.isLockHolder(node, sessionId);
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean isLockedPersisted(NodeData node) throws LockException
- {
- return lockManager.isLocked(node);
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeLockToken(String lt)
- {
- lockManager.removeLockToken(sessionId, lt);
- }
-
- /**
- * {@inheritDoc}
- */
- public void onCloseSession(ExtendedSession session)
- {
- lockManager.onCloseSession(session);
- }
-
- /**
- * {@inheritDoc}
- */
- protected boolean checkPersistedLocks(NodeData node) throws LockException
- {
- return (!isLockedPersisted(node) || isPersistedLockHolder(node));
- }
-}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -171,11 +171,6 @@
long timeOut = config.getLockManager().getParameterTime(TIME_OUT);
lockTimeOut = timeOut > 0 ? timeOut : DEFAULT_LOCK_TIMEOUT;
}
- else
- {
- lockTimeOut =
- config.getLockManager().getTimeout() > 0 ? config.getLockManager().getTimeout() : DEFAULT_LOCK_TIMEOUT;
- }
}
else
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/binding.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/binding.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/binding.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -78,16 +78,6 @@
<collection name="properties" field="parameters" usage="optional"
item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
factory="org.jibx.runtime.Utility.arrayListFactory" />
- <value name="time-out" field="timeout" usage="optional"
- serializer="org.exoplatform.services.jcr.util.ConfigurationFormat.serializeTime"
- deserializer="org.exoplatform.services.jcr.util.ConfigurationFormat.parseTime" />
-
- <structure name="persister" field="persister" usage="optional">
- <value name="class" field="type" style="attribute" />
- <collection name="properties" field="parameters" usage="optional"
- item-type="org.exoplatform.services.jcr.config.SimpleParameterEntry"
- factory="org.jibx.runtime.Utility.arrayListFactory" />
- </structure>
</structure>
</mapping>
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/configuration.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/configuration.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/configuration.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -22,24 +22,6 @@
<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>
- <key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
- <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
- <init-params>
- <value-param>
- <name>conf-path</name>
- <description>JCR configuration file</description>
- <value>jar:/conf/portal/exo-jcr-config.xml</value>
- </value-param>
- </init-params>
- </component
- -->
-
- <!-- component>
- <key>org.exoplatform.services.jcr.RepositoryService</key>
- <type>org.exoplatform.services.jcr.impl.RepositoryServiceImpl</type>
- </component
- -->
<component>
<type>org.exoplatform.services.jcr.impl.RepositoryCreationSynchronizer</type>
<init-params>
Deleted: jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/resources/conf/portal/exo-jcr-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1,166 +0,0 @@
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-<repository-service default-repository="repository">
- <repositories>
- <repository name="repository" system-workspace="production" default-workspace="production">
- <security-domain>exo-domain</security-domain>
- <access-control>optional</access-control>
- <authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
- <workspaces>
- <workspace name="production">
- <!-- for system storage -->
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/production" />
- </properties>
- <value-storages>
- <value-storage id="production" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/production" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="10k" />
- <property name="live-time" value="1h" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/production" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/lock/production" />
- </properties>
- </persister>
- </lock-manager>
- </workspace>
-
- <workspace name="backup">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/backup" />
- </properties>
- <value-storages>
- <value-storage id="backup" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/backup" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured" />
- </properties>
- </initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="10k" />
- <property name="live-time" value="1h" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/backup" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/lock/backup" />
- </properties>
- </persister>
- </lock-manager>
- </workspace>
-
- <workspace name="digital-assets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcjcr" />
- <property name="multi-db" value="false" />
- <property name="max-buffer-size" value="200k" />
- <property name="swap-directory" value="${exo.jcr.parent.dir:..}/temp/swap/digital-assets" />
- </properties>
- <value-storages>
- <value-storage id="digital-assets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/values/digital-assets" />
- </properties>
- <filters>
- <filter property-type="Binary" />
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:folder" />
- </properties>
- </initializer>
- <cache enabled="true" class="org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl">
- <properties>
- <property name="max-size" value="5k" />
- <property name="live-time" value="15m" />
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="${exo.jcr.parent.dir:..}/temp/jcrlucenedb/digital-assets" />
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="${exo.jcr.parent.dir:..}/temp/lock/digital-assets" />
- </properties>
- </persister>
- </lock-manager>
- </workspace>
- </workspaces>
- </repository>
- </repositories>
-</repository-service>
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestRepositoryManagement.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -72,8 +72,6 @@
public void testMarshalUnmarshalRepositoryConfiguration() throws Exception
{
ManageableRepository newRepository = helper.createRepository(container, false, null);
- final long lockManagerTimeOut =
- newRepository.getConfiguration().getWorkspaceEntries().get(0).getLockManager().getTimeout();
// 1st marshal configuration
File tempFile = PrivilegedFileHelper.createTempFile("test-config", "xml");
@@ -100,8 +98,6 @@
// 1st check
RepositoryEntry unmarshledRepositoryEntry =
conf.getRepositoryConfiguration(newRepository.getConfiguration().getName());
- assertEquals(lockManagerTimeOut, unmarshledRepositoryEntry.getWorkspaceEntries().get(0).getLockManager()
- .getTimeout());
// 2nd marshal configuration
@@ -127,8 +123,6 @@
// 2nd check
unmarshledRepositoryEntry =
conf.getRepositoryConfiguration(newRepository.getConfiguration().getName());
- assertEquals(lockManagerTimeOut, unmarshledRepositoryEntry.getWorkspaceEntries().get(0).getLockManager()
- .getTimeout());
}
public void testAddNewRepositoryWithSameName() throws Exception
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/lock/TestLockImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/lock/TestLockImpl.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/lock/TestLockImpl.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -35,7 +35,7 @@
{
private ExtendedNode lockedNode = null;
- private LockManagerImpl service;
+ private WorkspaceLockManager service;
private static final long LOCK_TIMEOUT = 5; // sec
@@ -48,7 +48,7 @@
super.setUp();
- service = (LockManagerImpl)container.getComponentInstanceOfType(LockManagerImpl.class);
+ service = (WorkspaceLockManager)container.getComponentInstanceOfType(WorkspaceLockManager.class);
if (lockedNode == null)
try
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -24,7 +24,6 @@
import org.exoplatform.services.jcr.config.CacheEntry;
import org.exoplatform.services.jcr.config.ContainerEntry;
import org.exoplatform.services.jcr.config.LockManagerEntry;
-import org.exoplatform.services.jcr.config.LockPersisterEntry;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -33,13 +32,9 @@
import org.exoplatform.services.jcr.config.ValueStorageFilterEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.core.ManageableRepository;
-import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
-import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -237,16 +232,44 @@
cacheEntry.setEnabled(cacheEnabled);
cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
- // Lock
LockManagerEntry lockManagerEntry = new LockManagerEntry();
- lockManagerEntry.setTimeout(900000);
- LockPersisterEntry lockPersisterEntry = new LockPersisterEntry();
- lockPersisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
- ArrayList<SimpleParameterEntry> lockPersisterParameters = new ArrayList<SimpleParameterEntry>();
- lockPersisterParameters.add(new SimpleParameterEntry("path", "target/temp/lock/" + wsName));
- lockPersisterEntry.setParameters(lockPersisterParameters);
- lockManagerEntry.setPersister(lockPersisterEntry);
+ lockManagerEntry.putParameterValue("time-out", "15m");
+ // ISPN Lock
+ try
+ {
+ Class.forName("org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl");
+
+ lockManagerEntry
+ .setType("org.exoplatform.services.jcr.impl.core.lock.infinispan.ISPNCacheableLockManagerImpl");
+ lockManagerEntry.putParameterValue("infinispan-configuration", "conf/standalone/test-infinispan-lock.xml");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.name", "lk");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.create", "true");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.table.drop", "false");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.id.column", "id");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.data.column", "data");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.timestamp.column", "timestamp");
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.datasource", dsName);
+ lockManagerEntry.putParameterValue("infinispan-cl-cache.jdbc.connectionFactory",
+ "org.infinispan.loaders.jdbc.connectionfactory.ManagedConnectionFactory");
+ }
+ catch (ClassNotFoundException e)
+ {
+ // JBC Lock
+ lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
+ lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
+ "jcrlocks_" + IdGenerator.generate());
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", dsName);
+ lockManagerEntry.putParameterValue("jbosscache-shareable", "${jbosscache-shareable}");
+ }
+
WorkspaceEntry workspaceEntry = new WorkspaceEntry();
workspaceEntry.setContainer(containerEntry);
workspaceEntry.setCache(cacheEntry);
@@ -272,130 +295,6 @@
return ids;
}
- @Deprecated
- public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String dsName, String vsPath, ContainerEntry entry,
- boolean newMultiDbDS) throws Exception
- {
-
- String dbDialect = null;
- if (dsName != null)
- {
- DataSource ds = (DataSource)new InitialContext().lookup(dsName);
- if (ds != null)
- {
- Connection jdbcConn = null;
-
- jdbcConn = ds.getConnection();
- dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
-
- }
- }
-
- if (newMultiDbDS && (isMultiDb || dsName == null))
- {
- dsName = createDatasource();
- }
-
- List params = new ArrayList();
-
- params.add(new SimpleParameterEntry("source-name", dsName));
- params.add(new SimpleParameterEntry("db-type", "generic"));
- params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" : "false"));
- params.add(new SimpleParameterEntry("max-buffer-size", "204800"));
-
- if (dbDialect != null)
- {
- params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT, dbDialect));
- }
- else if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != null)
- {
- params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DIALECT, entry
- .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT)));
- }
-
- String oldSwap = entry.getParameterValue("swap-directory");
- String newSwap = oldSwap.substring(0, oldSwap.lastIndexOf('/')) + '/' + wsName;
-
- params.add(new SimpleParameterEntry("swap-directory", newSwap));
-
- ContainerEntry containerEntry =
- new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer",
- (ArrayList)params);
- containerEntry.setParameters(params);
-
- if (vsPath != null)
- {
-
- ArrayList<ValueStorageFilterEntry> vsparams = new ArrayList<ValueStorageFilterEntry>();
- ValueStorageFilterEntry filterEntry = new ValueStorageFilterEntry();
- filterEntry.setPropertyType("Binary");
- vsparams.add(filterEntry);
-
- ValueStorageEntry valueStorageEntry =
- new ValueStorageEntry("org.exoplatform.services.jcr.impl.storage.value.fs.SimpleFileValueStorage", vsparams);
- ArrayList<SimpleParameterEntry> spe = new ArrayList<SimpleParameterEntry>();
- spe.add(new SimpleParameterEntry("path", vsPath));
- valueStorageEntry.setId(IdGenerator.generate());
- valueStorageEntry.setParameters(spe);
- valueStorageEntry.setFilters(vsparams);
-
- // containerEntry.setValueStorages();
- containerEntry.setParameters(params);
- ArrayList list = new ArrayList(1);
- list.add(valueStorageEntry);
-
- containerEntry.setValueStorages(list);
-
- }
-
- // Indexer
- ArrayList qParams = new ArrayList();
- qParams.add(new SimpleParameterEntry("indexDir", "target/temp/index/" + IdGenerator.generate()));
- QueryHandlerEntry qEntry =
- new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex", qParams);
-
- WorkspaceEntry workspaceEntry =
- new WorkspaceEntry(wsName != null ? wsName : IdGenerator.generate(), "nt:unstructured");
- workspaceEntry.setContainer(containerEntry);
-
- ArrayList cacheParams = new ArrayList();
-
- cacheParams.add(new SimpleParameterEntry("maxSize", "2000"));
- cacheParams.add(new SimpleParameterEntry("liveTime", "20m"));
- CacheEntry cacheEntry = new CacheEntry(cacheParams);
- cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
-
- workspaceEntry.setCache(cacheEntry);
-
- workspaceEntry.setQueryHandler(qEntry);
-
- LockManagerEntry lockManagerEntry = new LockManagerEntry();
- lockManagerEntry.setTimeout(900000);
- LockPersisterEntry persisterEntry = new LockPersisterEntry();
- persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister");
- ArrayList lpParams = new ArrayList();
- lpParams.add(new SimpleParameterEntry("path", "target/temp/lock"));
- persisterEntry.setParameters(lpParams);
- lockManagerEntry.setPersister(persisterEntry);
- workspaceEntry.setLockManager(lockManagerEntry);
-
- // workspaceEntry
- return workspaceEntry;
- }
-
- @Deprecated
- public void createWorkspace(WorkspaceEntry workspaceEntry, ExoContainer container)
- throws RepositoryConfigurationException, RepositoryException
- {
- RepositoryService service = (RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
- RepositoryImpl defRep;
-
- defRep = (RepositoryImpl)service.getDefaultRepository();
- defRep.configWorkspace(workspaceEntry);
- defRep.createWorkspace(workspaceEntry.getName());
-
- }
-
public static TesterConfigurationHelper getInstance()
{
if (instance == null)
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/ProxyWorkspaceDataReceiver.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/ProxyWorkspaceDataReceiver.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/ProxyWorkspaceDataReceiver.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -19,7 +19,7 @@
package org.exoplatform.services.jcr.ext.replication;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;
+import org.exoplatform.services.jcr.impl.core.lock.WorkspaceLockManager;
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
@@ -43,7 +43,7 @@
* @throws RepositoryConfigurationException
* will be generated RepositoryConfigurationException
*/
- public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataManager, LockManagerImpl lockManager)
+ public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataManager, WorkspaceLockManager lockManager)
throws RepositoryConfigurationException
{
this(dataManager, null, lockManager);
@@ -91,7 +91,7 @@
* will be generated the RepositoryConfigurationException
*/
public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataManager, SearchManager searchManager,
- LockManagerImpl lockManager) throws RepositoryConfigurationException
+ WorkspaceLockManager lockManager) throws RepositoryConfigurationException
{
dataKeeper = new WorkspaceDataManagerProxy(dataManager, searchManager, lockManager);
}
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataManagerProxy.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataManagerProxy.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/replication/WorkspaceDataManagerProxy.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -21,7 +21,7 @@
import org.exoplatform.services.jcr.dataflow.ItemDataKeeper;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
-import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl;
+import org.exoplatform.services.jcr.impl.core.lock.WorkspaceLockManager;
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
import org.exoplatform.services.log.ExoLogger;
@@ -67,7 +67,7 @@
* the LockManagerImpl
*/
public WorkspaceDataManagerProxy(CacheableWorkspaceDataManager dataManager, SearchManager searchIndex,
- LockManagerImpl lockManager)
+ WorkspaceLockManager lockManager)
{
this.listeners = new ArrayList<ItemsPersistenceListener>();
listeners.add(dataManager.getCache());
@@ -78,7 +78,7 @@
if (lockManager != null)
{
- listeners.add(lockManager);
+ listeners.add((ItemsPersistenceListener)lockManager);
}
log.info("WorkspaceDataManagerProxy is instantiated");
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/util/TesterConfigurationHelper.java 2012-01-03 14:33:36 UTC (rev 5414)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.CacheEntry;
import org.exoplatform.services.jcr.config.ContainerEntry;
+import org.exoplatform.services.jcr.config.LockManagerEntry;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
@@ -31,6 +32,7 @@
import org.exoplatform.services.jcr.config.ValueStorageFilterEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.core.ManageableRepository;
+import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -187,12 +189,30 @@
CacheEntry cacheEntry = new CacheEntry(params);
cacheEntry.setType(baseWorkspaceEntry.getCache().getType());
+ // Lock
+ LockManagerEntry lockManagerEntry = new LockManagerEntry();
+ lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
+ lockManagerEntry.putParameterValue("time-out", "15m");
+ lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
+ "jcrlocks_" + IdGenerator.generate());
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", baseWorkspaceEntry.getContainer()
+ .getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME));
+ lockManagerEntry.putParameterValue("jbosscache-shareable", "${jbosscache-shareable}");
+
WorkspaceEntry workspaceEntry = new WorkspaceEntry();
workspaceEntry.setContainer(containerEntry);
workspaceEntry.setCache(cacheEntry);
workspaceEntry.setQueryHandler(qEntry);
workspaceEntry.setName(baseWorkspaceEntry.getName());
workspaceEntry.setUniqueName(baseWorkspaceEntry.getUniqueName());
+ workspaceEntry.setLockManager(lockManagerEntry);
return workspaceEntry;
@@ -321,7 +341,24 @@
CacheEntry cacheEntry = new CacheEntry(cacheParams);
cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl");
+ // Lock
+ LockManagerEntry lockManagerEntry = new LockManagerEntry();
+ lockManagerEntry.setType("org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl");
+ lockManagerEntry.putParameterValue("time-out", "15m");
+ lockManagerEntry.putParameterValue("jbosscache-configuration", "conf/standalone/test-jbosscache-lock.xml");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.name", "jcrlocks");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.create", "true");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.drop", "false");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.table.primarykey",
+ "jcrlocks_" + IdGenerator.generate());
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.fqn.column", "fqn");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.node.column", "node");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.parent.column", "parent");
+ lockManagerEntry.putParameterValue("jbosscache-cl-cache.jdbc.datasource", dsName);
+ lockManagerEntry.putParameterValue("jbosscache-shareable", "${jbosscache-shareable}");
+
WorkspaceEntry workspaceEntry = new WorkspaceEntry();
+ workspaceEntry.setLockManager(lockManagerEntry);
workspaceEntry.setContainer(containerEntry);
workspaceEntry.setCache(cacheEntry);
workspaceEntry.setQueryHandler(qEntry);
Added: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jbosscache-lock.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jbosscache-lock.xml (rev 0)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="500" lockParentForChildInsertRemove="false"
+ 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
+ -->
+ <loader class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache>
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config-backup.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -60,8 +60,20 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db3ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>54000</time-out>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr6" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -100,9 +112,21 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db3ws1" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>54000</time-out>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr6" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -147,8 +171,20 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db4ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr7" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -187,9 +223,21 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db4ws1" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr6" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
Modified: jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ext/src/test/resources/conf/standalone/test-jcr-ext-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -57,7 +57,23 @@
<property name="index-dir" value="target/temp/index/ws" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws1">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -79,7 +95,23 @@
<property name="index-dir" value="target/temp/index/ws1" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr1" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws2" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -101,7 +133,23 @@
<property name="index-dir" value="target/temp/index/ws2" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr2" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws3" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -123,7 +171,23 @@
<property name="index-dir" value="target/temp/index/ws3" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr3" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws4" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -145,7 +209,23 @@
<property name="index-dir" value="target/temp/index/ws4" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr4" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws5" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -167,9 +247,25 @@
<property name="index-dir" value="target/temp/index/ws5" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr5" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
- </repository>
+ </repository>\
+
<repository name="db2" system-workspace="ws" default-workspace="ws">
<security-domain>exo-domain</security-domain>
<access-control>optional</access-control>
@@ -197,6 +293,21 @@
<property name="index-dir" value="target/temp/index/db2_ws" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr19" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -241,8 +352,20 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db3ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>54000</time-out>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr6" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -281,9 +404,21 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db3ws1" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>54000</time-out>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr6" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -328,8 +463,20 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db4ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr7" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -368,9 +515,21 @@
<property name="index-dir" value="target/temp/jcrlucenedb/db4ws1" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr8" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -401,8 +560,24 @@
<properties>
<property name="index-dir" value="target/temp/index/db5_ws" />
</properties>
- </query-handler>
+ </query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr21" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws1">
<!-- for system storage -->
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
@@ -425,9 +600,25 @@
<property name="index-dir" value="target/temp/index/db5_ws1" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr23" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
+
<repository name="db6" system-workspace="ws" default-workspace="ws">
<security-domain>exo-domain</security-domain>
<access-control>optional</access-control>
@@ -455,7 +646,23 @@
<property name="index-dir" value="target/temp/index/db6_ws" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr24" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws1">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -477,7 +684,23 @@
<property name="index-dir" value="target/temp/index/db6_ws1" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr25" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws2">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -499,6 +722,21 @@
<property name="index-dir" value="target/temp/index/db6_ws2" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr26" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -540,7 +778,23 @@
<property name="index-dir" value="target/temp/index/db7_ws" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr_to_repository_restore_singel_db" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws1">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer">
<properties>
@@ -572,6 +826,21 @@
<property name="index-dir" value="target/temp/index/db7_ws1" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr_to_repository_restore_singel_db" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
Added: jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jbosscache-lock.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jbosscache-lock.xml (rev 0)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="500" lockParentForChildInsertRemove="false"
+ 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
+ -->
+ <loader class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache>
Modified: jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.ftp/src/test/resources/conf/standalone/test-jcr-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -47,13 +47,20 @@
<property name="indexDir" value="target/temp/index/ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>900000</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws" />
- </properties>
- </persister>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -79,13 +86,20 @@
<property name="indexDir" value="target/temp/index/ws2" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>900000</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws2" />
- </properties>
- </persister>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
</workspaces>
Added: jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jbosscache-lock.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jbosscache-lock.xml (rev 0)
+++ jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="500" lockParentForChildInsertRemove="false"
+ 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
+ -->
+ <loader class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache>
Modified: jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jcr-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-jcr-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -66,13 +66,20 @@
<property name="index-dir" value="target/temp/index/db1/ws" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock" />
- </properties>
- </persister>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -107,6 +114,21 @@
<property name="index-dir" value="target/temp/index/db1/ws1" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr1" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
<workspace name="ws2">
@@ -140,6 +162,21 @@
<property name="index-dir" value="target/temp/index/db1/ws2" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr2" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/backup-client.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/backup-client.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup/backup-client.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -711,11 +711,7 @@
} ],
"type" : "org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer"
},
- "lockManager" : { "persister" : { "parameters" : [ { "name" : "path",
- "value" : "../temp/lock/system"
- } ],
- "type" : "org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister"
- },
+ "lockManager" :
"timeout" : 15728640
},
"name" : "production",
@@ -846,11 +842,7 @@
} ],
"type" : "org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer"
},
- "lockManager" : { "persister" : { "parameters" : [ { "name" : "path",
- "value" : "../temp/lock/system"
- } ],
- "type" : "org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister"
- },
+ "lockManager" :
"timeout" : 15728640
},
"name" : "production",
@@ -1617,6 +1609,21 @@
<property name="index-dir" value="../temp/jcrlucenedb/backup" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
@@ -1788,13 +1795,20 @@
<property name="index-dir" value="../temp/jcrlucenedb/production" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/system" />
- </properties>
- </persister>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
@@ -1833,6 +1847,21 @@
<property name="index-dir" value="../temp/jcrlucenedb/backup" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
<workspace name="digital-assets">
@@ -1870,6 +1899,21 @@
<property name="index-dir" value="../temp/jcrlucenedb/digital-assets" />
</properties>
</query-handler>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/jdbc-data-container-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -572,15 +572,23 @@
<property name="index-dir" value="target/temp/index"/>
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15 min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws"/>
- </properties>
- </persister>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
+
<workspace name="ws1" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
@@ -602,14 +610,21 @@
<property name="index-dir" value="target/temp/index"/>
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15 min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws1"/>
- </properties>
- </persister>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</programlisting>
@@ -729,14 +744,21 @@
<property name="index-dir" value="../temp/index"/>
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws"/>
- </properties>
- </persister>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
<workspace name="ws1" auto-init-root-nodetype="nt:unstructured">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
@@ -754,14 +776,21 @@
<property name="live-time" value="5m"/>
</properties>
</cache>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="target/temp/lock/ws1"/>
- </properties>
- </persister>
- </lock-manager>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</programlisting>
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/lock-manager-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -18,14 +18,10 @@
<para>Also, LockManager is responsible for removing Locks that live too
long. This parameter may be configured with "time-out" property.</para>
- <para>JCR provides two basic implementations of LockManager:</para>
+ <para>JCR provides one basic implementations of LockManager:</para>
<itemizedlist>
<listitem>
- <para><classname>org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl</classname>;</para>
- </listitem>
-
- <listitem>
<para><classname>org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl</classname>;</para>
</listitem>
</itemizedlist>
@@ -51,18 +47,6 @@
</section>
<section>
- <title>LockManagerImpl</title>
-
- <para>LockManagerImpl is a simple implementation of LockManager, and also
- faster than CacheableLockManager. It stores Lock objects in HashMap and
- may also persist Locks if LockPersister is configured. LockManagerImpl
- does not support replication in any way.</para>
-
- <para>See more about LockManager Configuration at <link
- linkend="JCR.eXoJCRconfiguration">here</link>.</para>
- </section>
-
- <section>
<title>CacheableLockManagerImpl</title>
<para>CacheableLockManagerImpl stores Lock objects in JBoss-cache, so
@@ -70,10 +54,10 @@
JBoss-cache has JDBCCacheLoader, so Locks will be stored to the
database.</para>
- <para>Both of the implementations support to remove Expired Locks.
- LockRemover separates threads, that periodically ask LockManager to remove
- Locks that live so long. So, the timeout for LockRemover may be set as
- follows, the default value is 30m.</para>
+ <para>It supports to remove Expired Locks. LockRemover separates threads,
+ that periodically ask LockManager to remove Locks that live so long. So,
+ the timeout for LockRemover may be set as follows, the default value is
+ 30m.</para>
<programlisting language="xml"><properties>
<property name="time-out" value="10m" />
@@ -83,150 +67,7 @@
<section>
<title>Configuration</title>
- <para>Replication requirements are the same for Cache.</para>
-
- <para>You can see a full JCR configuration example at <link
- linkend="JCR.ClusterConfig.JCRExternalConfig">here</link>.</para>
-
- <para>Common tips:</para>
-
- <itemizedlist>
- <listitem>
- <para><parameter>clusterName</parameter> ("jbosscache-cluster-name")
- must be unique;</para>
- </listitem>
-
- <listitem>
- <para><parameter>cache.jdbc.table.name</parameter> must be unique
- per datasource;</para>
- </listitem>
-
- <listitem>
- <para><parameter>cache.jdbc.fqn.type</parameter> and
- cache.jdbc.node.type must be configured according to used
- database;</para>
- </listitem>
- </itemizedlist>
-
- <para>There are a few ways to configure CacheableLockManagerImpl, and
- all of them configure JBoss-cache and JDBCCacheLoader.</para>
-
- <para>See <ulink
- url="http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader">http://community.jboss.org/wiki/JBossCacheJDBCCacheLoader</ulink></para>
- </section>
-
- <section>
- <title>Simple JbossCache Configuration</title>
-
- <para>The first one is putting JbossCache configuraion file path to
- CacheableLockManagerImpl.</para>
-
- <para><note>
- <para>This configuration is not so good as you think. Because the
- repository may contain many workspaces, and each workspace must
- contain LockManager configuration, and LockManager configuration may
- contain the JbossCache config file. So, the total configuration will
- grow up. But it is useful if we want to have a single LockManager
- with a special configuration.</para>
- </note></para>
-
- <para>Configuration is as follows:</para>
-
- <programlisting language="xml"><lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
- <properties>
- <property name="time-out" value="15m" />
- <property name="jbosscache-configuration" value="conf/standalone/cluster/test-jbosscache-lock-config.xml" />
- </properties>
-</lock-manager></programlisting>
-
- <para><filename>test-jbosscache-lock-config.xml</filename></para>
-
- <programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.2">
-
- <locking useLockStriping="false" concurrencyLevel="50000" lockParentForChildInsertRemove="false" lockAcquisitionTimeout="20000" />
-
- <clustering mode="replication" clusterName="JBoss-Cache-Lock-Cluster_Name">
- <stateRetrieval timeout="20000" fetchInMemoryState="false" nonBlocking="true" />
- <jgroupsConfig>
-
- <TCP bind_addr="127.0.0.1" start_port="9800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
- max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="false" use_send_queues="false" sock_conn_timeout="300"
- skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
- thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
- 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" />
- <MPING timeout="2000" num_initial_members="2" mcast_port="34540" bind_addr="127.0.0.1" mcast_addr="224.0.0.1" />
-
-
- <MERGE2 max_interval="30000" min_interval="10000" />
- <FD_SOCK />
- <FD max_tries="5" shun="true" timeout="10000" />
- <VERIFY_SUSPECT timeout="1500" />
- <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false" />
- <UNICAST timeout="300,600,1200,2400,3600" />
- <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000" />
- <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000" view_bundling="true" />
- <FRAG2 frag_size="60000" />
- <pbcast.STREAMING_STATE_TRANSFER />
- <pbcast.FLUSH timeout="0" />
-
- </jgroupsConfig
-
- <sync />
- </clustering>
-
- <loaders passivation="false" shared="true">
- <preload>
- <node fqn="/" />
- </preload>
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
- <properties>
- cache.jdbc.table.name=jcrlocks_ws
- cache.jdbc.table.create=true
- cache.jdbc.table.drop=false
- cache.jdbc.table.primarykey=jcrlocks_ws_pk
- cache.jdbc.fqn.column=fqn
- cache.jdbc.fqn.type=VARCHAR(512)
- cache.jdbc.node.column=node
- cache.jdbc.node.type=<BLOB>
- cache.jdbc.parent.column=parent
- cache.jdbc.datasource=jdbcjcr
- </properties>
- </loader>
-
- </loaders>
-
-</jbosscache>
-</programlisting>
-
- <para>Configuration requirements:</para>
-
- <itemizedlist>
- <listitem>
- <para><clustering mode="replication"
- clusterName="JBoss-Cache-Lock-Cluster_Name"> - the cluster name
- must be unique;</para>
- </listitem>
-
- <listitem>
- <para><parameter>cache.jdbc.table.name</parameter> must be unique
- per datasource;</para>
- </listitem>
-
- <listitem>
- <para><parameter>cache.jdbc.node.type</parameter> and
- <parameter>cache.jdbc.fqn.type</parameter> must be configured
- according to using the database. See <link endterm="datatypes.title"
- linkend="datatypes"></link> .</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Template JBossCache Configuration</title>
-
- <para>The second one is using the template JBoss-cache configuration for
+ <para>The configuration uses the template JBoss-cache configuration for
all LockManagers.</para>
<para><citetitle>Lock template configuration</citetitle></para>
@@ -254,7 +95,7 @@
For another cache-loader class you should use another template with
cache-loader specific parameters
->
- <loader class="org.jboss.cache.loader.JDBCCacheLoader" async=q"false" fetchPersistentState="false"
+ <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="false"
ignoreModifications="false" purgeOnStartup="false">
<properties>
cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
@@ -292,6 +133,7 @@
<property name="jbosscache-cl-cache.jdbc.node.type" value="AUTO"/>
<property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
<property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
</properties>
</lock-manager></programlisting>
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr-with-gtn/how-to-extend-my-gatein-instance.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr-with-gtn/how-to-extend-my-gatein-instance.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr-with-gtn/how-to-extend-my-gatein-instance.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -1489,13 +1489,20 @@
<property name="index-dir" value="../temp/jcrlucenedb/sample-ws${container.name.suffix}" />
</properties>
</query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/sample-ws${container.name.suffix}" />
- </properties>
- </persister>
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
</lock-manager>
</workspace>
</workspaces>
Added: jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jbosscache-lock.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jbosscache-lock.xml (rev 0)
+++ jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jbosscache-lock.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="500" lockParentForChildInsertRemove="false"
+ 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
+ -->
+ <loader class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache>
Modified: jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jcr-framework-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jcr-framework-config.xml 2011-12-30 13:15:06 UTC (rev 5413)
+++ jcr/branches/1.15.x/exo.jcr.framework.command/src/test/resources/conf/standalone/test-jcr-framework-config.xml 2012-01-03 14:33:36 UTC (rev 5414)
@@ -44,6 +44,21 @@
<property name="index-dir" value="target/temp/index" />
</properties>
</query-handler -->
+ <lock-manager class="org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLockManagerImpl">
+ <properties>
+ <property name="time-out" value="15m" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-lock.xml" />
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlocks" />
+ <property name="jbosscache-cl-cache.jdbc.table.create" value="true" />
+ <property name="jbosscache-cl-cache.jdbc.table.drop" value="false" />
+ <property name="jbosscache-cl-cache.jdbc.table.primarykey" value="jcrlocks_pk" />
+ <property name="jbosscache-cl-cache.jdbc.fqn.column" value="fqn" />
+ <property name="jbosscache-cl-cache.jdbc.node.column" value="node" />
+ <property name="jbosscache-cl-cache.jdbc.parent.column" value="parent" />
+ <property name="jbosscache-cl-cache.jdbc.datasource" value="jdbcjcr" />
+ <property name="jbosscache-shareable" value="true" />
+ </properties>
+ </lock-manager>
</workspace>
</workspaces>
</repository>
12 years, 4 months