jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r348920 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
Date Fri, 25 Nov 2005 09:38:00 GMT
Author: mreutegg
Date: Fri Nov 25 01:37:56 2005
New Revision: 348920

URL: http://svn.apache.org/viewcvs?rev=348920&view=rev
Log:
JCR-279: IllegalStateException thrown when consuming events

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java?rev=348920&r1=348919&r2=348920&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
Fri Nov 25 01:37:56 2005
@@ -215,7 +215,7 @@
         // Set of ItemIds of denied ItemStates
         Set denied = (Set) accessDenied.remove(events);
         // check permissions
-        for (Iterator it = events.iterator(); it.hasNext();) {
+        for (Iterator it = events.iterator(); it.hasNext() && session.isLive();)
{
             EventState state = (EventState) it.next();
             if (state.getType() == Event.NODE_ADDED
                     || state.getType() == Event.PROPERTY_ADDED
@@ -235,6 +235,10 @@
                     denied.add(state.getId());
                 }
             }
+        }
+        // only deliver if session is still live
+        if (!session.isLive()) {
+            return;
         }
         // check if filtered iterator has at least one event
         EventIterator it = new FilteredEventIterator(events, filter, denied);



Mime
View raw message