jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1303403 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: ItemImpl.java NodeImpl.java PropertyImpl.java SessionImpl.java WorkspaceImpl.java state/NodeStateProvider.java state/TransientNodeState.java
Date Wed, 21 Mar 2012 14:24:43 GMT
Author: mduerig
Date: Wed Mar 21 14:24:42 2012
New Revision: 1303403

URL: http://svn.apache.org/viewvc?rev=1303403&view=rev
Log:
OAK-29: Simplify SessionContext

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/NodeStateProvider.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/TransientNodeState.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1303403&r1=1303402&r2=1303403&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Wed Mar 21 14:24:42 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
 import org.apache.jackrabbit.oak.jcr.state.TransientNodeState;
 import org.apache.jackrabbit.oak.jcr.util.Path;
 import org.slf4j.Logger;
@@ -35,14 +34,14 @@ import javax.jcr.ValueFactory;
  */
 abstract class ItemImpl implements Item {
 
-    protected final Context sessionContext;
+    protected final SessionContext<SessionImpl> sessionContext;
 
     /**
      * logger instance
      */
     private static final Logger log = LoggerFactory.getLogger(ItemImpl.class);
 
-    protected ItemImpl(Context sessionContext) {
+    protected ItemImpl(SessionContext<SessionImpl> sessionContext) {
         this.sessionContext = sessionContext;
     }
 
@@ -133,7 +132,7 @@ abstract class ItemImpl implements Item 
         return sessionContext.getValueFactory();
     }
 
-    protected static TransientNodeState getNodeState(Context sessionContext, Path path) {
+    protected static TransientNodeState getNodeState(SessionContext<SessionImpl> sessionContext,
Path path) {
         return sessionContext.getNodeStateProvider().getNodeState(path);
     }
 

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=1303403&r1=1303402&r2=1303403&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
Wed Mar 21 14:24:42 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.jcr;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
 import org.apache.jackrabbit.commons.iterator.PropertyIteratorAdapter;
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
+import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue.JsonAtom;
 import org.apache.jackrabbit.oak.jcr.state.PropertyStateImpl;
@@ -31,7 +31,6 @@ import org.apache.jackrabbit.oak.jcr.uti
 import org.apache.jackrabbit.oak.jcr.util.Path;
 import org.apache.jackrabbit.oak.jcr.util.Predicate;
 import org.apache.jackrabbit.oak.jcr.util.ValueConverter;
-import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -74,11 +73,11 @@ public class NodeImpl extends ItemImpl i
 
     private final TransientNodeState state;
 
-    static boolean exist(Context sessionContext, Path path) {
+    static boolean exist(SessionContext<SessionImpl> sessionContext, Path path) {
         return getNodeState(sessionContext, path) != null;
     }
 
-    static Node create(Context sessionContext, Path path) throws PathNotFoundException {
+    static Node create(SessionContext<SessionImpl> sessionContext, Path path) throws
PathNotFoundException {
         TransientNodeState state = getNodeState(sessionContext, path);
         if (state == null) {
             throw new PathNotFoundException(path.toJcrPath());
@@ -87,11 +86,11 @@ public class NodeImpl extends ItemImpl i
         return new NodeImpl(sessionContext, state);
     }
 
-    static Node create(Context sessionContext, TransientNodeState state) {
+    static Node create(SessionContext<SessionImpl> sessionContext, TransientNodeState
state) {
         return new NodeImpl(sessionContext, state);
     }
 
-    private NodeImpl(Context sessionContext, TransientNodeState state) {
+    private NodeImpl(SessionContext<SessionImpl> sessionContext, TransientNodeState
state) {
         super(sessionContext);
         this.state = state;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1303403&r1=1303402&r2=1303403&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Wed Mar 21 14:24:42 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue;
 import org.apache.jackrabbit.oak.jcr.state.TransientNodeState;
 import org.apache.jackrabbit.oak.jcr.util.LogUtil;
@@ -56,7 +55,7 @@ public class PropertyImpl extends ItemIm
     private final String name;
     private final JsonValue value;
 
-    static Property create(Context sessionContext, Path path) throws PathNotFoundException,
+    static Property create(SessionContext<SessionImpl> sessionContext, Path path) throws
PathNotFoundException,
             ItemNotFoundException {
 
         TransientNodeState parentState = getNodeState(sessionContext, path.getParent());
@@ -69,16 +68,16 @@ public class PropertyImpl extends ItemIm
         return new PropertyImpl(sessionContext, parentState, name, value);
     }
 
-    static Property create(Context sessionContext, TransientNodeState parentState, String
name, JsonValue value) {
+    static Property create(SessionContext<SessionImpl> sessionContext, TransientNodeState
parentState, String name, JsonValue value) {
         return new PropertyImpl(sessionContext, parentState, name, value);
     }
 
-    public static boolean exist(Context sessionContext, Path path) {
+    public static boolean exist(SessionContext<SessionImpl> sessionContext, Path path)
{
         TransientNodeState parentState = getNodeState(sessionContext, path.getParent());
         return parentState != null && parentState.hasProperty(path.getName());
     }
 
-    private PropertyImpl(Context sessionContext, TransientNodeState parentState, String name,
JsonValue value) {
+    private PropertyImpl(SessionContext<SessionImpl> sessionContext, TransientNodeState
parentState, String name, JsonValue value) {
         super(sessionContext);
         this.parentState = parentState;
         this.name = name;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1303403&r1=1303402&r2=1303403&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Wed Mar 21 14:24:42 2012
@@ -94,9 +94,7 @@ public class SessionImpl extends Abstrac
         }
     };
 
-    public interface Context extends SessionContext<SessionImpl>{}
-
-    private final Context sessionContext = new Context() {
+    private final SessionContext<SessionImpl> sessionContext = new SessionContext<SessionImpl>()
{
 
         @Override
         public SessionImpl getSession() {

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=1303403&r1=1303402&r2=1303403&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 Mar 21 14:24:42 2012
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
 import org.apache.jackrabbit.oak.jcr.json.FullJsonParser;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue.JsonObject;
@@ -54,9 +53,9 @@ public class WorkspaceImpl implements Wo
      */
     private static final Logger log = LoggerFactory.getLogger(WorkspaceImpl.class);
 
-    private final Context sessionContext;
+    private final SessionContext<SessionImpl> sessionContext;
 
-    public WorkspaceImpl(Context sessionContext) {
+    public WorkspaceImpl(SessionContext<SessionImpl> sessionContext) {
         this.sessionContext = sessionContext;
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/NodeStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/NodeStateProvider.java?rev=1303403&r1=1303402&r2=1303403&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/NodeStateProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/NodeStateProvider.java
Wed Mar 21 14:24:42 2012
@@ -20,7 +20,8 @@
 package org.apache.jackrabbit.oak.jcr.state;
 
 import org.apache.commons.collections.map.LRUMap;
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
+import org.apache.jackrabbit.oak.jcr.SessionContext;
+import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.apache.jackrabbit.oak.jcr.configuration.RepositoryConfiguration;
 import org.apache.jackrabbit.oak.jcr.state.ChangeTree.NodeDelta;
 import org.apache.jackrabbit.oak.jcr.util.Path;
@@ -29,11 +30,11 @@ import org.apache.jackrabbit.oak.jcr.uti
 import java.util.Map;
 
 public class NodeStateProvider {
-    private final Context sessionContext;
+    private final SessionContext<SessionImpl> sessionContext;
     private final TransientSpace transientSpace;
     private final Map<Path, TransientNodeState> cache;
 
-    public NodeStateProvider(Context sessionContext, TransientSpace transientSpace) {
+    public NodeStateProvider(SessionContext<SessionImpl> sessionContext, TransientSpace
transientSpace) {
         this.sessionContext = sessionContext;
         this.transientSpace = transientSpace;
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/TransientNodeState.java?rev=1303403&r1=1303402&r2=1303403&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/TransientNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/state/TransientNodeState.java
Wed Mar 21 14:24:42 2012
@@ -19,7 +19,11 @@
 
 package org.apache.jackrabbit.oak.jcr.state;
 
-import org.apache.jackrabbit.oak.jcr.SessionImpl.Context;
+import org.apache.jackrabbit.mk.model.ChildNodeEntry;
+import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.PropertyState;
+import org.apache.jackrabbit.oak.jcr.SessionContext;
+import org.apache.jackrabbit.oak.jcr.SessionImpl;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue;
 import org.apache.jackrabbit.oak.jcr.json.JsonValue.JsonAtom;
 import org.apache.jackrabbit.oak.jcr.state.ChangeTree.NodeDelta;
@@ -28,9 +32,6 @@ import org.apache.jackrabbit.oak.jcr.uti
 import org.apache.jackrabbit.oak.jcr.util.PagedIterator;
 import org.apache.jackrabbit.oak.jcr.util.Path;
 import org.apache.jackrabbit.oak.jcr.util.Predicate;
-import org.apache.jackrabbit.mk.model.ChildNodeEntry;
-import org.apache.jackrabbit.mk.model.NodeState;
-import org.apache.jackrabbit.mk.model.PropertyState;
 
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
@@ -47,13 +48,13 @@ import static org.apache.jackrabbit.oak.
 public class TransientNodeState {
     private static final int BATCH_SIZE = 256;
 
-    private final Context sessionContext;
+    private final SessionContext<SessionImpl> sessionContext;
 
     private String revision;
     private NodeState persistentNodeState;
     private NodeDelta nodeDelta;
 
-    TransientNodeState(Context sessionContext, NodeDelta nodeDelta) {
+    TransientNodeState(SessionContext<SessionImpl> sessionContext, NodeDelta nodeDelta)
{
         this.sessionContext = sessionContext;
         this.nodeDelta = nodeDelta;
     }



Mime
View raw message