diff --git a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageChannelNode.java b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageChannelNode.java index e86146cf04..4688b3531d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageChannelNode.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageChannelNode.java @@ -18,12 +18,14 @@ package org.springframework.integration.graph; import java.util.function.Supplier; +import org.springframework.lang.Nullable; import org.springframework.messaging.MessageChannel; /** * Represents a message channel. * * @author Gary Russell + * @author Artem Bilan * * @since 4.3 * @@ -40,8 +42,9 @@ public class MessageChannelNode extends IntegrationNode implements SendTimersAwa : new IntegrationNode.Stats()); } + @Nullable public SendTimers getSendTimers() { - return this.sendTimers.get(); + return this.sendTimers != null ? this.sendTimers.get() : null; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageHandlerNode.java b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageHandlerNode.java index e92f1baaeb..c23ef1dc5d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageHandlerNode.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageHandlerNode.java @@ -18,12 +18,14 @@ package org.springframework.integration.graph; import java.util.function.Supplier; +import org.springframework.lang.Nullable; import org.springframework.messaging.MessageHandler; /** * Represents a message handler. * * @author Gary Russell + * @author Artem Bilan * * @since 4.3 * @@ -47,8 +49,9 @@ public class MessageHandlerNode extends EndpointNode implements SendTimersAware return this.input; } + @Nullable public SendTimers getSendTimers() { - return this.sendTimers.get(); + return this.sendTimers != null ? this.sendTimers.get() : null; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageSourceNode.java b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageSourceNode.java index 7a98436a8c..10e4bdad19 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageSourceNode.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/graph/MessageSourceNode.java @@ -19,11 +19,13 @@ package org.springframework.integration.graph; import java.util.function.Supplier; import org.springframework.integration.core.MessageSource; +import org.springframework.lang.Nullable; /** * Represents a message source. * * @author Gary Russell + * @author Artem Bilan * * @since 4.3 * @@ -41,8 +43,9 @@ public class MessageSourceNode extends ErrorCapableEndpointNode implements Recei : new IntegrationNode.Stats()); } + @Nullable public ReceiveCounters getReceiveCounters() { - return this.receiveCounters.get(); + return this.receiveCounters != null ? this.receiveCounters.get() : null; } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/graph/PollableChannelNode.java b/spring-integration-core/src/main/java/org/springframework/integration/graph/PollableChannelNode.java index c256432989..6746d9791b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/graph/PollableChannelNode.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/graph/PollableChannelNode.java @@ -18,12 +18,15 @@ package org.springframework.integration.graph; import java.util.function.Supplier; +import org.springframework.lang.Nullable; import org.springframework.messaging.MessageChannel; /** * Represents a pollable channel. * * @author Gary Russell + * @author Artem Bilan + * * @since 5.2 * */ @@ -35,8 +38,9 @@ public class PollableChannelNode extends MessageChannelNode implements ReceiveCo super(nodeId, name, channel); } + @Nullable public ReceiveCounters getReceiveCounters() { - return this.receiveCounters.get(); + return this.receiveCounters != null ? this.receiveCounters.get() : null; } @Override