jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1170170 - in /jackrabbit/sandbox/jackrabbit-mk: jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2sp...
Date Tue, 13 Sep 2011 13:19:27 GMT
Author: mduerig
Date: Tue Sep 13 13:19:26 2011
New Revision: 1170170

URL: http://svn.apache.org/viewvc?rev=1170170&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
refactor: consolidate ManagerProvider

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/AbstractValueFactory.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NamespaceRegistryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/AbstractValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/AbstractValueFactory.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/AbstractValueFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/AbstractValueFactory.java
Tue Sep 13 13:19:26 2011
@@ -96,8 +96,7 @@ public abstract class AbstractValueFacto
         return new StringValue(value);
     }
 
-    public Value createValue(String value, int type)
-            throws ValueFormatException {
+    public Value createValue(String value, int type) throws ValueFormatException {
         Value val;
         switch (type) {
             case PropertyType.STRING:

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
Tue Sep 13 13:19:26 2011
@@ -23,9 +23,9 @@ import org.apache.jackrabbit.jcr2spi.nod
 import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeDefinitionProvider;
 import org.apache.jackrabbit.jcr2spi.security.AccessManager;
 import org.apache.jackrabbit.jcr2spi.version.VersionManager;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -38,8 +38,6 @@ public interface ManagerProvider {
 
     NamePathResolver getNamePathResolver();
 
-    NamespaceResolver getNamespaceResolver();
-
     HierarchyManager getHierarchyManager();
 
     AccessManager getAccessManager();
@@ -62,6 +60,10 @@ public interface ManagerProvider {
      */
     VersionManager getVersionStateManager();
 
+    WorkspaceManager getWorkspaceManager();
+
+    ItemManager getItemManager();
+
     ItemDefinitionProvider getItemDefinitionProvider();
 
     NodeTypeDefinitionProvider getNodeTypeDefinitionProvider();
@@ -80,4 +82,6 @@ public interface ManagerProvider {
     ValueFactory getJcrValueFactory() throws RepositoryException;
 
     QValueFactory getQValueFactory() throws RepositoryException;
+
+    PathFactory getPathFactory();
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NamespaceRegistryImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NamespaceRegistryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NamespaceRegistryImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,15 +16,13 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import java.util.Collection;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.NamespaceRegistry;
 import javax.jcr.NamespaceException;
-import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
+import java.util.Collection;
 
 /**
  * {@code NamespaceRegistryImpl} implements the JCR client facing
@@ -73,8 +71,8 @@ public class NamespaceRegistryImpl imple
         // try to load the uri
         try {
             return storage.getURI(prefix);
-        } catch (RepositoryException ex) {
-            log.debug("Internal error while loading registered namespaces.");
+        } catch (RepositoryException e) {
+            log.debug("Internal error while loading registered namespaces.", e);
             throw new NamespaceException(prefix + ": is not a registered namespace prefix.");
         }
     }
@@ -84,8 +82,8 @@ public class NamespaceRegistryImpl imple
         // try to load the prefix
         try {
             return storage.getPrefix(uri);
-        } catch (RepositoryException ex) {
-            log.debug("Internal error while loading registered namespaces.");
+        } catch (RepositoryException e) {
+            log.debug("Internal error while loading registered namespaces.", e);
             throw new NamespaceException(uri + ": is not a registered namespace uri.");
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
Tue Sep 13 13:19:26 2011
@@ -55,7 +55,6 @@ public class PropertyImpl extends ItemIm
 
     public PropertyImpl(SessionImpl session, PropertyState state, ItemLifeCycleListener listener)
{
         super(session, state, listener);
-        // NOTE: JCR value(s) will be read (and converted from the internal value representation)
on demand.
     }
 
     //-----------------------------------------------------< Item interface >---

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
Tue Sep 13 13:19:26 2011
@@ -34,7 +34,6 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.Value;
-import javax.jcr.ValueFactory;
 import javax.naming.Context;
 import javax.naming.Name;
 import javax.naming.NamingException;
@@ -65,7 +64,6 @@ public class RepositoryImpl extends Abst
 
         // dummy value factory and dummy resolver as descriptors are not
         // expected to contain Name or Path values.
-        ValueFactory vf = ValueFactoryImpl.getInstance(); 
         NamePathResolver resolver = new DefaultNamePathResolver(new NamespaceResolver() {
             @Override
             public String getURI(String prefix) {
@@ -84,7 +82,7 @@ public class RepositoryImpl extends Abst
             QValue[] qvs = stringEntry.getValue();
             Value[] vs = new Value[qvs.length];
             for (int i = 0; i < qvs.length; i++) {
-                vs[i] = ValueFormat.getJCRValue(qvs[i], resolver, vf);
+                vs[i] = ValueFormat.getJCRValue(qvs[i], resolver, ValueFactoryImpl.getInstance());
             }
             this.descriptors.put(stringEntry.getKey(), vs);
         }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
Tue Sep 13 13:19:26 2011
@@ -142,7 +142,7 @@ public class SessionImpl extends Abstrac
 
         // build nodetype manager
         ntManager = new NodeTypeManagerImpl(workspace.getNodeTypeRegistry(), this);
-        validator = new ItemStateValidator(this, getPathFactory());
+        validator = new ItemStateValidator(this);
 
         itemStateManager = new SessionItemStateManager(workspace.getUpdateableItemStateManager(),
getValidator(),
                 getQValueFactory(), workspace.getItemStateFactory(), this);
@@ -385,7 +385,7 @@ public class SessionImpl extends Abstrac
         // NOTE: check if path corresponds to Node and is writable is performed
         // within the SessionImporter.
         Importer importer = new SessionImporter(parentPath, this, itemStateManager, uuidBehavior);
-        return new ImportHandler(importer, getNamespaceResolver(), workspace.getNamespaceRegistry(),
getNameFactory(),
+        return new ImportHandler(importer, this, workspace.getNamespaceRegistry(), getNameFactory(),
                 getPathFactory());
     }
 
@@ -709,11 +709,6 @@ public class SessionImpl extends Abstrac
     }
 
     @Override
-    public NamespaceResolver getNamespaceResolver() {
-        return this;
-    }
-
-    @Override
     public final HierarchyManager getHierarchyManager() {
         return workspace.getHierarchyManager();
     }
@@ -734,6 +729,16 @@ public class SessionImpl extends Abstrac
     }
 
     @Override
+    public WorkspaceManager getWorkspaceManager() {
+        return workspace.getWorkspaceManager();
+    }
+
+    @Override
+    public ItemManager getItemManager() {
+        return itemManager;
+    }
+
+    @Override
     public ItemDefinitionProvider getItemDefinitionProvider() {
         return workspace.getItemDefinitionProvider();
     }
@@ -758,12 +763,13 @@ public class SessionImpl extends Abstrac
         return valueFactory;
     }
 
-    //--------------------------------------------------------------------------
-
-    final ItemManager getItemManager() {
-        return itemManager;
+    @Override
+    public PathFactory getPathFactory() {
+        return workspace.getPathFactory();
     }
 
+    //--------------------------------------------------------------------------
+
     // TODO public for SessionImport only. review
     public final ItemStateValidator getValidator() {
         return validator;
@@ -778,10 +784,6 @@ public class SessionImpl extends Abstrac
         return workspace.getNameFactory();
     }
 
-    final PathFactory getPathFactory() {
-        return workspace.getPathFactory();
-    }
-
     /**
      * Returns the {@code ItemStateManager} associated with this session.
      *

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
Tue Sep 13 13:19:26 2011
@@ -47,7 +47,6 @@ import org.apache.jackrabbit.spi.PathFac
 import org.apache.jackrabbit.spi.QValueFactory;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
@@ -126,7 +125,7 @@ public class WorkspaceImpl implements Wo
         Path srcPath = session.getQPath(srcAbsPath);
         Path destPath = session.getQPath(destAbsPath);
 
-        Operation op = Copy.create(srcPath, destPath, getName(), this, this);
+        Operation op = Copy.create(srcPath, destPath, getName(), getHierarchyManager(), getHierarchyManager());
         getUpdateableItemStateManager().execute(op);
     }
 
@@ -158,7 +157,9 @@ public class WorkspaceImpl implements Wo
             WorkspaceImpl srcWsp = (WorkspaceImpl) srcSession.getWorkspace();
 
             // do cross-workspace copy
-            Operation op = Copy.create(srcPath, destPath, srcWsp.getName(), srcWsp, this);
+            Operation op = Copy.create(srcPath, destPath, srcWsp.getName(), srcWsp.getHierarchyManager(),
+                    getHierarchyManager());
+            
             getUpdateableItemStateManager().execute(op);
         } finally {
             if (srcSession != null) {
@@ -200,7 +201,9 @@ public class WorkspaceImpl implements Wo
             WorkspaceImpl srcWsp = (WorkspaceImpl) srcSession.getWorkspace();
 
             // do clone
-            Operation op = Clone.create(srcPath, destPath, srcWsp.getName(), removeExisting,
srcWsp, this);
+            Operation op = Clone.create(srcPath, destPath, srcWsp.getName(), removeExisting,
+                    srcWsp.getHierarchyManager(), getHierarchyManager());
+            
             getUpdateableItemStateManager().execute(op);
         } finally {
             if (srcSession != null) {
@@ -231,8 +234,7 @@ public class WorkspaceImpl implements Wo
     public QueryManager getQueryManager() throws RepositoryException {
         session.checkIsAlive();
         if (qManager == null) {
-            qManager = new QueryManagerImpl(session, session,
-                    session.getItemManager(), wspManager);
+            qManager = new QueryManagerImpl(session, session);
         }
         return qManager;
     }
@@ -354,11 +356,6 @@ public class WorkspaceImpl implements Wo
     }
 
     @Override
-    public NamespaceResolver getNamespaceResolver() {
-        return session.getNamespaceResolver();
-    }
-
-    @Override
     public HierarchyManager getHierarchyManager() {
         return wspManager.getHierarchyManager();
     }
@@ -385,6 +382,16 @@ public class WorkspaceImpl implements Wo
     }
 
     @Override
+    public WorkspaceManager getWorkspaceManager() {
+        return wspManager;
+    }
+
+    @Override
+    public ItemManager getItemManager() {
+        return session.getItemManager();
+    }
+
+    @Override
     public ItemDefinitionProvider getItemDefinitionProvider() {
         return wspManager.getItemDefinitionProvider();
     }
@@ -409,6 +416,11 @@ public class WorkspaceImpl implements Wo
         return session.getQValueFactory();
     }
 
+    @Override
+    public PathFactory getPathFactory() {
+        return wspManager.getPathFactory();
+    }
+
     //------------------------------------< implementation specific methods >---
 
     void dispose() {
@@ -419,10 +431,6 @@ public class WorkspaceImpl implements Wo
         return wspManager.getNameFactory();
     }
 
-    PathFactory getPathFactory() {
-        return wspManager.getPathFactory();
-    }
-
     IdFactory getIdFactory() {
         return wspManager.getIdFactory();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,27 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.nodetype;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.NamespaceException;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.ValueFactory;
-import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.nodetype.NodeDefinition;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.NodeTypeDefinition;
-import javax.jcr.nodetype.NodeTypeExistsException;
-import javax.jcr.nodetype.NodeTypeIterator;
-import javax.jcr.nodetype.NodeTypeManager;
-import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.version.OnParentVersionAction;
-
 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.jackrabbit.commons.iterator.NodeTypeIteratorAdapter;
 import org.apache.jackrabbit.jcr2spi.ManagerProvider;
@@ -53,6 +32,26 @@ import org.apache.jackrabbit.spi.commons
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.jcr.NamespaceException;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeDefinition;
+import javax.jcr.nodetype.NodeTypeExistsException;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.version.OnParentVersionAction;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import static org.apache.jackrabbit.spi.commons.util.Unchecked.cast;
 
 /**
@@ -107,8 +106,7 @@ public class NodeTypeManagerImpl extends
      * @param mgrProvider  the manager provider
      * @throws RepositoryException If an error occurs.
      */
-    public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
-                               ManagerProvider mgrProvider) throws RepositoryException {
+    public NodeTypeManagerImpl(NodeTypeRegistry ntReg, ManagerProvider mgrProvider) throws
RepositoryException {
         this.mgrProvider = mgrProvider;
         this.ntReg = ntReg;
         this.ntReg.addListener(this);

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
Tue Sep 13 13:19:26 2011
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.NodeId;
@@ -41,13 +41,12 @@ public abstract class AbstractCopy exten
      *
      * @param srcPath
      * @param destPath
-     * @param srcMgrProvider
      */
-    AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, ManagerProvider srcMgrProvider,
-            ManagerProvider destMgrProvider) throws RepositoryException {
+    AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, HierarchyManager srcHierarchyManager,
+            HierarchyManager destHierarchyManager) throws RepositoryException {
 
-        srcState = getNodeState(srcPath, srcMgrProvider.getHierarchyManager());
-        destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager());
+        srcState = getNodeState(srcPath, srcHierarchyManager);
+        destParentState = getNodeState(destPath.getAncestor(1), destHierarchyManager);
 
         // check for illegal index present in destination path
         int index = destPath.getIndex();

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
Tue Sep 13 13:19:26 2011
@@ -16,20 +16,11 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import javax.jcr.AccessDeniedException;
-import javax.jcr.ItemExistsException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.RepositoryException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.version.VersionException;
-
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
+import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.spi.Path;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import javax.jcr.RepositoryException;
 
 /**
  * {@code Clone}...
@@ -38,10 +29,10 @@ public class Clone extends AbstractCopy 
     private final boolean removeExisting;
 
     private Clone(Path srcPath, Path destPath, String srcWorkspaceName, boolean removeExisting,
-            ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider)
+            HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager)
 
         throws RepositoryException {
-        super(srcPath, destPath, srcWorkspaceName, srcMgrProvider, destMgrProvider);
+        super(srcPath, destPath, srcWorkspaceName, srcHierarchyManager, destHierarchyManager);
 
         this.removeExisting = removeExisting;
     }
@@ -87,8 +78,8 @@ public class Clone extends AbstractCopy 
     
 
     public static Operation create(Path srcPath, Path destPath, String srcWorkspaceName,
boolean removeExisting,
-        ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider) throws RepositoryException
{
+        HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager) throws
RepositoryException {
 
-        return new Clone(srcPath, destPath, srcWorkspaceName, removeExisting, srcMgrProvider,
destMgrProvider);
+        return new Clone(srcPath, destPath, srcWorkspaceName, removeExisting, srcHierarchyManager,
destHierarchyManager);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
Tue Sep 13 13:19:26 2011
@@ -16,17 +16,10 @@
  */
 package org.apache.jackrabbit.jcr2spi.operation;
 
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.spi.Path;
 
 import javax.jcr.RepositoryException;
-import javax.jcr.AccessDeniedException;
-import javax.jcr.ItemExistsException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.lock.LockException;
-import javax.jcr.version.VersionException;
 
 /**
  * {@code Copy}...
@@ -34,9 +27,9 @@ import javax.jcr.version.VersionExceptio
 public class Copy extends AbstractCopy  {
 
     private Copy(Path srcPath, Path destPath, String srcWorkspaceName,
-            ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider) throws RepositoryException
{
+            HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager)
throws RepositoryException {
         
-        super(srcPath, destPath, srcWorkspaceName, srcMgrProvider, destMgrProvider);
+        super(srcPath, destPath, srcWorkspaceName, srcHierarchyManager, destHierarchyManager);
     }
 
     //----------------------------------------------------------< Operation >---
@@ -53,10 +46,9 @@ public class Copy extends AbstractCopy  
 
     //------------------------------------------------------------< Factory >---
 
-    public static Operation create(Path srcPath, Path destPath, String srcWorkspaceName,
ManagerProvider srcMgrProvider,
-            ManagerProvider destMgrProvider) throws RepositoryException {
-        
-        Copy cp = new Copy(srcPath, destPath, srcWorkspaceName, srcMgrProvider, destMgrProvider);
-        return cp;
+    public static Operation create(Path srcPath, Path destPath, String srcWorkspaceName,
+            HierarchyManager srcHierarchyManager, HierarchyManager destHierarchyManager)
throws RepositoryException {
+
+        return new Copy(srcPath, destPath, srcWorkspaceName, srcHierarchyManager, destHierarchyManager);
     }
 }
\ No newline at end of file

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,36 +16,28 @@
  */
 package org.apache.jackrabbit.jcr2spi.query;
 
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Arrays;
-import java.util.Collection;
+import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.spi.QueryInfo;
+import org.apache.jackrabbit.spi.commons.conversion.NameException;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.apache.jackrabbit.spi.commons.value.ValueFormat;
 
-import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
-import javax.jcr.version.VersionException;
-
-import org.apache.jackrabbit.jcr2spi.ItemManager;
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
-import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
-import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.QueryInfo;
-import org.apache.jackrabbit.spi.QValue;
-import org.apache.jackrabbit.spi.commons.conversion.NameException;
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.spi.commons.value.ValueFormat;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Provides the default implementation for a JCR query.
@@ -63,11 +55,6 @@ public class QueryImpl implements Query 
     private final ManagerProvider mgrProvider;
 
     /**
-     * The item manager of the session that executes this query.
-     */
-    private final ItemManager itemManager;
-
-    /**
      * The query statement
      */
     private final String statement;
@@ -84,11 +71,6 @@ public class QueryImpl implements Query 
     private Node node;
 
     /**
-     * The WorkspaceManager used to execute queries.
-     */
-    private final WorkspaceManager wspManager;
-
-    /**
      * The maximum result size
      */
     private long limit = -1;
@@ -114,8 +96,6 @@ public class QueryImpl implements Query 
      *
      * @param session     the session that created this query.
      * @param mgrProvider the manager provider.
-     * @param itemMgr     the item manager of that session.
-     * @param wspManager  the workspace manager that belongs to the session.
      * @param statement   the query statement.
      * @param language    the language of the query statement.
      * @param node        the node from where the query was read or
@@ -123,25 +103,25 @@ public class QueryImpl implements Query 
      *                    query.
      * @throws InvalidQueryException if the query is invalid.
      */
-    public QueryImpl(Session session, ManagerProvider mgrProvider, ItemManager itemMgr, WorkspaceManager
wspManager,
-            String statement, String language, Node node) throws RepositoryException {
+    public QueryImpl(Session session, ManagerProvider mgrProvider, String statement, String
language, Node node)
+            throws RepositoryException {
 
         this.session = session;
         this.mgrProvider = mgrProvider;
-        itemManager = itemMgr;
         this.statement = statement;
         this.language = language;
-        this.wspManager = wspManager;
-        varNames = Arrays.asList(this.wspManager.checkQueryStatement(
-                statement, language, getNamespaceMappings()));
+        varNames = Arrays.asList(mgrProvider.getWorkspaceManager().
+                checkQueryStatement(statement, language, getNamespaceMappings()));
+        
         this.node = node;
     }
 
     @Override
     public QueryResult execute() throws RepositoryException {
-        QueryInfo qI = wspManager.executeQuery(
-                statement, language, getNamespaceMappings(), limit, offset, boundValues);
-        return new QueryResultImpl(itemManager, mgrProvider, qI);
+        QueryInfo qI = mgrProvider.getWorkspaceManager().
+                executeQuery(statement, language, getNamespaceMappings(), limit, offset,
boundValues);
+        
+        return new QueryResultImpl(mgrProvider, qI);
     }
 
     /***

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,6 +16,14 @@
  */
 package org.apache.jackrabbit.jcr2spi.query;
 
+import org.apache.jackrabbit.commons.query.QueryObjectModelBuilder;
+import org.apache.jackrabbit.commons.query.QueryObjectModelBuilderRegistry;
+import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
+import org.apache.jackrabbit.spi.commons.name.NameConstants;
+import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelFactoryImpl;
+import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -26,16 +34,6 @@ import javax.jcr.query.QueryManager;
 import javax.jcr.query.qom.QueryObjectModel;
 import javax.jcr.query.qom.QueryObjectModelFactory;
 
-import org.apache.jackrabbit.commons.query.QueryObjectModelBuilder;
-import org.apache.jackrabbit.commons.query.QueryObjectModelBuilderRegistry;
-import org.apache.jackrabbit.jcr2spi.ItemManager;
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
-import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
-import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
-import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelFactoryImpl;
-import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
-
 /**
  * This class implements the {@link QueryManager} interface.
  */
@@ -57,41 +55,24 @@ public class QueryManagerImpl implements
     private final ManagerProvider mgrProvider;
 
     /**
-     * The {@code ItemManager} of for item retrieval in search results
-     */
-    private final ItemManager itemMgr;
-
-    /**
-     * The {@code WorkspaceManager} where queries are executed.
-     */
-    private final WorkspaceManager wspManager;
-
-    /**
      * Creates a new {@code QueryManagerImpl} for the passed
      * {@code Session}.
      *
      * @param session     the current session.
      * @param mgrProvider the manager provider.
-     * @param itemMgr     the item manager of the current session.
-     * @param wspManager  the workspace manager.
      * @throws RepositoryException if an error occurs while initializing this
      *                             query manager.
      */
-    public QueryManagerImpl(Session session, ManagerProvider mgrProvider, ItemManager itemMgr,
-            WorkspaceManager wspManager) throws RepositoryException {
-
+    public QueryManagerImpl(Session session, ManagerProvider mgrProvider) throws RepositoryException
{
         this.session = session;
         valueFactory = mgrProvider.getJcrValueFactory();
         this.mgrProvider = mgrProvider;
-        this.itemMgr = itemMgr;
-        this.wspManager = wspManager;
     }
 
     @Override
     public Query createQuery(String statement, String language) throws RepositoryException
{
         checkIsAlive();
-        return new QueryImpl(session, mgrProvider, itemMgr, wspManager,
-                statement, language, null);
+        return new QueryImpl(session, mgrProvider, statement, language, null);
     }
 
     @Override
@@ -113,14 +94,13 @@ public class QueryManagerImpl implements
             QueryObjectModelBuilder builder = QueryObjectModelBuilderRegistry.getQueryObjectModelBuilder(language);
             return builder.createQueryObjectModel(statement, qomFactory, valueFactory);
         } else {
-            return new QueryImpl(session, mgrProvider, itemMgr, wspManager,
-                    statement, language, node);
+            return new QueryImpl(session, mgrProvider, statement, language, node);
         }
     }
 
     @Override
     public String[] getSupportedQueryLanguages() throws RepositoryException {
-        return wspManager.getSupportedQueryLanguages();
+        return mgrProvider.getWorkspaceManager().getSupportedQueryLanguages();
     }
 
     @Override
@@ -154,8 +134,7 @@ public class QueryManagerImpl implements
 
         @Override
         protected QueryObjectModel createQuery(QueryObjectModelTree qomTree) throws RepositoryException
{
-            return new QueryObjectModelImpl(session, mgrProvider, itemMgr,
-                    wspManager, qomTree, node);
+            return new QueryObjectModelImpl(session, mgrProvider, qomTree, node);
         }
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,16 +16,14 @@
  */
 package org.apache.jackrabbit.jcr2spi.query;
 
-import javax.jcr.ItemExistsException;
-import javax.jcr.ItemNotFoundException;
+import org.apache.jackrabbit.commons.query.QueryObjectModelBuilderRegistry;
+import org.apache.jackrabbit.jcr2spi.ManagerProvider;
+import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
+
 import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
-import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
-import javax.jcr.lock.LockException;
-import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.query.InvalidQueryException;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryResult;
@@ -34,13 +32,6 @@ import javax.jcr.query.qom.Constraint;
 import javax.jcr.query.qom.Ordering;
 import javax.jcr.query.qom.QueryObjectModel;
 import javax.jcr.query.qom.Source;
-import javax.jcr.version.VersionException;
-
-import org.apache.jackrabbit.commons.query.QueryObjectModelBuilderRegistry;
-import org.apache.jackrabbit.jcr2spi.ItemManager;
-import org.apache.jackrabbit.jcr2spi.ManagerProvider;
-import org.apache.jackrabbit.jcr2spi.WorkspaceManager;
-import org.apache.jackrabbit.spi.commons.query.qom.QueryObjectModelTree;
 
 /**
  * {@code QueryObjectModelImpl} implements the jcr2spi query object model.
@@ -52,11 +43,10 @@ public class QueryObjectModelImpl extend
      */
     private final QueryObjectModelTree qomTree;
 
-    public QueryObjectModelImpl(Session session, ManagerProvider mgrProvider, ItemManager
itemMgr,
-            WorkspaceManager wspManager, QueryObjectModelTree qomTree, Node node) throws
RepositoryException {
+    public QueryObjectModelImpl(Session session, ManagerProvider mgrProvider, QueryObjectModelTree
qomTree, Node node)
+            throws RepositoryException {
 
-        super(session, mgrProvider, itemMgr, wspManager,
-                getSQL2ForQOM(qomTree), Query.JCR_SQL2, node);
+        super(session, mgrProvider, getSQL2ForQOM(qomTree), Query.JCR_SQL2, node);
         this.qomTree = qomTree;
     }
 

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
Tue Sep 13 13:19:26 2011
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi.query;
 
-import org.apache.jackrabbit.jcr2spi.ItemManager;
 import org.apache.jackrabbit.jcr2spi.ManagerProvider;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.QueryInfo;
@@ -33,11 +32,6 @@ import javax.jcr.query.RowIterator;
 class QueryResultImpl implements QueryResult {
 
     /**
-     * The item manager of the session executing the query
-     */
-    private final ItemManager itemMgr;
-
-    /**
      * Provides various managers.
      */
     private final ManagerProvider mgrProvider;
@@ -50,12 +44,10 @@ class QueryResultImpl implements QueryRe
     /**
      * Creates a new query result.
      *
-     * @param itemMgr     the item manager of the session executing the query.
      * @param mgrProvider the manager provider.
      * @param queryInfo   the spi query result.
      */
-    QueryResultImpl(ItemManager itemMgr, ManagerProvider mgrProvider, QueryInfo queryInfo)
{
-        this.itemMgr = itemMgr;
+    QueryResultImpl(ManagerProvider mgrProvider, QueryInfo queryInfo) {
         this.mgrProvider = mgrProvider;
         this.queryInfo = queryInfo;
     }
@@ -84,7 +76,7 @@ class QueryResultImpl implements QueryRe
     @Override
     public RowIterator getRows() throws RepositoryException {
         return new RowIteratorImpl(queryInfo, mgrProvider.getNamePathResolver(), mgrProvider.getJcrValueFactory(),
-                itemMgr, mgrProvider.getHierarchyManager());
+                mgrProvider.getItemManager(), mgrProvider.getHierarchyManager());
     }
 
     /**
@@ -92,6 +84,6 @@ class QueryResultImpl implements QueryRe
      * @return a node iterator over the result nodes.
      */
     private ScoreNodeIterator getNodeIterator() {
-        return new NodeIteratorImpl(itemMgr, mgrProvider.getHierarchyManager(), queryInfo);
+        return new NodeIteratorImpl(mgrProvider.getItemManager(), mgrProvider.getHierarchyManager(),
queryInfo);
     }
 }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java?rev=1170170&r1=1170169&r2=1170170&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
Tue Sep 13 13:19:26 2011
@@ -24,11 +24,10 @@ import org.apache.jackrabbit.jcr2spi.sec
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
-import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.spi.QItemDefinition;
 import org.apache.jackrabbit.spi.QNodeDefinition;
-import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,16 +94,14 @@ public class ItemStateValidator {
      * manager provider
      */
     private final ManagerProvider mgrProvider;
-    private final PathFactory pathFactory;
 
     /**
      * Creates a new {@code ItemStateValidator} instance.
      *
      * @param mgrProvider manager provider
      */
-    public ItemStateValidator(ManagerProvider mgrProvider, PathFactory pathFactory) {
+    public ItemStateValidator(ManagerProvider mgrProvider) {
         this.mgrProvider = mgrProvider;
-        this.pathFactory = pathFactory;
     }
 
     //-------------------------------------------------< misc. helper methods >
@@ -252,7 +249,7 @@ public class ItemStateValidator {
         // access restriction on prop.
         if ((options & CHECK_ACCESS) == CHECK_ACCESS) {
             // make sure current session is granted write access on new prop
-            Path relPath = pathFactory.create(propertyName);
+            Path relPath = mgrProvider.getPathFactory().create(propertyName);
             if (!mgrProvider.getAccessManager().isGranted(parentState, relPath, new
                     String[] {AccessManager.SET_PROPERTY_ACTION})) {
 
@@ -314,10 +311,10 @@ public class ItemStateValidator {
         // access restrictions on new node
         if ((options & CHECK_ACCESS) == CHECK_ACCESS) {
             // make sure current session is granted write access on parent node
-            Path relPath = pathFactory.create(nodeName);
+            Path relPath = mgrProvider.getPathFactory().create(nodeName);
             if (!mgrProvider.getAccessManager().isGranted(parentState, relPath, new String[]
{AccessManager.ADD_NODE_ACTION})) {
-                throw new AccessDeniedException(safeGetJCRPath(parentState) + ": not allowed
to add child node '" +
-                        nodeName + '\'');
+                throw new AccessDeniedException(safeGetJCRPath(parentState) +
+                        ": not allowed to add child node '" + nodeName + '\'');
             }
         }
         // node type constraints



Mime
View raw message