jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1065610 - in /jackrabbit/branches/2.2: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/
Date Mon, 31 Jan 2011 13:38:16 GMT
Author: jukka
Date: Mon Jan 31 13:38:15 2011
New Revision: 1065610

URL: http://svn.apache.org/viewvc?rev=1065610&view=rev
Log:
2.2: Merged revision 1065599 (JCR-2865)

Added:
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersioningLock.java
      - copied unchanged from r1065599, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersioningLock.java
Modified:
    jackrabbit/branches/2.2/   (props changed)
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
    jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImplBase.java

Propchange: jackrabbit/branches/2.2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 31 13:38:15 2011
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430,1043554,1043616,1043618,1043637,1043656,1044312,1049473,1049491,1049520,1050346,1050551,1055068,1055070-1055071,1055116-1055117,1055127,1055134,1055164,1055498,1060431,1060434,1060753,1063756
+/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090,1040459,1040601,1040606,1040661,1040958,1041379,1041439,1041761,1042643,1042647,1042978-1042982,1043084-1043086,1043088,1043343,1043357-1043358,1043430,1043554,1043616,1043618,1043637,1043656,1044312,1049473,1049491,1049520,1050346,1050551,1055068,1055070-1055071,1055116-1055117,1055127,1055134,1055164,1055498,1060431,1060434,1060753,1063756,1065599

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java?rev=1065610&r1=1065609&r2=1065610&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
Mon Jan 31 13:38:15 2011
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.version;
 
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
-import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.spi.Name;
@@ -146,7 +145,7 @@ class InternalVersionImpl extends Intern
      * {@inheritDoc}
      */
     public List<InternalVersion> getSuccessors() {
-        ReadLock lock = vMgr.acquireReadLock();
+        VersioningLock.ReadLock lock = vMgr.acquireReadLock();
         try {
             InternalValue[] values =
                 node.getPropertyValues(NameConstants.JCR_SUCCESSORS);

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java?rev=1065610&r1=1065609&r2=1065610&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java
Mon Jan 31 13:38:15 2011
@@ -30,9 +30,6 @@ import javax.jcr.version.VersionExceptio
 
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
-import org.apache.jackrabbit.core.state.DefaultISMLocking;
-import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
-import org.apache.jackrabbit.core.state.ISMLocking.WriteLock;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.NodeReferences;
@@ -74,7 +71,7 @@ abstract class InternalVersionManagerBas
     /**
      * the lock on this version manager
      */
-    private final DefaultISMLocking rwLock = new DefaultISMLocking();
+    private final VersioningLock rwLock = new VersioningLock();
 
     protected InternalVersionManagerBase(NodeTypeRegistry ntReg,
                                          NodeId historiesId,
@@ -139,7 +136,7 @@ abstract class InternalVersionManagerBas
      */
     public InternalVersionHistory getVersionHistoryOfNode(NodeId id)
             throws RepositoryException {
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             String uuid = id.toString();
             Name name = getName(uuid);
@@ -176,10 +173,10 @@ abstract class InternalVersionManagerBas
      * Acquires the write lock on this version manager.
      * @return returns the write lock
      */
-    protected WriteLock acquireWriteLock() {
+    protected VersioningLock.WriteLock acquireWriteLock() {
         while (true) {
             try {
-                return rwLock.acquireWriteLock(null);
+                return rwLock.acquireWriteLock();
             } catch (InterruptedException e) {
                 // ignore
             }
@@ -190,10 +187,10 @@ abstract class InternalVersionManagerBas
      * acquires the read lock on this version manager.
      * @return returns the read lock
      */
-    protected ReadLock acquireReadLock() {
+    protected VersioningLock.ReadLock acquireReadLock() {
         while (true) {
             try {
-                return rwLock.acquireReadLock(null);
+                return rwLock.acquireReadLock();
             } catch (InterruptedException e) {
                 // ignore
             }
@@ -225,9 +222,9 @@ abstract class InternalVersionManagerBas
          */
         private boolean success = false;
 
-        private final WriteLock lock;
+        private final VersioningLock.WriteLock lock;
 
-        public WriteOperation(WriteLock lock) {
+        public WriteOperation(VersioningLock.WriteLock lock) {
             this.lock = lock;
         }
 
@@ -283,7 +280,7 @@ abstract class InternalVersionManagerBas
      */
     private WriteOperation startWriteOperation() throws RepositoryException {
         boolean success = false;
-        WriteLock lock = acquireWriteLock();
+        VersioningLock.WriteLock lock = acquireWriteLock();
         try {
             stateMgr.edit();
             success = true;
@@ -305,7 +302,7 @@ abstract class InternalVersionManagerBas
             throws RepositoryException {
         VersionHistoryInfo info = null;
 
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             String uuid = node.getNodeId().toString();
             Name name = getName(uuid);

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java?rev=1065610&r1=1065609&r2=1065610&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
Mon Jan 31 13:38:15 2011
@@ -44,7 +44,6 @@ import org.apache.jackrabbit.core.observ
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
 import org.apache.jackrabbit.core.state.ChangeLog;
 import org.apache.jackrabbit.core.state.ISMLocking;
-import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
 import org.apache.jackrabbit.core.state.ItemState;
 import org.apache.jackrabbit.core.state.ItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.ItemStateException;
@@ -301,7 +300,7 @@ public class InternalVersionManagerImpl 
      * {@inheritDoc}
      */
     public boolean hasItem(NodeId id) {
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             return stateMgr.hasItemState(id);
         } finally {
@@ -321,7 +320,7 @@ public class InternalVersionManagerImpl 
         if (id.equals(activitiesId)) {
             return null;
         }
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             synchronized (versionItems) {
                 InternalVersionItem item = versionItems.get(id);
@@ -464,7 +463,7 @@ public class InternalVersionManagerImpl 
      * @param items items updated
      */
     public void itemsUpdated(Collection<InternalVersionItem> items) {
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             synchronized (versionItems) {
                 for (InternalVersionItem item : items) {
@@ -502,7 +501,7 @@ public class InternalVersionManagerImpl 
      */
     protected void itemDiscarded(InternalVersionItem item) {
         // evict removed item from cache
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             versionItems.remove(item.getId());
         } finally {
@@ -600,7 +599,7 @@ public class InternalVersionManagerImpl 
      */
     public void stateDestroyed(ItemState destroyed) {
         // evict removed item from cache
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             versionItems.remove(destroyed.getId());
         } finally {

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java?rev=1065610&r1=1065609&r2=1065610&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalXAVersionManager.java
Mon Jan 31 13:38:15 2011
@@ -34,8 +34,6 @@ import org.apache.jackrabbit.core.nodety
 import org.apache.jackrabbit.core.observation.EventStateCollection;
 import org.apache.jackrabbit.core.observation.EventStateCollectionFactory;
 import org.apache.jackrabbit.core.state.ChangeLog;
-import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
-import org.apache.jackrabbit.core.state.ISMLocking.WriteLock;
 import org.apache.jackrabbit.core.state.ItemState;
 import org.apache.jackrabbit.core.state.ItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.ItemStateException;
@@ -91,7 +89,7 @@ public class InternalXAVersionManager ex
     /**
      * The global write lock on the version manager.
      */
-    private WriteLock vmgrLock;
+    private VersioningLock.WriteLock vmgrLock;
 
     /**
      * Persistent root node of the version histories.
@@ -718,7 +716,7 @@ public class InternalXAVersionManager ex
      */
     private InternalVersionHistoryImpl makeLocalCopy(InternalVersionHistoryImpl history)
             throws RepositoryException {
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             NodeState state = (NodeState) stateMgr.getItemState(history.getId());
             NodeStateEx stateEx = new NodeStateEx(stateMgr, ntReg, state, null);
@@ -740,7 +738,7 @@ public class InternalXAVersionManager ex
      */
     private InternalActivityImpl makeLocalCopy(InternalActivityImpl act)
             throws RepositoryException {
-        ReadLock lock = acquireReadLock();
+        VersioningLock.ReadLock lock = acquireReadLock();
         try {
             NodeState state = (NodeState) stateMgr.getItemState(act.getId());
             NodeStateEx stateEx = new NodeStateEx(stateMgr, ntReg, state, null);

Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImplBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImplBase.java?rev=1065610&r1=1065609&r2=1065610&view=diff
==============================================================================
--- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImplBase.java
(original)
+++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImplBase.java
Mon Jan 31 13:38:15 2011
@@ -35,8 +35,6 @@ import org.apache.jackrabbit.core.value.
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.session.SessionContext;
-import org.apache.jackrabbit.core.state.DefaultISMLocking;
-import org.apache.jackrabbit.core.state.ISMLocking;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.UpdatableItemStateManager;
@@ -93,7 +91,7 @@ abstract public class VersionManagerImpl
     /**
      * the lock on this version manager
      */
-    private final DefaultISMLocking rwLock = new DefaultISMLocking();
+    private final VersioningLock rwLock = new VersioningLock();
 
     /**
      * the node id of the current activity
@@ -455,9 +453,9 @@ abstract public class VersionManagerImpl
          */
         private boolean success = false;
 
-        private final ISMLocking.WriteLock lock;
+        private final VersioningLock.WriteLock lock;
 
-        public WriteOperation(ISMLocking.WriteLock lock) {
+        public WriteOperation(VersioningLock.WriteLock lock) {
             this.lock = lock;
         }
 
@@ -493,10 +491,10 @@ abstract public class VersionManagerImpl
      * Acquires the write lock on this version manager.
      * @return returns the write lock
      */
-    protected ISMLocking.WriteLock acquireWriteLock() {
+    protected VersioningLock.WriteLock acquireWriteLock() {
         while (true) {
             try {
-                return rwLock.acquireWriteLock(null);
+                return rwLock.acquireWriteLock();
             } catch (InterruptedException e) {
                 // ignore
             }
@@ -507,10 +505,10 @@ abstract public class VersionManagerImpl
      * acquires the read lock on this version manager.
      * @return returns the read lock
      */
-    protected ISMLocking.ReadLock acquireReadLock() {
+    protected VersioningLock.ReadLock acquireReadLock() {
         while (true) {
             try {
-                return rwLock.acquireReadLock(null);
+                return rwLock.acquireReadLock();
             } catch (InterruptedException e) {
                 // ignore
             }
@@ -542,7 +540,7 @@ abstract public class VersionManagerImpl
      */
     public WriteOperation startWriteOperation() throws RepositoryException {
         boolean success = false;
-        ISMLocking.WriteLock lock = acquireWriteLock();
+        VersioningLock.WriteLock lock = acquireWriteLock();
         try {
             stateMgr.edit();
             success = true;



Mime
View raw message