Skip to content
Permalink
Browse files
Fix failing JMS tests
git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1567410 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dkulp committed Feb 11, 2014
1 parent 983f409 commit dc9ae1559e892067c06daf00772e458b6428b1f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
@@ -32,9 +32,9 @@
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 ThrottlingCounter(JMSListenerContainer listenerContainer, int lowWatermar

public final int incrementAndGet() {
int curCounter = counter.incrementAndGet();
if (curCounter >= highWatermark && listenerContainer.isRunning()) {
if (highWatermark >= 0 && curCounter >= highWatermark && listenerContainer.isRunning()) {
listenerContainer.stop();
}
return curCounter;
@@ -70,8 +70,11 @@ public boolean isRunning() {

@Override
public void stop() {
running = false;
ResourceCloser.close(consumer);
ResourceCloser.close(session);
consumer = null;
session = null;
}

@Override

0 comments on commit dc9ae15

Please sign in to comment.