jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1225042 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit: state/ChangeTree.java state/TransientSpace.java utils/Function1.java
Date Tue, 27 Dec 2011 22:41:35 GMT
Author: mduerig
Date: Tue Dec 27 22:41:35 2011
New Revision: 1225042

URL: http://svn.apache.org/viewvc?rev=1225042&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- refactor

Removed:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/utils/Function1.java
Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java?rev=1225042&r1=1225041&r2=1225042&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
Tue Dec 27 22:41:35 2011
@@ -4,7 +4,6 @@ import org.apache.jackrabbit.Path;
 import org.apache.jackrabbit.json.JsonValue;
 import org.apache.jackrabbit.spi.commons.iterator.Iterators;
 import org.apache.jackrabbit.spi.commons.iterator.Predicate;
-import org.apache.jackrabbit.utils.Function1;
 
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
@@ -59,7 +58,7 @@ import java.util.Map.Entry;
  */
 public class ChangeTree {
     private final NodeDelta root;
-    private final Function1<Path, Boolean> nodeExists;
+    private final Predicate<Path> nodeExists;
 
     /**
      * Create a new change tree rooted at {@code rootPath}.
@@ -67,7 +66,7 @@ public class ChangeTree {
      * @param nodeExists  predicate which determines whether a path exists on the
      *                    persistent layer.
      */
-    public ChangeTree(final Path rootPath, Function1<Path, Boolean> nodeExists) {
+    public ChangeTree(final Path rootPath, Predicate<Path> nodeExists) {
         this.nodeExists = nodeExists;
 
         root = new Existing(null, "") {
@@ -527,7 +526,7 @@ public class ChangeTree {
         public NodeDelta getNode(String name) {
             NodeDelta delta = getChild(name);
             if (delta == null) {
-                return nodeExists.apply(getPath().concat(name))
+                return nodeExists.evaluate(getPath().concat(name))
                         ? new Existing(this, name)
                         : null;
             }

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java?rev=1225042&r1=1225041&r2=1225042&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
Tue Dec 27 22:41:35 2011
@@ -4,9 +4,9 @@ import org.apache.jackrabbit.Path;
 import org.apache.jackrabbit.json.JsonValue;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.api.MicroKernelException;
+import org.apache.jackrabbit.spi.commons.iterator.Predicate;
 import org.apache.jackrabbit.state.ChangeTree.Listener;
 import org.apache.jackrabbit.state.ChangeTree.NodeDelta;
-import org.apache.jackrabbit.utils.Function1;
 
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
@@ -33,9 +33,9 @@ public class TransientSpace {
         this.microkernel = microkernel;
         this.revision = revision;
 
-        changeTree = new ChangeTree(Path.create(workspace), new Function1<Path, Boolean>()
{
+        changeTree = new ChangeTree(Path.create(workspace), new Predicate<Path>() {
             @Override
-            public Boolean apply(Path path) {
+            public boolean evaluate(Path path) {
                 return microkernel.nodeExists(path.getMkPath(), getRevision());
             }
         });



Mime
View raw message