exo-jcr SVN: r1997 - junit.framework/trunk.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-03 11:53:25 -0500 (Wed, 03 Mar 2010)
New Revision: 1997
Modified:
junit.framework/trunk/pom.xml
Log:
EXOJCR-562: junit.framework
Modified: junit.framework/trunk/pom.xml
===================================================================
--- junit.framework/trunk/pom.xml 2010-03-03 16:50:59 UTC (rev 1996)
+++ junit.framework/trunk/pom.xml 2010-03-03 16:53:25 UTC (rev 1997)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
- <version>5</version>
+ <version>6-SNAPSHOT</version>
</parent>
<groupId>org.exoplatform.tool</groupId>
16 years, 3 months
exo-jcr SVN: r1996 - jcr/trunk.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-03 11:50:59 -0500 (Wed, 03 Mar 2010)
New Revision: 1996
Modified:
jcr/trunk/pom.xml
Log:
EXOJCR-562: jcr
Modified: jcr/trunk/pom.xml
===================================================================
--- jcr/trunk/pom.xml 2010-03-03 16:44:48 UTC (rev 1995)
+++ jcr/trunk/pom.xml 2010-03-03 16:50:59 UTC (rev 1996)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
- <version>5</version>
+ <version>6-SNAPSHOT</version>
</parent>
<groupId>org.exoplatform.jcr</groupId>
<artifactId>jcr-parent</artifactId>
16 years, 3 months
exo-jcr SVN: r1995 - ws/trunk.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-03 11:44:48 -0500 (Wed, 03 Mar 2010)
New Revision: 1995
Modified:
ws/trunk/pom.xml
Log:
EXOJCR-562: ws
Modified: ws/trunk/pom.xml
===================================================================
--- ws/trunk/pom.xml 2010-03-03 16:42:17 UTC (rev 1994)
+++ ws/trunk/pom.xml 2010-03-03 16:44:48 UTC (rev 1995)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
- <version>5</version>
+ <version>6-SNAPSHOT</version>
</parent>
<groupId>org.exoplatform.ws</groupId>
16 years, 3 months
exo-jcr SVN: r1994 - core/trunk.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-03 11:42:17 -0500 (Wed, 03 Mar 2010)
New Revision: 1994
Modified:
core/trunk/pom.xml
Log:
EXOJCR-562: core
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-03-03 16:38:03 UTC (rev 1993)
+++ core/trunk/pom.xml 2010-03-03 16:42:17 UTC (rev 1994)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
- <version>5</version>
+ <version>6-SNAPSHOT</version>
</parent>
<groupId>org.exoplatform.core</groupId>
16 years, 3 months
exo-jcr SVN: r1993 - kernel/trunk.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-03 11:38:03 -0500 (Wed, 03 Mar 2010)
New Revision: 1993
Modified:
kernel/trunk/pom.xml
Log:
EXOJCR-562: kernel
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2010-03-03 16:33:07 UTC (rev 1992)
+++ kernel/trunk/pom.xml 2010-03-03 16:38:03 UTC (rev 1993)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform</groupId>
<artifactId>foundation-parent</artifactId>
- <version>5</version>
+ <version>6-SNAPSHOT</version>
</parent>
<groupId>org.exoplatform.kernel</groupId>
16 years, 3 months
exo-jcr SVN: r1992 - in kernel/trunk: exo.kernel.commons and 1 other directories.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-03-03 11:33:07 -0500 (Wed, 03 Mar 2010)
New Revision: 1992
Modified:
kernel/trunk/exo.kernel.commons/pom.xml
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
kernel/trunk/pom.xml
Log:
EXOJCR-550 slf4j-log4j and log4j scope changed to <test>; except exo.kernel.commons (need for compilation)
Modified: kernel/trunk/exo.kernel.commons/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.commons/pom.xml 2010-03-03 15:57:01 UTC (rev 1991)
+++ kernel/trunk/exo.kernel.commons/pom.xml 2010-03-03 16:33:07 UTC (rev 1992)
@@ -45,6 +45,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -53,6 +54,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
+ <scope>compile</scope>
</dependency>
</dependencies>
</project>
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2010-03-03 15:57:01 UTC (rev 1991)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2010-03-03 16:33:07 UTC (rev 1992)
@@ -1,64 +1,83 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+<!--
- <parent>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>kernel-parent</artifactId>
- <version>2.2.1-GA-SNAPSHOT</version>
- </parent>
+ Copyright (C) 2009 eXo Platform SAS.
- <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
- <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
- <description>JBoss Cache Implementation for the Cache Service</description>
+ 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.
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exo.tool.framework.junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.cache</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <!-- We add this system property due to some incompatibility between IPv6 and
+ 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.
+
+-->
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>kernel-parent</artifactId>
+ <version>2.2.1-GA-SNAPSHOT</version>
+ </parent>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
+ <description>JBoss Cache Implementation for the Cache Service</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.tool</groupId>
+ <artifactId>exo.tool.framework.junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <!-- We add this system property due to some incompatibility between IPv6 and
some JVM of Linux distributions such as Ubuntu and Fedora-->
- <property>
- <name>java.net.preferIPv4Stack</name>
- <value>true</value>
- </property>
- <!-- Avoid the firewall -->
- <property>
- <name>bind.address</name>
- <value>127.0.0.1</value>
- </property>
- <property>
- <name>jgroups.stack</name>
- <value>udp</value>
- </property>
-
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>bind.address</name>
+ <value>127.0.0.1</value>
+ </property>
+ <property>
+ <name>jgroups.stack</name>
+ <value>udp</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2010-03-03 15:57:01 UTC (rev 1991)
+++ kernel/trunk/pom.xml 2010-03-03 16:33:07 UTC (rev 1992)
@@ -37,7 +37,7 @@
<properties>
<exo.product.name>exo-kernel</exo.product.name>
- <exo.product.specification>2.2</exo.product.specification>
+ <exo.product.specification>2.2</exo.product.specification>
<org.exoplatform.framework.junit.version>1.2.1-GA</org.exoplatform.framework.junit.version>
<forkMode>always</forkMode>
</properties>
@@ -116,16 +116,19 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.8</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
16 years, 3 months
exo-jcr SVN: r1991 - core/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-03-03 10:57:01 -0500 (Wed, 03 Mar 2010)
New Revision: 1991
Modified:
core/trunk/pom.xml
Log:
EXOJCR-483 exo.tool.framework.junit version is now set by {org.exoplatform.framework.junit.version} variable
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-03-03 15:54:33 UTC (rev 1990)
+++ core/trunk/pom.xml 2010-03-03 15:57:01 UTC (rev 1991)
@@ -37,7 +37,8 @@
<properties>
<exo.product.name>exo-core</exo.product.name>
<exo.product.specification>2.3</exo.product.specification>
-
+
+ <org.exoplatform.framework.junit.version>1.2.1-GA</org.exoplatform.framework.junit.version>
<org.exoplatform.kernel.version>2.2.1-GA-SNAPSHOT</org.exoplatform.kernel.version>
<exo.test.includes>*Test*</exo.test.includes>
</properties>
@@ -68,7 +69,7 @@
<dependency>
<groupId>org.exoplatform.tool</groupId>
<artifactId>exo.tool.framework.junit</artifactId>
- <version>1.2.0</version>
+ <version>${org.exoplatform.framework.junit.version}</version>
</dependency>
<dependency>
16 years, 3 months
exo-jcr SVN: r1990 - kernel/trunk.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-03-03 10:54:33 -0500 (Wed, 03 Mar 2010)
New Revision: 1990
Modified:
kernel/trunk/pom.xml
Log:
EXOJCR-483 exo.tool.framework.junit version is now set by {org.exoplatform.framework.junit.version} variable
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2010-03-03 15:31:16 UTC (rev 1989)
+++ kernel/trunk/pom.xml 2010-03-03 15:54:33 UTC (rev 1990)
@@ -37,7 +37,8 @@
<properties>
<exo.product.name>exo-kernel</exo.product.name>
- <exo.product.specification>2.2</exo.product.specification>
+ <exo.product.specification>2.2</exo.product.specification>
+ <org.exoplatform.framework.junit.version>1.2.1-GA</org.exoplatform.framework.junit.version>
<forkMode>always</forkMode>
</properties>
@@ -64,7 +65,7 @@
<dependency>
<groupId>org.exoplatform.tool</groupId>
<artifactId>exo.tool.framework.junit</artifactId>
- <version>1.2.1-GA</version>
+ <version>${org.exoplatform.framework.junit.version}</version>
</dependency>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
16 years, 3 months
exo-jcr SVN: r1989 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-03 10:31:16 -0500 (Wed, 03 Mar 2010)
New Revision: 1989
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
Log:
EXOJCR-546: token cleanup reverted
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-03-03 15:22:55 UTC (rev 1988)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-03-03 15:31:16 UTC (rev 1989)
@@ -362,11 +362,7 @@
*/
public void notifyLockRemoved(String nodeIdentifier)
{
- LockData removedLockData = lockedNodes.remove(nodeIdentifier);
- //TODO do we really need remove lock token for removed lockData
- // also remember, tokens that added on another sessions will not be removed
- String token = getLockToken(removedLockData.getTokenHash());
- tokens.remove(token);
+ lockedNodes.remove(nodeIdentifier);
}
/**
16 years, 3 months
exo-jcr SVN: r1988 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core: lock and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-03 10:22:55 -0500 (Wed, 03 Mar 2010)
New Revision: 1988
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
Log:
EXOJCR-546: SessionLockManager - isLocked() and isLockHolder concatenated to checkLocking(); this avoid double call of lockManager.getExactNodeOrCloseParentLock(node) in CacheableSessionLockManager.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -2165,7 +2165,7 @@
if (!session.getLockManager().holdsLock((NodeData)this.getData()))
throw new LockException("The node not locked " + getPath());
- if (!session.getLockManager().isLockHolder(this))
+ if (!session.getLockManager().isLockHolder(this.nodeData()))
throw new LockException("There are no permission to unlock the node " + getPath());
if (dataManager.hasPendingChanges(getInternalPath()))
@@ -2309,8 +2309,12 @@
boolean checkLocking() throws RepositoryException
{
- return (!isLocked() || session.getLockManager().isLockHolder(this) || session.getUserID().equals(
+ // return (!isLocked() || session.getLockManager().isLockHolder(this) || session.getUserID().equals(
+ // SystemIdentity.SYSTEM));
+
+ return (session.getLockManager().checkLocking(this.nodeData()) || session.getUserID().equals(
SystemIdentity.SYSTEM));
+
}
protected void doOrderBefore(QPath srcPath, QPath destPath) throws RepositoryException
@@ -2537,7 +2541,7 @@
{
// locked, should be unlocked
- if (!session.getLockManager().isLockHolder(this))
+ if (!session.getLockManager().isLockHolder(this.nodeData()))
throw new LockException("There are no permission to unlock the node " + getPath());
// remove mix:lockable properties (as the node is locked)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/AbstractSessionLockManager.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl.core.lock;
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;
@@ -41,20 +40,58 @@
}
/**
- * Check if the node locked (and lock peristed in internal storage).
+ * Check if the node locked (locks persisted in internal storage).
* @param node NodeData to check
* @return boolean, <code>true</code> if the node is locked, <code>false</code> otherwise
* @throws LockException
*/
protected abstract boolean isLockedPersisted(NodeData node) throws LockException;
- protected abstract boolean isPersitedLockHolder(NodeImpl node) throws RepositoryException;
+ protected abstract boolean isPersistedLockHolder(NodeData node) throws RepositoryException;
/**
+ * Checks the node, is it accessible according to possible locks. If node is locked and current
+ * session is not lockHolder <code> false</code> will be returned.
+ *
+ * @param data - node that must be checked
+ * @return true - if lock not exist or current session is LockOwner; false - in other case;
+ * @throws LockException - if lock engine exception happens
+ */
+ protected abstract boolean checkPersistedLocks(NodeData node) throws LockException;
+
+ /**
* {@inheritDoc}
*/
- public boolean isLockHolder(NodeImpl node) throws RepositoryException
+ public boolean checkLocking(NodeData data) throws LockException
{
+ //check is new and find close persisted parent
+
+ while (transientManager.isNew(data.getIdentifier()))
+ {
+ // The node is new, so we will check directly its parent instead
+ try
+ {
+ data = (NodeData)transientManager.getItemData(data.getParentIdentifier());
+ if (data == null)
+ {
+ // The node is the root node and is new, so we consider it as unlocked
+ return true;
+ }
+ }
+ catch (RepositoryException e)
+ {
+ throw new LockException(e);
+ }
+ }
+
+ return checkPersistedLocks(data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isLockHolder(NodeData node) throws RepositoryException
+ {
//check is parent node also new
if (transientManager.isNew(node.getIdentifier()) && transientManager.isNew(node.getParentIdentifier()))
{
@@ -62,7 +99,7 @@
}
else
{
- return isPersitedLockHolder(node);
+ return isPersistedLockHolder(node);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/LockManagerImpl.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -255,10 +255,10 @@
return true;
}
- public boolean isLockHolder(NodeImpl node) throws RepositoryException
+ public boolean isLockHolder(NodeData node, String sessionId)// throws RepositoryException
{
- LockData lData = getLockData((NodeData)node.getData(), SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
- return lData != null && lData.isLockHolder(node.getSession().getId());
+ LockData lData = getLockData(node, SEARCH_EXECMATCH | SEARCH_CLOSEDPARENT);
+ return lData != null && lData.isLockHolder(sessionId);
}
public synchronized void onCloseSession(ExtendedSession session)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManager.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManager.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -114,7 +114,7 @@
* @return if the specified session holds a lock on the given node; otherwise returns
* <code>false</code>
*/
- boolean isLockHolder(NodeImpl node) throws RepositoryException;
+ boolean isLockHolder(NodeData node) throws RepositoryException;
/**
* Invoked by a session to inform that a lock token has been removed.
@@ -126,4 +126,13 @@
*/
void removeLockToken(String lt);
+ /**
+ * Checks this node, is it accessible according to possible locks. If node is locked and current
+ * session is not lockHolder <code> false</code> will be returned.
+ *
+ * @param data - node that must be checked
+ * @return true - if lock not exist or current session is LockOwner; false - in other case;
+ * @throws LockException - if lock engine exception happens
+ */
+ boolean checkLocking(NodeData data) throws LockException;
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/SessionLockManagerImpl.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -94,9 +94,9 @@
/**
* {@inheritDoc}
*/
- protected boolean isPersitedLockHolder(NodeImpl node) throws RepositoryException
+ protected boolean isPersistedLockHolder(NodeData node)// throws RepositoryException
{
- return lockManager.isLockHolder(node);
+ return lockManager.isLockHolder(node, sessionId);
}
/**
@@ -123,4 +123,11 @@
lockManager.onCloseSession(session);
}
+ /**
+ * {@inheritDoc}
+ */
+ protected boolean checkPersistedLocks(NodeData node) throws LockException
+ {
+ return (!isLockedPersisted(node) || isPersistedLockHolder(node));
+ }
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -114,7 +114,7 @@
public static final String JBOSSCACHE_JDBC_CL_NODE_COLUMN = "jbosscache-cl-cache.jdbc.node.type";
public static final String JBOSSCACHE_JDBC_CL_FQN_COLUMN = "jbosscache-cl-cache.jdbc.fqn.type";
-
+
public static final String JBOSSCACHE_JDBC_CL_AUTO = "auto";
/**
@@ -362,12 +362,14 @@
// if parameter is missing in configuration, then getParameterValue(JBOSSCACHE_JDBC_CL_NODE_COLUMN, JBOSSCACHE_JDBC_CL_AUTO)
// will return JBOSSCACHE_JDBC_CL_AUTO. If parameter is present in configuration and equals to "auto", then it should be replaced
// with correct value for given database
- if (parameterEntry.getParameterValue(JBOSSCACHE_JDBC_CL_NODE_COLUMN, JBOSSCACHE_JDBC_CL_AUTO).equalsIgnoreCase(JBOSSCACHE_JDBC_CL_AUTO))
+ if (parameterEntry.getParameterValue(JBOSSCACHE_JDBC_CL_NODE_COLUMN, JBOSSCACHE_JDBC_CL_AUTO)
+ .equalsIgnoreCase(JBOSSCACHE_JDBC_CL_AUTO))
{
parameterEntry.putParameterValue(JBOSSCACHE_JDBC_CL_NODE_COLUMN, blobType);
}
- if (parameterEntry.getParameterValue(JBOSSCACHE_JDBC_CL_FQN_COLUMN, JBOSSCACHE_JDBC_CL_AUTO).equalsIgnoreCase(JBOSSCACHE_JDBC_CL_AUTO))
+ if (parameterEntry.getParameterValue(JBOSSCACHE_JDBC_CL_FQN_COLUMN, JBOSSCACHE_JDBC_CL_AUTO).equalsIgnoreCase(
+ JBOSSCACHE_JDBC_CL_AUTO))
{
parameterEntry.putParameterValue(JBOSSCACHE_JDBC_CL_FQN_COLUMN, charType);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-03-03 15:05:06 UTC (rev 1987)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableSessionLockManager.java 2010-03-03 15:22:55 UTC (rev 1988)
@@ -16,7 +16,6 @@
*/
package org.exoplatform.services.jcr.impl.core.lock.jbosscache;
-import org.exoplatform.services.jcr.access.SystemIdentity;
import org.exoplatform.services.jcr.core.ExtendedSession;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
@@ -110,7 +109,6 @@
NodeData data = (NodeData)node.getData();
LockData lData = lockManager.getExactNodeOrCloseParentLock(data);
- //.getLockData(data, CacheableLockManager.SEARCH_EXECMATCH | CacheableLockManager.SEARCH_CLOSEDPARENT);
if (lData != null)
{
if (lData.getNodeIdentifier().equals(node.getIdentifier()))
@@ -208,11 +206,9 @@
/**
* {@inheritDoc}
*/
- protected boolean isPersitedLockHolder(NodeImpl node) throws RepositoryException
+ protected boolean isPersistedLockHolder(NodeData node) throws RepositoryException
{
- //TODO optimise it
- LockData lData = lockManager.getExactNodeOrCloseParentLock((NodeData)node.getData());
-
+ LockData lData = lockManager.getExactNodeOrCloseParentLock(node);
return lData != null && isLockHolder(lData);
}
@@ -286,7 +282,7 @@
*/
private boolean isLockHolder(LockData lockData)
{
- return (SystemIdentity.SYSTEM.equals(sessionID) || tokens.containsValue(lockData.getTokenHash()));
+ return tokens.containsValue(lockData.getTokenHash());
}
/**
@@ -366,7 +362,11 @@
*/
public void notifyLockRemoved(String nodeIdentifier)
{
- lockedNodes.remove(nodeIdentifier);
+ LockData removedLockData = lockedNodes.remove(nodeIdentifier);
+ //TODO do we really need remove lock token for removed lockData
+ // also remember, tokens that added on another sessions will not be removed
+ String token = getLockToken(removedLockData.getTokenHash());
+ tokens.remove(token);
}
/**
@@ -380,4 +380,28 @@
lockManager.refreshLockData(newLockData);
}
+ /**
+ * {@inheritDoc}
+ */
+ protected boolean checkPersistedLocks(NodeData node) throws LockException
+ {
+ LockData lData = null;
+ try
+ {
+ lData = lockManager.getExactNodeOrCloseParentLock(node);
+ }
+ catch (RepositoryException e)
+ {
+ throw new LockException(e.getMessage(), e);
+ }
+
+ if (lData == null || (!node.getIdentifier().equals(lData.getNodeIdentifier()) && !lData.isDeep()))
+ {
+ return true;
+ }
+
+ // lock exist, so lets check is current session is LockHolder
+ return isLockHolder(lData);
+ }
+
}
16 years, 3 months