jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1170231 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi: ManagerProvider.java NamespaceRegistryImpl.java SessionImpl.java WorkspaceManager.java xml/SessionImporter.java
Date Tue, 13 Sep 2011 16:47:50 GMT
Author: mduerig
Date: Tue Sep 13 16:47:50 2011
New Revision: 1170231

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

Modified:
    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/SessionImpl.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java

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=1170231&r1=1170230&r2=1170231&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 16:47:50 2011
@@ -45,20 +45,17 @@ public interface ManagerProvider {
     AccessManager getAccessManager();
 
     /**
-     * Returns the {@code LockStateManager} associated with this
-     * {@code ManagerProvider}.
+     * Returns the {@code LockStateManager} associated with this {@code ManagerProvider}.
      *
-     * @return the {@code LockStateManager} associated with this
      * {@code ManagerProvider}
+     * @return 
      */
     LockStateManager getLockStateManager();
 
     /**
-     * Returns the {@code VersionManager} associated with this
-     * {@code ManagerProvider}.
+     * Returns the {@code VersionManager} associated with this {@code ManagerProvider}.
      *
-     * @return the {@code VersionManager} associated with this
-     * {@code ManagerProvider}
+     * @return 
      */
     VersionManager getVersionStateManager();
 

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=1170231&r1=1170230&r2=1170231&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 16:47:50 2011
@@ -25,8 +25,7 @@ import javax.jcr.RepositoryException;
 import java.util.Collection;
 
 /**
- * {@code NamespaceRegistryImpl} implements the JCR client facing
- * NamespaceRegistry.
+ * {@code NamespaceRegistryImpl} implements the JCR client facing NamespaceRegistry.
  */
 public class NamespaceRegistryImpl implements NamespaceRegistry {
     private static final Logger log = LoggerFactory.getLogger(NamespaceRegistryImpl.class);

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=1170231&r1=1170230&r2=1170231&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 16:47:50 2011
@@ -160,6 +160,14 @@ public class SessionImpl extends Abstrac
         }
     }
 
+    public IdFactory getIdFactory() {
+        return workspace.getIdFactory();
+    }
+
+    public NameFactory getNameFactory() {
+        return workspace.getNameFactory();
+    }
+
     //--------------------------------------------------< Session interface >---
 
     /**
@@ -386,11 +394,13 @@ public class SessionImpl extends Abstrac
         checkIsAlive();
 
         Path parentPath = getQPath(parentAbsPath);
-        // NOTE: check if path corresponds to Node and is writable is performed
-        // within the SessionImporter.
+
+        // check that import target is writable, not-locked and checked-out.
+        int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK | ItemStateValidator.CHECK_VERSIONING;
+        validator.checkIsWritable(getHierarchyManager().getNodeState(parentPath), options);
+
         Importer importer = new SessionImporter(parentPath, this, itemStateManager, uuidBehavior);
-        return new ImportHandler(importer, this, workspace.getNamespaceRegistry(), getNameFactory(),
-                getPathFactory());
+        return new ImportHandler(importer, this, workspace.getNamespaceRegistry(), getNameFactory(),
getPathFactory());
     }
 
     /**
@@ -784,20 +794,6 @@ public class SessionImpl extends Abstrac
 
     //--------------------------------------------------------------------------
 
-    // TODO public for SessionImport only. review
-    public final ItemStateValidator getValidator() {
-        return validator;
-    }
-
-    // TODO public for SessionImport only. review
-    public IdFactory getIdFactory() {
-        return workspace.getIdFactory();
-    }
-
-    public NameFactory getNameFactory() {
-        return workspace.getNameFactory();
-    }
-
     /**
      * Returns the {@code ItemStateManager} associated with this session.
      *
@@ -807,6 +803,10 @@ public class SessionImpl extends Abstrac
         return itemStateManager;
     }
 
+    final ItemStateValidator getValidator() {
+        return validator;
+    }
+
     CacheBehaviour getCacheBehaviour() {
         return config.getCacheBehaviour();
     }

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=1170231&r1=1170230&r2=1170231&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
Tue Sep 13 16:47:50 2011
@@ -172,8 +172,8 @@ public final class WorkspaceManager impl
                 
         nameFactory = service.getNameFactory();
         pathFactory = service.getPathFactory();
-
         idFactory = service.getIdFactory();
+        
         nsRegistry = new NamespaceRegistryImpl(this);
         ntRegistry = createNodeTypeRegistry(nsRegistry);
         definitionProvider = createDefinitionProvider(getEffectiveNodeTypeProvider());

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?rev=1170231&r1=1170230&r2=1170231&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Tue Sep 13 16:47:50 2011
@@ -28,7 +28,6 @@ import org.apache.jackrabbit.jcr2spi.ope
 import org.apache.jackrabbit.jcr2spi.operation.Remove;
 import org.apache.jackrabbit.jcr2spi.operation.SetMixin;
 import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
-import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
 import org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager;
@@ -121,11 +120,6 @@ public class SessionImporter implements 
         // perform preliminary checks
         try {
             importTarget = session.getHierarchyManager().getNodeState(parentPath);
-
-            // check if import target is writable, not-locked and checked-out.
-            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK
| ItemStateValidator.CHECK_VERSIONING;
-            session.getValidator().checkIsWritable(importTarget, options);
-
             refTracker = new ReferenceChangeTracker();
             parents = new Stack<NodeState>();
             parents.push(importTarget);



Mime
View raw message