jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1459900 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Date Fri, 22 Mar 2013 17:04:27 GMT
Author: mduerig
Date: Fri Mar 22 17:04:27 2013
New Revision: 1459900

URL: http://svn.apache.org/r1459900
Log:
OAK-672: Avoid JCR APIs calling other JCR APIs
- Simplify
- Class documentation for SessionContext

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1459900&r1=1459899&r2=1459900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Fri Mar 22 17:04:27 2013
@@ -16,9 +16,12 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
 import javax.jcr.PathNotFoundException;
@@ -52,10 +55,11 @@ import org.apache.jackrabbit.oak.spi.sec
 import org.apache.jackrabbit.oak.spi.security.authorization.permission.PermissionProvider;
 import org.apache.jackrabbit.oak.spi.xml.ProtectedItemImporter;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 /**
- * TODO doc
+ * Instances of this class are passed to all JCR implementation classes
+ * (e.g. {@code SessionImpl}, {@code NodeImpl}, etc.) and provide access to
+ * the session scoped instances generally needed (e.g. {@code NamePathMapper},
+ * {@code ValueFactory}, etc.).
  */
 public abstract class SessionContext implements NamePathMapper {
     private final RepositoryImpl repository;
@@ -102,9 +106,34 @@ public abstract class SessionContext imp
             }
 
             @Override
-            public WorkspaceImpl getWorkspaceInternal() {
+            public Workspace getWorkspace() {
                 return workspace;
             }
+
+            @Override
+            public LockManager getLockManager() {
+                return workspace.getLockManager();
+            }
+
+            @Override
+            public NodeTypeManager getNodeTypeManager() {
+                return workspace.getNodeTypeManager();
+            }
+
+            @Override
+            public VersionManager getVersionManager() throws RepositoryException {
+                return workspace.getVersionManager();
+            }
+
+            @Override
+            public EffectiveNodeTypeProvider getEffectiveNodeTypeProvider() {
+                return workspace.getReadWriteNodeTypeManager();
+            }
+
+            @Override
+            public DefinitionProvider getDefinitionProvider() {
+                return workspace.getReadWriteNodeTypeManager();
+            }
         };
     }
 
@@ -118,31 +147,17 @@ public abstract class SessionContext imp
 
     public abstract Session getSession();
 
-    protected abstract WorkspaceImpl getWorkspaceInternal();
+    public abstract Workspace getWorkspace();
 
-    public Workspace getWorkspace() {
-        return getWorkspaceInternal();
-    }
+    public abstract LockManager getLockManager();
 
-    public LockManager getLockManager() {
-        return getWorkspaceInternal().getLockManager();
-    }
-
-    public NodeTypeManager getNodeTypeManager() {
-        return getWorkspaceInternal().getNodeTypeManager();
-    }
+    public abstract NodeTypeManager getNodeTypeManager();
 
-    public VersionManager getVersionManager() throws RepositoryException {
-        return getWorkspaceInternal().getVersionManager();
-    }
+    public abstract VersionManager getVersionManager() throws RepositoryException;
 
-    public EffectiveNodeTypeProvider getEffectiveNodeTypeProvider() {
-        return getWorkspaceInternal().getReadWriteNodeTypeManager();
-    }
+    public abstract EffectiveNodeTypeProvider getEffectiveNodeTypeProvider();
 
-    public DefinitionProvider getDefinitionProvider() {
-        return getWorkspaceInternal().getReadWriteNodeTypeManager();
-    }
+    public abstract DefinitionProvider getDefinitionProvider();
 
     public ValueFactory getValueFactory() {
         return valueFactory;



Mime
View raw message