jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1499375 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation: ChangeProcessor.java ObservationManagerImpl.java
Date Wed, 03 Jul 2013 12:57:50 GMT
Author: mduerig
Date: Wed Jul  3 12:57:50 2013
New Revision: 1499375

URL: http://svn.apache.org/r1499375
Log:
OAK-144 Implement Observation
Fix Javadoc, minor cleanup

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java?rev=1499375&r1=1499374&r2=1499375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java
Wed Jul  3 12:57:50 2013
@@ -18,6 +18,7 @@
  */
 package org.apache.jackrabbit.oak.jcr.observation;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 
 import java.util.ArrayList;
@@ -41,11 +42,11 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
+import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.ChangeSet;
+import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.Listener;
 import org.apache.jackrabbit.oak.plugins.observation.EventImpl;
 import org.apache.jackrabbit.oak.plugins.observation.Observable;
 import org.apache.jackrabbit.oak.plugins.observation.RecursingNodeStateDiff;
-import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.ChangeSet;
-import org.apache.jackrabbit.oak.plugins.observation.ChangeDispatcher.Listener;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
@@ -88,6 +89,7 @@ class ChangeProcessor implements Runnabl
     public ChangeProcessor(
             ContentSession contentSession, NamePathMapper namePathMapper,
             ListenerTracker tracker, EventFilter filter) {
+        checkArgument(contentSession instanceof Observable);
         this.contentSession = contentSession;
         this.namePathMapper = namePathMapper;
         this.tracker = tracker;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java?rev=1499375&r1=1499374&r2=1499375&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ObservationManagerImpl.java
Wed Jul  3 12:57:50 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.jackrabbit.oak.jcr.observation;
 
-import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.collect.Lists.newArrayList;
 
 import java.util.HashMap;
@@ -59,7 +58,6 @@ public class ObservationManagerImpl impl
             new HashMap<EventListener, ChangeProcessor>();
 
     private final SessionDelegate sessionDelegate;
-    private final ContentSession contentSession;
     private final ReadOnlyNodeTypeManager ntMgr;
     private final NamePathMapper namePathMapper;
     private final Whiteboard whiteboard;
@@ -68,7 +66,7 @@ public class ObservationManagerImpl impl
      * Create a new instance based on a {@link ContentSession} that needs to implement
      * {@link Observable}.
      *
-     * @param contentSession   the content session in whose context this observation manager
+     * @param sessionDelegate  session delegate of the session in whose context this observation
manager
      *                         operates.
      * @param nodeTypeManager  node type manager for the content session
      * @param namePathMapper   name path mapper for the content session
@@ -80,8 +78,6 @@ public class ObservationManagerImpl impl
             NamePathMapper namePathMapper, Whiteboard whiteboard) {
 
         this.sessionDelegate = sessionDelegate;
-        this.contentSession = sessionDelegate.getContentSession();
-        checkArgument(contentSession instanceof Observable);
         this.ntMgr = nodeTypeManager;
         this.namePathMapper = namePathMapper;
         this.whiteboard = whiteboard;
@@ -121,7 +117,7 @@ public class ObservationManagerImpl impl
                 }
             };
             processor = new ChangeProcessor(
-                    contentSession, namePathMapper, tracker, filter);
+                    sessionDelegate.getContentSession(), namePathMapper, tracker, filter);
             processors.put(listener, processor);
             processor.start(whiteboard);
         } else {



Mime
View raw message