jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r750539 - in /jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: state/SharedItemStateManager.java version/VersionItemStateManager.java
Date Thu, 05 Mar 2009 18:30:22 GMT
Author: jukka
Date: Thu Mar  5 18:30:21 2009
New Revision: 750539

URL: http://svn.apache.org/viewvc?rev=750539&view=rev
Log:
1.5: Merged revision 750536 (JCR-2000)

Modified:
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=750539&r1=750538&r2=750539&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
Thu Mar  5 18:30:21 2009
@@ -1327,7 +1327,7 @@
      * Checks if this item state manager has the given item state without
      * considering the virtual item state managers.
      */
-    private boolean hasNonVirtualItemState(ItemId id) {
+    protected boolean hasNonVirtualItemState(ItemId id) {
         if (cache.isCached(id)) {
             return true;
         }

Modified: jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java?rev=750539&r1=750538&r2=750539&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
Thu Mar  5 18:30:21 2009
@@ -28,7 +28,9 @@
 import org.apache.jackrabbit.core.state.ISMLocking;
 import org.apache.jackrabbit.core.state.ItemStateCacheFactory;
 import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
+import org.apache.jackrabbit.core.state.NodeReferencesId;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -59,6 +61,30 @@
         this.pMgr = persistMgr;
     }
 
+    public NodeReferences getNodeReferences(NodeReferencesId id)
+            throws NoSuchItemStateException, ItemStateException {
+        // check persistence manager
+        try {
+            return pMgr.load(id);
+        } catch (NoSuchItemStateException e) {
+            // ignore
+        }
+        // throw
+        throw new NoSuchItemStateException(id.toString());
+    }
+
+    public boolean hasNodeReferences(NodeReferencesId id) {
+        // check persistence manager
+        try {
+            if (pMgr.exists(id)) {
+                return true;
+            }
+        } catch (ItemStateException e) {
+            // ignore
+        }
+        return false;
+    }
+
     /**
      * Sets the
      * @param references
@@ -76,7 +102,7 @@
                 Iterator iter = source.getReferences().iterator();
                 while (iter.hasNext()) {
                     PropertyId id = (PropertyId) iter.next();
-                    if (!hasItemState(id.getParentId())) {
+                    if (!hasNonVirtualItemState(id.getParentId())) {
                         target.addReference(id);
                     }
                 }
@@ -103,7 +129,7 @@
             NodeId id = refs.getTargetId();
             // no need to check existence of target if there are no references
             if (refs.hasReferences()) {
-                if (!changes.has(id) && !hasItemState(id)) {
+                if (!changes.has(id) && !hasNonVirtualItemState(id)) {
                     // remove references
                     iter.remove();
                 }



Mime
View raw message