jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1213894 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy: ChildNodeEntries.java NodeEntry.java
Date Tue, 13 Dec 2011 19:42:02 GMT
Author: mduerig
Date: Tue Dec 13 19:42:02 2011
New Revision: 1213894

URL: http://svn.apache.org/viewvc?rev=1213894&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
- simplify

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java?rev=1213894&r1=1213893&r2=1213894&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
Tue Dec 13 19:42:02 2011
@@ -20,7 +20,6 @@ import org.apache.jackrabbit.jcr2spi.sta
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
-import org.apache.jackrabbit.spi.Path;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,38 +46,15 @@ final class ChildNodeEntries {
     private final EntryFactory factory;
 
      /**
-      * Create a new {@code ChildNodeEntries} collection from the given
-      * {@code childNodeInfos} instead of retrieving them from the
-      * persistent layer.
+      * Create a new {@code ChildNodeEntries} collection.
       *
       * @param parent
       * @param factory
-      * @param childNodeInfos The complete list of child infos or
-      * {@code null} if an 'empty' ChildNodeEntries should be created.
-      * In the latter case, individual child entries will be added on demand
-      * and the complete list will be retrieved only to answer {@link #iterator()}
-      * if the passed boolean is {@code true}.
       */
-     ChildNodeEntries(NodeEntry parent, EntryFactory factory, Iterator<ChildInfo> childNodeInfos)
{
+     ChildNodeEntries(NodeEntry parent, EntryFactory factory) {
          this.parent = parent;
          this.factory = factory;
-
-         if (childNodeInfos != null) {
-             while (childNodeInfos.hasNext()) {
-                 ChildInfo ci = childNodeInfos.next();
-                 if (ci.getIndex() > Path.INDEX_DEFAULT) {
-                     IllegalArgumentException e = new IllegalArgumentException("Invalid index:
" + ci.getIndex());
-                     log.error(e.getMessage(), e);
-                     throw e;
-                 }
-                 NodeEntry entry = factory.createNodeEntry(parent, ci.getName(), ci.getUniqueID());
-                 add(entry);
-             }
-             complete = true;
-         }
-         else {
-             complete = false;
-         }
+         complete = false;
      }
 
     /**
@@ -127,7 +103,7 @@ final class ChildNodeEntries {
     synchronized void update(Iterator<ChildInfo> childNodeInfos) {
         while (childNodeInfos.hasNext()) {
             ChildInfo info = childNodeInfos.next();
-            if (entries.get(info.getName()) == null) {
+            if (get(info.getName()) == null) {
                 // add missing entry
                 NodeEntry entry = factory.createNodeEntry(parent, info.getName(), info.getUniqueID());
                 add(entry);
@@ -168,7 +144,7 @@ final class ChildNodeEntries {
             throw e;
         }
 
-        NodeEntry nodeEntry = entries.get(nodeName);
+        NodeEntry nodeEntry = get(nodeName);
         return nodeEntry != null && uniqueID.equals(nodeEntry.getUniqueID())
             ? nodeEntry
             : null;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java?rev=1213894&r1=1213893&r2=1213894&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
Tue Dec 13 19:42:02 2011
@@ -171,7 +171,7 @@ public class NodeEntry extends Hierarchy
         this.uniqueID = uniqueID; 
 
         properties = new ChildPropertyEntries();
-        childNodeEntries = new ChildNodeEntries(this, factory, null);
+        childNodeEntries = new ChildNodeEntries(this, factory);
 
         propertiesInAttic = new HashMap<Name, PropertyEntry>();
         childNodeAttic = new ChildNodeAttic();



Mime
View raw message