diff --git a/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/incoming/IncomingMessagesUnsignedCounterBarrier.java b/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/incoming/IncomingMessagesUnsignedCounterBarrier.java index 1336ac3..80c72d6 100644 --- a/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/incoming/IncomingMessagesUnsignedCounterBarrier.java +++ b/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/incoming/IncomingMessagesUnsignedCounterBarrier.java @@ -1,21 +1,18 @@ package io.quarkiverse.solace.incoming; +import io.quarkiverse.solace.i18n.SolaceLogging; + import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - class IncomingMessagesUnsignedCounterBarrier { private final AtomicLong counter; // Treated as an unsigned long (i.e. range from 0 -> -1) private final Lock awaitLock = new ReentrantLock(); private final Condition isZero = awaitLock.newCondition(); - private static final Log logger = LogFactory.getLog(IncomingMessagesUnsignedCounterBarrier.class); - public IncomingMessagesUnsignedCounterBarrier(long initialValue) { counter = new AtomicLong(initialValue); } @@ -64,7 +61,7 @@ public boolean awaitEmpty(long timeout, TimeUnit unit) throws InterruptedExcepti awaitLock.lock(); try { if (timeout > 0) { - logger.info(String.format("Waiting for %s items, time remaining: %s %s", counter.get(), timeout, unit)); + SolaceLogging.log.info(String.format("Waiting for %s items, time remaining: %s %s", counter.get(), timeout, unit)); final long expiry = unit.toMillis(timeout) + System.currentTimeMillis(); while (isGreaterThanZero()) { long realTimeout = expiry - System.currentTimeMillis(); @@ -76,7 +73,7 @@ public boolean awaitEmpty(long timeout, TimeUnit unit) throws InterruptedExcepti return true; } else if (timeout < 0) { while (isGreaterThanZero()) { - logger.info(String.format("Waiting for %s items", counter.get())); + SolaceLogging.log.info(String.format("Waiting for %s items", counter.get())); isZero.await(5, TimeUnit.SECONDS); } return true; diff --git a/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/outgoing/OutgoingMessagesUnsignedCounterBarrier.java b/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/outgoing/OutgoingMessagesUnsignedCounterBarrier.java index 6855941..ae86289 100644 --- a/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/outgoing/OutgoingMessagesUnsignedCounterBarrier.java +++ b/pubsub-plus-connector/src/main/java/io/quarkiverse/solace/outgoing/OutgoingMessagesUnsignedCounterBarrier.java @@ -1,21 +1,18 @@ package io.quarkiverse.solace.outgoing; +import io.quarkiverse.solace.i18n.SolaceLogging; + import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - class OutgoingMessagesUnsignedCounterBarrier { private final AtomicLong counter; // Treated as an unsigned long (i.e. range from 0 -> -1) private final Lock awaitLock = new ReentrantLock(); private final Condition isZero = awaitLock.newCondition(); - private static final Log logger = LogFactory.getLog(OutgoingMessagesUnsignedCounterBarrier.class); - public OutgoingMessagesUnsignedCounterBarrier(long initialValue) { counter = new AtomicLong(initialValue); } @@ -64,7 +61,7 @@ public boolean awaitEmpty(long timeout, TimeUnit unit) throws InterruptedExcepti awaitLock.lock(); try { if (timeout > 0) { - logger.info(String.format("Waiting for %s items, time remaining: %s %s", counter.get(), timeout, unit)); + SolaceLogging.log.info(String.format("Waiting for %s items, time remaining: %s %s", counter.get(), timeout, unit)); final long expiry = unit.toMillis(timeout) + System.currentTimeMillis(); while (isGreaterThanZero()) { long realTimeout = expiry - System.currentTimeMillis(); @@ -76,7 +73,7 @@ public boolean awaitEmpty(long timeout, TimeUnit unit) throws InterruptedExcepti return true; } else if (timeout < 0) { while (isGreaterThanZero()) { - logger.info(String.format("Waiting for %s items", counter.get())); + SolaceLogging.log.info(String.format("Waiting for %s items", counter.get())); isZero.await(5, TimeUnit.SECONDS); } return true;