ARTEMIS-4569 Removing delegate usage and keep it as checkAtomic

This commit is contained in:
Clebert Suconic 2024-01-17 15:45:49 -05:00
parent cedc050e03
commit 99348ee672
2 changed files with 1 additions and 5 deletions

View File

@ -22,10 +22,6 @@ import java.util.function.Consumer;
public abstract class AtomicRunnable implements Runnable {
public static AtomicRunnable delegate(Runnable runnable) {
return new AtomicRunnableWithDelegate(runnable);
}
public static AtomicRunnable checkAtomic(Runnable run) {
if (run instanceof AtomicRunnable) {
return (AtomicRunnable)run;

View File

@ -416,7 +416,7 @@ public class AMQSession implements SessionCallback {
sendShouldBlockProducer(producerInfo, messageSend, sendProducerAck, store, dest, count, coreMsg, address);
} else {
if (store != null) {
if (!store.checkMemory(true, AtomicRunnable.delegate(this::restoreAutoRead), AtomicRunnable.delegate(this::blockConnection), this.blockedRunnables::add)) {
if (!store.checkMemory(true, this::restoreAutoRead, this::blockConnection, this.blockedRunnables::add)) {
restoreAutoRead();
throw new ResourceAllocationException("Queue is full " + address);
}