jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1177343 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state: ChangeLog.java ItemState.java SessionItemStateManager.java TransientItemStateManager.java
Date Thu, 29 Sep 2011 15:55:57 GMT
Author: mduerig
Date: Thu Sep 29 15:55:56 2011
New Revision: 1177343

URL: http://svn.apache.org/viewvc?rev=1177343&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
remove unnecessary house keeping

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java?rev=1177343&r1=1177342&r2=1177343&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
Thu Sep 29 15:55:56 2011
@@ -88,10 +88,9 @@ public class ChangeLog {
             }
         };
         
-        Operation[] ops = operations.toArray(new Operation[operations.size()]);
-        for (Operation op : ops) {
-            op.persisted();
-            op.accept(operationVisitor);
+        for (Operation operation : operations) {
+            operation.persisted();
+            operation.accept(operationVisitor);
         }
 
         // process all remaining states that were not covered by the
@@ -205,13 +204,4 @@ public class ChangeLog {
         return affectedStates;
     }
 
-    /**
-     * Reset this change log, removing all members inside the
-     * maps we built.
-     */
-    void reset() {
-        affectedStates.clear();
-        // also clear all operations
-        operations.clear();
-    }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java?rev=1177343&r1=1177342&r2=1177343&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Thu Sep 29 15:55:56 2011
@@ -317,8 +317,6 @@ public abstract class ItemState<ENTRY_TY
     public void invalidate() {
         if (status == Status.EXISTING) {
             setStatus(Status.INVALIDATED);
-        } else {
-            log.debug("Skip invalidation for item {} with status {}", getName(), status);
         }
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java?rev=1177343&r1=1177342&r2=1177343&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
Thu Sep 29 15:55:56 2011
@@ -125,7 +125,6 @@ public class SessionItemStateManager ext
             // only pass change log if there are transient modifications
             workspaceItemStateMgr.execute(changeLog);
             transientStateMgr.dispose();
-            changeLog.reset();
         }
     }
 
@@ -142,7 +141,6 @@ public class SessionItemStateManager ext
             // let change log revert all changes
             changeLog.undo();
             transientStateMgr.dispose();
-            changeLog.reset();
         }
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java?rev=1177343&r1=1177342&r2=1177343&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
Thu Sep 29 15:55:56 2011
@@ -31,7 +31,7 @@ import javax.jcr.ItemExistsException;
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import java.util.ArrayList;
-import java.util.LinkedHashSet;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -54,22 +54,22 @@ public class TransientItemStateManager i
     /**
      * Added states
      */
-    private final Set<ItemState<?>> addedStates = new LinkedHashSet<ItemState<?>>();
+    private final Set<ItemState<?>> addedStates = new HashSet<ItemState<?>>();
 
     /**
      * Modified states
      */
-    private final Set<ItemState<?>> modifiedStates = new LinkedHashSet<ItemState<?>>();
+    private final Set<ItemState<?>> modifiedStates = new HashSet<ItemState<?>>();
 
     /**
      * Removed states
      */
-    private final Set<ItemState<?>> removedStates = new LinkedHashSet<ItemState<?>>();
+    private final Set<ItemState<?>> removedStates = new HashSet<ItemState<?>>();
     
     /**
      * Stale states
      */
-    private final Set<ItemState<?>> staleStates = new LinkedHashSet<ItemState<?>>();
+    private final Set<ItemState<?>> staleStates = new HashSet<ItemState<?>>();
 
     /**
      * Set of operations
@@ -109,10 +109,8 @@ public class TransientItemStateManager i
      * @throws RepositoryException if {@code state} is a new item state.
      */
     ChangeLog getChangeLog(boolean throwOnStale) throws RepositoryException {
-        Set<ItemState<?>> affectedStates = new LinkedHashSet<ItemState<?>>();
+        Set<ItemState<?>> affectedStates = new HashSet<ItemState<?>>();
 
-        // the root entry -> the complete change log can be used for
-        // simplicity. collecting ops, states can be omitted.
         if (throwOnStale && !staleStates.isEmpty()) {
             String msg = "Cannot save changes: States has been modified externally.";
             log.debug(msg);



Mime
View raw message