jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1387547 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/test/java/org/apache...
Date Wed, 19 Sep 2012 12:25:40 GMT
Author: mreutegg
Date: Wed Sep 19 12:25:39 2012
New Revision: 1387547

URL: http://svn.apache.org/viewvc?rev=1387547&view=rev
Log:
OAK-312: Use stable root from session in NodeTypeManagerImpl

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadOnlyNodeTypeManager.java
      - copied, changed from r1387537, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/AbstractNodeTypeManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
  (contents, props changed)
      - copied, changed from r1387537, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/AbstractNodeTypeManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidatorProvider.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java?rev=1387547&r1=1387546&r2=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ContentSessionImpl.java
Wed Sep 19 12:25:39 2012
@@ -28,7 +28,7 @@ import org.apache.jackrabbit.oak.api.Con
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.SessionQueryEngine;
-import org.apache.jackrabbit.oak.plugins.type.NodeTypeManagerImpl;
+import org.apache.jackrabbit.oak.plugins.type.ReadWriteNodeTypeManager;
 import org.apache.jackrabbit.oak.query.QueryEngineImpl;
 import org.apache.jackrabbit.oak.query.SessionQueryEngineImpl;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
@@ -78,7 +78,7 @@ class ContentSessionImpl implements Cont
         synchronized (this) {
             if (!initialised) {
                 initialised = true;
-                NodeTypeManagerImpl.registerBuiltInNodeTypes(getLatestRoot());
+                ReadWriteNodeTypeManager.registerBuiltInNodeTypes(getLatestRoot());
             }
         }
 

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadOnlyNodeTypeManager.java
(from r1387537, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/AbstractNodeTypeManager.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadOnlyNodeTypeManager.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadOnlyNodeTypeManager.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/AbstractNodeTypeManager.java&r1=1387537&r2=1387547&rev=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/AbstractNodeTypeManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadOnlyNodeTypeManager.java
Wed Sep 19 12:25:39 2012
@@ -35,7 +35,6 @@ import javax.jcr.nodetype.PropertyDefini
 import com.google.common.collect.Lists;
 import org.apache.jackrabbit.commons.iterator.NodeTypeIteratorAdapter;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
-import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NameMapper;
 import org.apache.jackrabbit.oak.namepath.NamePathMapperImpl;
@@ -48,7 +47,7 @@ import org.apache.jackrabbit.oak.util.No
  * related to node type modifications throw
  * {@link UnsupportedRepositoryOperationException}.
  */
-public abstract class AbstractNodeTypeManager implements NodeTypeManager {
+public abstract class ReadOnlyNodeTypeManager implements NodeTypeManager {
 
     /**
      * Returns the internal name for the specified JCR name.

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
(from r1387537, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java&r1=1387537&r2=1387547&rev=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
Wed Sep 19 12:25:39 2012
@@ -84,7 +84,7 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.type.NodeTypeConstants.NODE_TYPES_PATH;
 
 /**
- * <code>NodeTypeManagerImpl</code> extends the {@link AbstractNodeTypeManager}
+ * <code>ReadWriteNodeTypeManager</code> extends the {@link ReadOnlyNodeTypeManager}
  * and add support for operations that modify node types:
  * <ul>
  *     <li>{@link #registerNodeType(NodeTypeDefinition, boolean)}</li>
@@ -101,14 +101,14 @@ import static org.apache.jackrabbit.oak.
  * stored in content and {@link #getWriteRoot()} for write access to the
  * repository in order to modify node types stored in content. A subclass may
  * also want to override the default implementation of
- * {@link AbstractNodeTypeManager} for the following methods:
+ * {@link ReadOnlyNodeTypeManager} for the following methods:
  * <ul>
  *     <li>{@link #getValueFactory()}</li>
  *     <li>{@link #getCoreValueFactory()}</li>
  *     <li>{@link #getNameMapper()}</li>
  * </ul>
  */
-public abstract class NodeTypeManagerImpl extends AbstractNodeTypeManager {
+public abstract class ReadWriteNodeTypeManager extends ReadOnlyNodeTypeManager {
 
     /**
      * Called by the methods {@link #registerNodeType(NodeTypeDefinition,boolean)},
@@ -132,7 +132,7 @@ public abstract class NodeTypeManagerImp
      * @param root the {@link Root} instance.
      */
     public static void registerBuiltInNodeTypes(final Root root) {
-        NodeTypeManagerImpl ntMgr = new NodeTypeManagerImpl() {
+        ReadWriteNodeTypeManager ntMgr = new ReadWriteNodeTypeManager() {
             @Override
             protected Tree getTypes() {
                 return root.getTree(NODE_TYPES_PATH);
@@ -160,7 +160,7 @@ public abstract class NodeTypeManagerImp
                 @Override
                 public Void run() {
                     try {
-                        InputStream stream = NodeTypeManagerImpl.class.getResourceAsStream("builtin_nodetypes.cnd");
+                        InputStream stream = ReadWriteNodeTypeManager.class.getResourceAsStream("builtin_nodetypes.cnd");
                         try {
                             registerNodeTypes(new InputStreamReader(stream, "UTF-8"));
                         } finally {

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/ReadWriteNodeTypeManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidatorProvider.java?rev=1387547&r1=1387546&r2=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/TypeValidatorProvider.java
Wed Sep 19 12:25:39 2012
@@ -33,7 +33,7 @@ public class TypeValidatorProvider imple
 
     @Override
     public Validator getRootValidator(NodeState before, final NodeState after) {
-        AbstractNodeTypeManager ntm = new AbstractNodeTypeManager() {
+        ReadOnlyNodeTypeManager ntm = new ReadOnlyNodeTypeManager() {
             private final Tree types = getTypes(after);
 
             @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1387547&r1=1387546&r2=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Wed Sep 19 12:25:39 2012
@@ -44,7 +44,7 @@ import org.apache.jackrabbit.oak.jcr.sec
 import org.apache.jackrabbit.oak.jcr.version.VersionManagerImpl;
 import org.apache.jackrabbit.oak.namepath.NameMapper;
 import org.apache.jackrabbit.oak.plugins.name.NamespaceRegistryImpl;
-import org.apache.jackrabbit.oak.plugins.type.NodeTypeManagerImpl;
+import org.apache.jackrabbit.oak.plugins.type.ReadWriteNodeTypeManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
@@ -171,7 +171,7 @@ public class WorkspaceImpl implements Ja
 
     @Override
     public NodeTypeManager getNodeTypeManager() {
-        return new NodeTypeManagerImpl() {
+        return new ReadWriteNodeTypeManager() {
             @Override
             protected void refresh() throws RepositoryException {
                 getSession().refresh(true);

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java?rev=1387547&r1=1387546&r2=1387547&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
Wed Sep 19 12:25:39 2012
@@ -33,7 +33,7 @@ import javax.jcr.nodetype.NodeTypeManage
 
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.commons.cnd.ParseException;
-import org.apache.jackrabbit.oak.plugins.type.NodeTypeManagerImpl;
+import org.apache.jackrabbit.oak.plugins.type.ReadWriteNodeTypeManager;
 import org.apache.jackrabbit.value.BinaryValue;
 
 public class TestContentLoader {
@@ -67,10 +67,10 @@ public class TestContentLoader {
     private static void registerTestNodeTypes(NodeTypeManager ntm) throws RepositoryException,
ParseException, IOException {
         InputStream stream = TestContentLoader.class.getResourceAsStream("test_nodetypes.cnd");
         try {
-            if (!(ntm instanceof NodeTypeManagerImpl)) {
-                throw new IllegalArgumentException("Need NodeTypeManagerImpl");
+            if (!(ntm instanceof ReadWriteNodeTypeManager)) {
+                throw new IllegalArgumentException("Need ReadWriteNodeTypeManager");
             }
-            ((NodeTypeManagerImpl)ntm).registerNodeTypes(new InputStreamReader(stream, "UTF-8"));
+            ((ReadWriteNodeTypeManager)ntm).registerNodeTypes(new InputStreamReader(stream,
"UTF-8"));
         } finally {
             stream.close();
         }



Mime
View raw message