ARTEMIS-4569 Removing delegate usage and keep it as checkAtomic
This commit is contained in:
parent
cedc050e03
commit
99348ee672
|
@ -22,10 +22,6 @@ import java.util.function.Consumer;
|
||||||
|
|
||||||
public abstract class AtomicRunnable implements Runnable {
|
public abstract class AtomicRunnable implements Runnable {
|
||||||
|
|
||||||
public static AtomicRunnable delegate(Runnable runnable) {
|
|
||||||
return new AtomicRunnableWithDelegate(runnable);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AtomicRunnable checkAtomic(Runnable run) {
|
public static AtomicRunnable checkAtomic(Runnable run) {
|
||||||
if (run instanceof AtomicRunnable) {
|
if (run instanceof AtomicRunnable) {
|
||||||
return (AtomicRunnable)run;
|
return (AtomicRunnable)run;
|
||||||
|
|
|
@ -416,7 +416,7 @@ public class AMQSession implements SessionCallback {
|
||||||
sendShouldBlockProducer(producerInfo, messageSend, sendProducerAck, store, dest, count, coreMsg, address);
|
sendShouldBlockProducer(producerInfo, messageSend, sendProducerAck, store, dest, count, coreMsg, address);
|
||||||
} else {
|
} else {
|
||||||
if (store != null) {
|
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();
|
restoreAutoRead();
|
||||||
throw new ResourceAllocationException("Queue is full " + address);
|
throw new ResourceAllocationException("Queue is full " + address);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue