jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1164057 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Date Thu, 01 Sep 2011 12:58:55 GMT
Author: mduerig
Date: Thu Sep  1 12:58:55 2011
New Revision: 1164057

URL: http://svn.apache.org/viewvc?rev=1164057&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
observation: correctly handle non local events

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1164057&r1=1164056&r2=1164057&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Thu Sep  1 12:58:55 2011
@@ -233,19 +233,16 @@ public class SubscriptionImpl implements
 
     private class EventSource {
         private final EventFilter[] eventFilters;
-        private final List<String> commitLog;
-
         private final String startRevision;
 
         public EventSource(EventFilter[] eventFilters, SessionState sessionState) {
             this.eventFilters = eventFilters;
-            commitLog = sessionState.getCommitLog();
+            List<String> commitLog = sessionState.getCommitLog();
             startRevision = commitLog.get(commitLog.size() - 1);
         }
 
-        public EventSource(EventFilter[] eventFilters, List<String> commitLog, String
startRevision) {
+        public EventSource(EventFilter[] eventFilters, String startRevision) {
             this.eventFilters = eventFilters;
-            this.commitLog = commitLog;
             this.startRevision = startRevision;
         }
 
@@ -283,7 +280,7 @@ public class SubscriptionImpl implements
         }
 
         public EventSource update(String startRevision) {
-            return new EventSource(eventFilters, commitLog, startRevision);
+            return new EventSource(eventFilters, startRevision);
         }
 
         //------------------------------------------< private >---
@@ -308,7 +305,8 @@ public class SubscriptionImpl implements
 
             Collection<Event> events = getEvents(changes, eventTemplate);
 
-            boolean isLocal = commitLog.contains(revisionId);  // todo performance: this
does a linear search on the list
+            // todo performance: this does a linear search on the list
+            boolean isLocal = sessionState.getCommitLog().contains(revisionId);
 
             // events.filter(event => eventFilters.any(_.accept(event, isLocal))
             for (Iterator<Event> it = events.iterator(); it.hasNext(); ) {



Mime
View raw message