incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1549371 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java
Date Mon, 09 Dec 2013 02:52:14 GMT
Author: cziegeler
Date: Mon Dec  9 02:52:13 2013
New Revision: 1549371

URL: http://svn.apache.org/r1549371
Log:
SLING-3268 : TopicRoundRobin queue thread is not stopped when queue is closed

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java?rev=1549371&r1=1549370&r2=1549371&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/queues/TopicRoundRobinJobQueue.java
Mon Dec  9 02:52:13 2013
@@ -67,20 +67,19 @@ public final class TopicRoundRobinJobQue
 
     @Override
     protected void put(final JobHandler event) {
-        // is this a close?
-        if ( event.getJob() == null ) {
-            return;
-        }
-        final String topic = event.getJob().getTopic();
         synchronized ( this.topicMap ) {
-            List<JobHandler> events = this.topicMap.get(topic);
-            if ( events == null ) {
-                events = new LinkedList<JobHandler>();
-                this.topicMap.put(topic, events);
-                this.topics.add(topic);
+            // is this a real event (not close)?
+            if ( event.getJob() != null ) {
+                final String topic = event.getJob().getTopic();
+                List<JobHandler> events = this.topicMap.get(topic);
+                if ( events == null ) {
+                    events = new LinkedList<JobHandler>();
+                    this.topicMap.put(topic, events);
+                    this.topics.add(topic);
+                }
+                events.add(event);
+                this.eventCount++;
             }
-            events.add(event);
-            this.eventCount++;
             if ( this.isWaitingForNext ) {
                 this.isWaitingForNext = false;
                 // wake up take()



Mime
View raw message