jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r995412 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state: ISMLocking.java SharedItemStateManager.java
Date Thu, 09 Sep 2010 13:04:32 GMT
Author: jukka
Date: Thu Sep  9 13:04:31 2010
New Revision: 995412

URL: http://svn.apache.org/viewvc?rev=995412&view=rev
Log:
JCR-2089: Use java.util.concurrent

After the refactoring of DefaultISMLocking it's no longer possible (even in theory) for WriteLock.downgrade()
to throw InterruptedExceptions, so we can safely remove the throws declaration.

There should never be a reason for downgrade() to block, so the method should not be declared
to throw InterruptedExceptions.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java?rev=995412&r1=995411&r2=995412&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java
Thu Sep  9 13:04:31 2010
@@ -81,10 +81,8 @@ public interface ISMLocking {
          * used to further release the read lock.
          *
          * @return the read lock downgraded from this write lock.
-         * @throws InterruptedException if the current thread is interrupted
-         *                              while downgrading the write lock.
          */
-        ReadLock downgrade() throws InterruptedException;
+        ReadLock downgrade();
 
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=995412&r1=995411&r2=995412&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Thu Sep  9 13:04:31 2010
@@ -787,9 +787,6 @@ public class SharedItemStateManager
                     String path = events.getSession().getUserID() + "@" + events.getCommonPath();
                     eventChannel.updateCommitted(this, path);
                 }
-
-            } catch (InterruptedException e) {
-                throw new ItemStateException("Interrupted while downgrading to read lock");
             } finally {
                 if (writeLock != null) {
                     // exception occurred before downgrading lock
@@ -1512,9 +1509,6 @@ public class SharedItemStateManager
                 holdingWriteLock = false;
                 events.dispatch();
             }
-        } catch (InterruptedException e) {
-            String msg = "Unable to downgrade to read lock.";
-            log.error(msg);
         } finally {
             if (holdingWriteLock) {
                 if (wLock != null) {



Mime
View raw message