jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1163628 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Date Wed, 31 Aug 2011 14:12:58 GMT
Author: mduerig
Date: Wed Aug 31 14:12:58 2011
New Revision: 1163628

URL: http://svn.apache.org/viewvc?rev=1163628&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
observation: eventFilters semantic is any (not all)

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=1163628&r1=1163627&r2=1163628&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
Wed Aug 31 14:12:58 2011
@@ -310,15 +310,19 @@ public class SubscriptionImpl implements
 
             boolean isLocal = commitLog.contains(revisionId);  // todo performance: this
does a linear search on the list
 
-            // events.filter(event => eventFilters.all(_.accept(event, isLocal))
+            // events.filter(event => eventFilters.any(_.accept(event, isLocal))
             for (Iterator<Event> it = events.iterator(); it.hasNext(); ) {
                 Event event = it.next();
+                boolean accepted = false;
                 for (EventFilter filter : eventFilters) {
-                    if (!filter.accept(event, isLocal)) {
-                        it.remove();
+                    if (filter.accept(event, isLocal)) {
+                        accepted = true;
                         break;
                     }
                 }
+                if (!accepted) {
+                    it.remove();
+                }
             }
 
             return new EventBundleImpl(events, isLocal);



Mime
View raw message