Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.integration.routingslip;

import org.jspecify.annotations.Nullable;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
Expand Down Expand Up @@ -69,8 +71,10 @@ public class ExpressionEvaluatingRoutingSlipRouteStrategy

private final Expression expression;

@SuppressWarnings("NullAway.Init")
private EvaluationContext evaluationContext;

@SuppressWarnings("NullAway.Init")
private BeanFactory beanFactory;

public ExpressionEvaluatingRoutingSlipRouteStrategy(String expression) {
Expand Down Expand Up @@ -98,7 +102,7 @@ public void afterPropertiesSet() {
}

@Override
public Object getNextPath(Message<?> requestMessage, Object reply) {
public @Nullable Object getNextPath(Message<?> requestMessage, Object reply) {
return this.expression.getValue(this.evaluationContext, new RequestAndReply(requestMessage, reply));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.integration.routingslip;

import org.jspecify.annotations.Nullable;

import org.springframework.messaging.Message;

/**
Expand All @@ -37,6 +39,7 @@ public interface RoutingSlipRouteStrategy {
* object, a {@link Message} or a {@code AbstractIntegrationMessageBuilder}.
* @return a channel name or another {@link RoutingSlipRouteStrategy}.
*/
@Nullable
Object getNextPath(Message<?> requestMessage, Object reply);

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes supporting the RoutingSlip pattern.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.routingslip;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.springframework.integration.scattergather;

import org.jspecify.annotations.Nullable;

import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanInitializationException;
Expand Down Expand Up @@ -63,13 +65,15 @@ public class ScatterGatherHandler extends AbstractReplyProducingMessageHandler i

private final MessageHandler gatherer;

@SuppressWarnings("NullAway.Init")
private MessageChannel gatherChannel;

private String errorChannelName = IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME;

@SuppressWarnings("NullAway.Init")
private Long gatherTimeout;

private AbstractEndpoint gatherEndpoint;
private @Nullable AbstractEndpoint gatherEndpoint;

public ScatterGatherHandler(MessageHandler scatterer, MessageHandler gatherer) {
this(new FixedSubscriberChannel(scatterer), gatherer);
Expand Down Expand Up @@ -185,7 +189,7 @@ private Message<?> enhanceScatterReplyMessage(Message<?> message) {
}

@Override
protected Object handleRequestMessage(Message<?> requestMessage) {
protected @Nullable Object handleRequestMessage(Message<?> requestMessage) {
MessageHeaders requestMessageHeaders = requestMessage.getHeaders();
PollableChannel gatherResultChannel = new QueueChannel();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes supporting the Scatter-Gather pattern.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.scattergather;
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jspecify.annotations.Nullable;

/**
* An advice that can be added to a poller's advice chain that determines
Expand Down Expand Up @@ -47,7 +48,7 @@ public PollSkipAdvice(PollSkipStrategy strategy) {
}

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
public @Nullable Object invoke(MethodInvocation invocation) throws Throwable {
if ("call".equals(invocation.getMethod().getName()) && this.pollSkipStrategy.skipPoll()) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Skipping poll because "
Expand All @@ -56,9 +57,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
}
return null;
}
else {
return invocation.proceed();
}
return invocation.proceed();
}

private static final class DefaultPollSkipStrategy implements PollSkipStrategy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.concurrent.Executor;

import org.aopalliance.aop.Advice;
import org.jspecify.annotations.Nullable;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.integration.transaction.TransactionSynchronizationFactory;
Expand Down Expand Up @@ -56,39 +57,39 @@ public class PollerMetadata {
*/
public static final String DEFAULT_POLLER = DEFAULT_POLLER_METADATA_BEAN_NAME;

private Trigger trigger;
private @Nullable Trigger trigger;

private long maxMessagesPerPoll = MAX_MESSAGES_UNBOUNDED;

private long receiveTimeout = DEFAULT_RECEIVE_TIMEOUT;

private ErrorHandler errorHandler;
private @Nullable ErrorHandler errorHandler;

private List<Advice> adviceChain;
private @Nullable List<Advice> adviceChain;

private Executor taskExecutor;
private @Nullable Executor taskExecutor;

private TransactionSynchronizationFactory transactionSynchronizationFactory;
private @Nullable TransactionSynchronizationFactory transactionSynchronizationFactory;

public void setTransactionSynchronizationFactory(
TransactionSynchronizationFactory transactionSynchronizationFactory) {
Assert.notNull(transactionSynchronizationFactory, "'transactionSynchronizationFactory' must not be null");
this.transactionSynchronizationFactory = transactionSynchronizationFactory;
}

public TransactionSynchronizationFactory getTransactionSynchronizationFactory() {
public @Nullable TransactionSynchronizationFactory getTransactionSynchronizationFactory() {
return this.transactionSynchronizationFactory;
}

public void setTrigger(Trigger trigger) {
public void setTrigger(@Nullable Trigger trigger) {
this.trigger = trigger;
}

public Trigger getTrigger() {
public @Nullable Trigger getTrigger() {
return this.trigger;
}

public ErrorHandler getErrorHandler() {
public @Nullable ErrorHandler getErrorHandler() {
return this.errorHandler;
}

Expand Down Expand Up @@ -124,15 +125,15 @@ public void setAdviceChain(List<Advice> adviceChain) {
this.adviceChain = adviceChain;
}

public List<Advice> getAdviceChain() {
public @Nullable List<Advice> getAdviceChain() {
return this.adviceChain;
}

public void setTaskExecutor(Executor taskExecutor) {
this.taskExecutor = taskExecutor;
}

public Executor getTaskExecutor() {
public @Nullable Executor getTaskExecutor() {
return this.taskExecutor;
}

Expand All @@ -141,7 +142,7 @@ public Executor getTaskExecutor() {
* @param beanFactory BeanFactory for lookup, must not be null.
* @return The poller metadata.
*/
public static PollerMetadata getDefaultPollerMetadata(BeanFactory beanFactory) {
public static @Nullable PollerMetadata getDefaultPollerMetadata(BeanFactory beanFactory) {
Assert.notNull(beanFactory, "BeanFactory must not be null");
if (!beanFactory.containsBean(DEFAULT_POLLER_METADATA_BEAN_NAME)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes related to task scheduling.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.scheduling;
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,23 @@ public class MetadataStoreSelector implements MessageSelector {

private final MessageProcessor<String> keyStrategy;

private final MessageProcessor<String> valueStrategy;
private final @Nullable MessageProcessor<String> valueStrategy;

@Nullable
private BiPredicate<String, String> compareValues;
private @Nullable BiPredicate<String, String> compareValues;

public MetadataStoreSelector(MessageProcessor<String> keyStrategy) {
this(keyStrategy, (MessageProcessor<String>) null);
}

public MetadataStoreSelector(MessageProcessor<String> keyStrategy, MessageProcessor<String> valueStrategy) {
public MetadataStoreSelector(MessageProcessor<String> keyStrategy, @Nullable MessageProcessor<String> valueStrategy) {
this(keyStrategy, valueStrategy, new SimpleMetadataStore());
}

public MetadataStoreSelector(MessageProcessor<String> keyStrategy, ConcurrentMetadataStore metadataStore) {
this(keyStrategy, null, metadataStore);
}

public MetadataStoreSelector(MessageProcessor<String> keyStrategy, MessageProcessor<String> valueStrategy,
public MetadataStoreSelector(MessageProcessor<String> keyStrategy, @Nullable MessageProcessor<String> valueStrategy,
ConcurrentMetadataStore metadataStore) {
Assert.notNull(keyStrategy, "'keyStrategy' must not be null");
Assert.notNull(metadataStore, "'metadataStore' must not be null");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* Provides classes related to message selection.
*/
@org.jspecify.annotations.NullMarked
package org.springframework.integration.selector;