cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1567410 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: ThrottlingCounter.java util/MessageListenerContainer.java
Date Tue, 11 Feb 2014 21:59:39 GMT
Author: dkulp
Date: Tue Feb 11 21:59:38 2014
New Revision: 1567410

URL: http://svn.apache.org/r1567410
Log:
Fix failing JMS tests

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ThrottlingCounter.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/MessageListenerContainer.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ThrottlingCounter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ThrottlingCounter.java?rev=1567410&r1=1567409&r2=1567410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ThrottlingCounter.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ThrottlingCounter.java
Tue Feb 11 21:59:38 2014
@@ -32,9 +32,9 @@ import org.apache.cxf.transport.jms.util
 public class ThrottlingCounter implements Counter {
 
     private AtomicInteger counter;
-    private int lowWatermark;
-    private int highWatermark;
-    private JMSListenerContainer listenerContainer;
+    private final int lowWatermark;
+    private final int highWatermark;
+    private final JMSListenerContainer listenerContainer;
     
     public ThrottlingCounter(JMSListenerContainer listenerContainer, int lowWatermark, int
highWatermark) {
         this.counter = new AtomicInteger();
@@ -45,7 +45,7 @@ public class ThrottlingCounter implement
     
     public final int incrementAndGet() {
         int curCounter = counter.incrementAndGet();
-        if (curCounter >= highWatermark && listenerContainer.isRunning()) {
+        if (highWatermark >= 0 && curCounter >= highWatermark && listenerContainer.isRunning())
{
             listenerContainer.stop();
         }
         return curCounter;

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/MessageListenerContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/MessageListenerContainer.java?rev=1567410&r1=1567409&r2=1567410&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/MessageListenerContainer.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/util/MessageListenerContainer.java
Tue Feb 11 21:59:38 2014
@@ -70,8 +70,11 @@ public class MessageListenerContainer im
 
     @Override
     public void stop() {
+        running = false;
         ResourceCloser.close(consumer);
         ResourceCloser.close(session);
+        consumer = null;
+        session = null;
     }
 
     @Override



Mime
View raw message