jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1235743 - in /jackrabbit/branches/2.4: ./ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Date Wed, 25 Jan 2012 13:45:46 GMT
Author: jukka
Date: Wed Jan 25 13:45:46 2012
New Revision: 1235743

URL: http://svn.apache.org/viewvc?rev=1235743&view=rev
Log:
2.4: Merged revision 1235423 (JCR-3220)

Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 25 13:45:46 2012
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1231204,1232035,1232100,1232404,1232831,1232920,1232922,1233069,1233344,1233446,1233468,1233471,1234807,1235192
+/jackrabbit/trunk:1221447,1221579,1221593,1221789,1221818,1225179,1225191,1225196,1225207,1225525,1225528,1226452,1226472,1226515,1226750,1226863,1227171,1227240,1227590,1227593,1227615,1228058,1228149,1228155,1228160,1230507,1230681,1230688,1231204,1232035,1232100,1232404,1232831,1232920,1232922,1233069,1233344,1233446,1233468,1233471,1234807,1235192,1235423

Modified: jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java?rev=1235743&r1=1235742&r2=1235743&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/DavResourceImpl.java
Wed Jan 25 13:45:46 2012
@@ -569,7 +569,7 @@ public class DavResourceImpl implements 
 
             // make sure, non-jcr locks are removed, once the removal is completed
             try {
-                if (!isJsrLockable()) {
+                if (!isJcrLockable()) {
                     ActiveLock lock = getLock(Type.WRITE, Scope.EXCLUSIVE);
                     if (lock != null) {
                         lockManager.releaseLock(lock.getToken(), member);
@@ -683,10 +683,17 @@ public class DavResourceImpl implements 
         ActiveLock lock = null;
         if (isLockable(lockInfo.getType(), lockInfo.getScope())) {
             // TODO: deal with existing locks, that may have been created, before the node
was jcr-lockable...
-            if (isJsrLockable()) {
+            if (isJcrLockable()) {
                 try {
+                    javax.jcr.lock.LockManager lockMgr = node.getSession().getWorkspace().getLockManager();
+                    long timeout = lockInfo.getTimeout();
+                    if (timeout == LockInfo.INFINITE_TIMEOUT) {
+                        timeout = Long.MAX_VALUE;
+                    } else {
+                        timeout = timeout / 1000;
+                    }
                     // try to execute the lock operation
-                    Lock jcrLock = node.lock(lockInfo.isDeep(), false);
+                    Lock jcrLock = lockMgr.lock(node.getPath(), lockInfo.isDeep(), false,
timeout, lockInfo.getOwner());
                     if (jcrLock != null) {
                         lock = new JcrActiveLock(jcrLock);
                     }
@@ -922,7 +929,7 @@ public class DavResourceImpl implements 
      *
      * @return true if this resource is lockable.
      */
-    private boolean isJsrLockable() {
+    private boolean isJcrLockable() {
         boolean lockable = false;
         if (exists()) {
             try {



Mime
View raw message