jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1143413 - /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Date Wed, 06 Jul 2011 13:50:02 GMT
Author: mduerig
Date: Wed Jul  6 13:50:02 2011
New Revision: 1143413

URL: http://svn.apache.org/viewvc?rev=1143413&view=rev
Log:
respect timeout in getEvents

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

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java?rev=1143413&r1=1143412&r2=1143413&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/SubscriptionImpl.java
Wed Jul  6 13:50:02 2011
@@ -69,10 +69,17 @@ public class SubscriptionImpl implements
     }
 
     public EventBundle[] getEvents(long timeout) throws RepositoryException, InterruptedException
{
-        String head = microKernel.waitForCommit(microKernel.getHeadRevision(), timeout);
-
         List<EventBundle> eventBundles = new ArrayList<EventBundle>();
 
+        String baseRevision;
+        synchronized (eventSources) {
+            baseRevision = eventSources.isEmpty() 
+                ? microKernel.getHeadRevision()
+                : eventSources.element().startRevision;
+        }
+
+        String head = microKernel.waitForCommit(baseRevision, timeout);
+
         synchronized (eventSources) {
             if (!eventSources.isEmpty()) {
                 EventSource current = eventSources.remove();



Mime
View raw message