jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1299629 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit: SessionImpl.java state/TransientNodeState.java
Date Mon, 12 Mar 2012 11:19:02 GMT
Author: mduerig
Date: Mon Mar 12 11:19:02 2012
New Revision: 1299629

URL: http://svn.apache.org/viewvc?rev=1299629&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- evict removed node states from cache 

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/SessionImpl.java?rev=1299629&r1=1299628&r2=1299629&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/SessionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/SessionImpl.java
Mon Mar 12 11:19:02 2012
@@ -139,18 +139,16 @@ public class SessionImpl implements Sess
     };
 
     public TransientNodeState getNodeState(Path path) {
-        NodeDelta delta = transientSpace.getNodeDelta(path);
-        if (delta == null) {
-            return null;
-        }
-        else {
-            TransientNodeState state = nodeStateCache.get(path);
-            if (state == null) {
-                state = new TransientNodeState(sessionContext, delta);
-                nodeStateCache.put(path, state);
+        TransientNodeState state = nodeStateCache.get(path);
+        if (state == null) {
+            NodeDelta delta = transientSpace.getNodeDelta(path);
+            if (delta == null) {
+                return null;
             }
-            return state;
+            state = new TransientNodeState(sessionContext, delta);
+            nodeStateCache.put(path, state);
         }
+        return state;
     }
 
     private SessionImpl(GlobalContext globalContext, CredentialsInfo credentialsInfo, String
workspaceName,

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java?rev=1299629&r1=1299628&r2=1299629&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientNodeState.java
Mon Mar 12 11:19:02 2012
@@ -83,6 +83,7 @@ public class TransientNodeState {
     }
 
     public void remove() throws ItemNotFoundException {
+        nodeStateCache().remove(getPath());
         getNodeDelta().getParent().removeNode(getName());
     }
 



Mime
View raw message