jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1461145 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Tue, 26 Mar 2013 14:16:03 GMT
Author: jukka
Date: Tue Mar 26 14:16:03 2013
New Revision: 1461145

URL: http://svn.apache.org/r1461145
Log:
OAK-702: Optimize access to node type information

Use Trees instead of Nodes when accessing node definitions

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/DefinitionProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/DefinitionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/DefinitionProvider.java?rev=1461145&r1=1461144&r2=1461145&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/DefinitionProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/DefinitionProvider.java
Tue Mar 26 14:16:03 2013
@@ -63,7 +63,7 @@ public interface DefinitionProvider {
      * @throws RepositoryException If another error occurs.
      */
     @Nonnull
-    NodeDefinition getDefinition(Node parent, Node targetNode)
+    NodeDefinition getDefinition(Tree parent, Tree targetNode)
             throws ConstraintViolationException, RepositoryException;
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java?rev=1461145&r1=1461144&r2=1461145&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ReadOnlyNodeTypeManager.java
Tue Mar 26 14:16:03 2013
@@ -394,7 +394,8 @@ public abstract class ReadOnlyNodeTypeMa
     }
 
     @Override
-    public NodeDefinition getDefinition(@Nonnull Node parent, @Nonnull Node targetNode)
+    public NodeDefinition getDefinition(
+            @Nonnull Tree parent, @Nonnull Tree targetNode)
             throws RepositoryException {
         checkNotNull(parent);
         checkNotNull(targetNode);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1461145&r1=1461144&r2=1461145&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue Mar 26 14:16:03 2013
@@ -1099,16 +1099,18 @@ public class NodeImpl<T extends NodeDele
     }
 
     private EffectiveNodeType getEffectiveNodeType() throws RepositoryException {
-        return getEffectiveNodeTypeProvider().getEffectiveNodeType(this);
+        return getEffectiveNodeTypeProvider().getEffectiveNodeType(dlg.getTree());
     }
 
     @Override
     @Nonnull
     public NodeDefinition getDefinition() throws RepositoryException {
-        if (getDepth() == 0) {
+        NodeDelegate parent = dlg.getParent();
+        if (parent == null) {
             return getDefinitionProvider().getRootDefinition();
         } else {
-            return getDefinitionProvider().getDefinition(getParent(), this);
+            return getDefinitionProvider().getDefinition(
+                    parent.getTree(), dlg.getTree());
         }
     }
 
@@ -1485,7 +1487,7 @@ public class NodeImpl<T extends NodeDele
     }
 
     private void autoCreateItems() throws RepositoryException {
-        EffectiveNodeType effective = getEffectiveNodeTypeProvider().getEffectiveNodeType(this);
+        EffectiveNodeType effective = getEffectiveNodeTypeProvider().getEffectiveNodeType(dlg.getTree());
         for (PropertyDefinition pd : effective.getAutoCreatePropertyDefinitions()) {
             if (dlg.getProperty(pd.getName()) == null) {
                 if (pd.isMultiple()) {



Mime
View raw message