Fix new Sonar smells
This commit is contained in:
@@ -450,7 +450,7 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
* @param wireTapConfigurer the {@link Consumer} to accept options for the {@link WireTap}.
|
||||
* @return the current {@link BaseIntegrationFlowDefinition}.
|
||||
*/
|
||||
public B wireTap(String wireTapChannel, Consumer<WireTapSpec> wireTapConfigurer) {
|
||||
public B wireTap(String wireTapChannel, @Nullable Consumer<WireTapSpec> wireTapConfigurer) {
|
||||
DirectChannel internalWireTapChannel = new DirectChannel();
|
||||
addComponent(IntegrationFlow.from(internalWireTapChannel).channel(wireTapChannel).get());
|
||||
return wireTap(internalWireTapChannel, wireTapConfigurer);
|
||||
@@ -639,7 +639,7 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
* @see MethodInvokingTransformer
|
||||
*/
|
||||
public B transform(MessageProcessorSpec<?> messageProcessorSpec,
|
||||
Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) {
|
||||
@Nullable Consumer<GenericEndpointSpec<MessageTransformingHandler>> endpointConfigurer) {
|
||||
|
||||
Assert.notNull(messageProcessorSpec, MESSAGE_PROCESSOR_SPEC_MUST_NOT_BE_NULL);
|
||||
MessageProcessor<?> processor = messageProcessorSpec.getObject();
|
||||
@@ -1087,7 +1087,7 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
* @return the current {@link BaseIntegrationFlowDefinition}.
|
||||
*/
|
||||
public B handle(MessageProcessorSpec<?> messageProcessorSpec,
|
||||
Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) {
|
||||
@Nullable Consumer<GenericEndpointSpec<ServiceActivatingHandler>> endpointConfigurer) {
|
||||
|
||||
Assert.notNull(messageProcessorSpec, MESSAGE_PROCESSOR_SPEC_MUST_NOT_BE_NULL);
|
||||
MessageProcessor<?> processor = messageProcessorSpec.getObject();
|
||||
@@ -2362,7 +2362,7 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
* @return the current {@link BaseIntegrationFlowDefinition}.
|
||||
* @see #wireTap(WireTapSpec)
|
||||
*/
|
||||
public <P> B log(LoggingHandler.Level level, String category, Function<Message<P>, Object> function) {
|
||||
public <P> B log(LoggingHandler.Level level, @Nullable String category, Function<Message<P>, Object> function) {
|
||||
Assert.notNull(function, FUNCTION_MUST_NOT_BE_NULL);
|
||||
return log(level, category, new FunctionExpression<>(function));
|
||||
}
|
||||
@@ -2650,7 +2650,7 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public <P> IntegrationFlow logAndReply(LoggingHandler.Level level, String category,
|
||||
public <P> IntegrationFlow logAndReply(LoggingHandler.Level level, @Nullable String category,
|
||||
Function<Message<P>, Object> function) {
|
||||
|
||||
Assert.notNull(function, FUNCTION_MUST_NOT_BE_NULL);
|
||||
|
||||
@@ -61,8 +61,10 @@ public abstract class EndpointSpec<S extends EndpointSpec<S, F, H>, F extends Be
|
||||
}
|
||||
|
||||
@Override
|
||||
public S id(String id) {
|
||||
this.endpointFactoryBean.setBeanName(id);
|
||||
public S id(@Nullable String id) {
|
||||
if (id != null) {
|
||||
this.endpointFactoryBean.setBeanName(id);
|
||||
}
|
||||
return super.id(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @param overwrite true to overwrite existing headers.
|
||||
* @return the header enricher spec.
|
||||
*/
|
||||
public HeaderEnricherSpec headerExpressions(MapBuilder<?, String, String> headers, Boolean overwrite) {
|
||||
public HeaderEnricherSpec headerExpressions(MapBuilder<?, String, String> headers, @Nullable Boolean overwrite) {
|
||||
Assert.notNull(headers, HEADERS_MUST_NOT_BE_NULL);
|
||||
return headerExpressions(headers.get(), overwrite);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @param overwrite true to overwrite existing headers.
|
||||
* @return the header enricher spec.
|
||||
*/
|
||||
public HeaderEnricherSpec headerExpressions(Map<String, String> headers, Boolean overwrite) {
|
||||
public HeaderEnricherSpec headerExpressions(Map<String, String> headers, @Nullable Boolean overwrite) {
|
||||
Assert.notNull(headers, HEADERS_MUST_NOT_BE_NULL);
|
||||
for (Entry<String, String> entry : headers.entrySet()) {
|
||||
AbstractHeaderValueMessageProcessor<Object> processor =
|
||||
@@ -314,7 +314,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec correlationId(Object correlationId, Boolean overwrite) {
|
||||
public HeaderEnricherSpec correlationId(Object correlationId, @Nullable Boolean overwrite) {
|
||||
return header(IntegrationMessageHeaderAccessor.CORRELATION_ID, correlationId, overwrite);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec correlationIdExpression(String correlationIdExpression, Boolean overwrite) {
|
||||
public HeaderEnricherSpec correlationIdExpression(String correlationIdExpression, @Nullable Boolean overwrite) {
|
||||
return headerExpression(IntegrationMessageHeaderAccessor.CORRELATION_ID, correlationIdExpression, overwrite);
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @see FunctionExpression
|
||||
*/
|
||||
public <P> HeaderEnricherSpec correlationIdFunction(Function<Message<P>, ?> correlationIdFunction,
|
||||
Boolean overwrite) {
|
||||
@Nullable Boolean overwrite) {
|
||||
|
||||
return headerFunction(IntegrationMessageHeaderAccessor.CORRELATION_ID, correlationIdFunction, overwrite);
|
||||
}
|
||||
@@ -394,7 +394,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec replyChannel(Object replyChannel, Boolean overwrite) {
|
||||
public HeaderEnricherSpec replyChannel(Object replyChannel, @Nullable Boolean overwrite) {
|
||||
return header(MessageHeaders.REPLY_CHANNEL, replyChannel, overwrite);
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec replyChannelExpression(String replyChannelExpression, Boolean overwrite) {
|
||||
public HeaderEnricherSpec replyChannelExpression(String replyChannelExpression, @Nullable Boolean overwrite) {
|
||||
return headerExpression(MessageHeaders.REPLY_CHANNEL, replyChannelExpression, overwrite);
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @see FunctionExpression
|
||||
*/
|
||||
public <P> HeaderEnricherSpec replyChannelFunction(Function<Message<P>, ?> replyChannelFunction,
|
||||
Boolean overwrite) {
|
||||
@Nullable Boolean overwrite) {
|
||||
|
||||
return headerFunction(MessageHeaders.REPLY_CHANNEL, replyChannelFunction, overwrite);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec errorChannel(Object errorChannel, Boolean overwrite) {
|
||||
public HeaderEnricherSpec errorChannel(Object errorChannel, @Nullable Boolean overwrite) {
|
||||
return header(MessageHeaders.ERROR_CHANNEL, errorChannel, overwrite);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec errorChannelExpression(String errorChannelExpression, Boolean overwrite) {
|
||||
public HeaderEnricherSpec errorChannelExpression(String errorChannelExpression, @Nullable Boolean overwrite) {
|
||||
return headerExpression(MessageHeaders.ERROR_CHANNEL, errorChannelExpression, overwrite);
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @see FunctionExpression
|
||||
*/
|
||||
public <P> HeaderEnricherSpec errorChannelFunction(Function<Message<P>, ?> errorChannelFunction,
|
||||
Boolean overwrite) {
|
||||
@Nullable Boolean overwrite) {
|
||||
|
||||
return headerFunction(MessageHeaders.ERROR_CHANNEL, errorChannelFunction, overwrite);
|
||||
}
|
||||
@@ -550,7 +550,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec priority(Number priority, Boolean overwrite) {
|
||||
public HeaderEnricherSpec priority(Number priority, @Nullable Boolean overwrite) {
|
||||
return header(IntegrationMessageHeaderAccessor.PRIORITY, priority, overwrite);
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec priorityExpression(String priorityExpression, Boolean overwrite) {
|
||||
public HeaderEnricherSpec priorityExpression(String priorityExpression, @Nullable Boolean overwrite) {
|
||||
return headerExpression(IntegrationMessageHeaderAccessor.PRIORITY, priorityExpression, overwrite);
|
||||
}
|
||||
|
||||
@@ -604,7 +604,9 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @since 5.2
|
||||
* @see FunctionExpression
|
||||
*/
|
||||
public <P> HeaderEnricherSpec priorityFunction(Function<Message<P>, ?> priorityFunction, Boolean overwrite) {
|
||||
public <P> HeaderEnricherSpec priorityFunction(Function<Message<P>, ?> priorityFunction,
|
||||
@Nullable Boolean overwrite) {
|
||||
|
||||
return headerFunction(IntegrationMessageHeaderAccessor.PRIORITY, priorityFunction, overwrite);
|
||||
}
|
||||
|
||||
@@ -626,7 +628,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec expirationDate(Object expirationDate, Boolean overwrite) {
|
||||
public HeaderEnricherSpec expirationDate(Object expirationDate, @Nullable Boolean overwrite) {
|
||||
return header(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, expirationDate, overwrite);
|
||||
}
|
||||
|
||||
@@ -653,7 +655,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec expirationDateExpression(String expirationDateExpression, Boolean overwrite) {
|
||||
public HeaderEnricherSpec expirationDateExpression(String expirationDateExpression, @Nullable Boolean overwrite) {
|
||||
return headerExpression(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, expirationDateExpression, overwrite);
|
||||
}
|
||||
|
||||
@@ -683,7 +685,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @see FunctionExpression
|
||||
*/
|
||||
public <P> HeaderEnricherSpec expirationDateFunction(Function<Message<P>, ?> expirationDateFunction,
|
||||
Boolean overwrite) {
|
||||
@Nullable Boolean overwrite) {
|
||||
|
||||
return headerFunction(IntegrationMessageHeaderAccessor.EXPIRATION_DATE, expirationDateFunction, overwrite);
|
||||
}
|
||||
@@ -726,7 +728,7 @@ public class HeaderEnricherSpec extends ConsumerEndpointSpec<HeaderEnricherSpec,
|
||||
* @return the header enricher spec.
|
||||
* @since 5.2
|
||||
*/
|
||||
public HeaderEnricherSpec routingSlip(Boolean overwrite, Object... routingSlipPath) {
|
||||
public HeaderEnricherSpec routingSlip(@Nullable Boolean overwrite, Object... routingSlipPath) {
|
||||
RoutingSlipHeaderValueMessageProcessor routingSlipHeaderValueMessageProcessor =
|
||||
new RoutingSlipHeaderValueMessageProcessor(routingSlipPath);
|
||||
routingSlipHeaderValueMessageProcessor.setOverwrite(overwrite);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a recipient channel that always will be selected.
|
||||
* Adds a recipient channel that is always selected.
|
||||
* @param channelName the channel name.
|
||||
* @return the router spec.
|
||||
*/
|
||||
@@ -51,12 +51,12 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a recipient channel that will be selected if the the expression evaluates to 'true'.
|
||||
* Adds a recipient channel that will be selected if the expression evaluates to 'true'.
|
||||
* @param channelName the channel name.
|
||||
* @param expression the expression.
|
||||
* @return the router spec.
|
||||
*/
|
||||
public RecipientListRouterSpec recipient(String channelName, String expression) {
|
||||
public RecipientListRouterSpec recipient(String channelName, @Nullable String expression) {
|
||||
if (StringUtils.hasText(expression)) {
|
||||
return recipient(channelName, PARSER.parseExpression(expression));
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a recipient channel that will be selected if the the expression evaluates to 'true'.
|
||||
* Adds a recipient channel that will be selected if the expression evaluates to 'true'.
|
||||
* @param channelName the channel name.
|
||||
* @param expression the expression.
|
||||
* @return the router spec.
|
||||
@@ -80,7 +80,7 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a recipient channel that will be selected if the the selector's accept method returns 'true'.
|
||||
* Adds a recipient channel that will be selected if the selector's accept method returns 'true'.
|
||||
* @param channelName the channel name.
|
||||
* @param selector the selector.
|
||||
* @return the router spec.
|
||||
@@ -129,7 +129,13 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
* @return the router spec.
|
||||
*/
|
||||
public RecipientListRouterSpec recipient(MessageChannel channel, @Nullable String expression) {
|
||||
return recipient(channel, StringUtils.hasText(expression) ? PARSER.parseExpression(expression) : null);
|
||||
if (StringUtils.hasText(expression)) {
|
||||
return recipient(channel, PARSER.parseExpression(expression));
|
||||
}
|
||||
else {
|
||||
this.handler.addRecipient(channel);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,16 +144,11 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
* @param expression the expression.
|
||||
* @return the router spec.
|
||||
*/
|
||||
public RecipientListRouterSpec recipient(MessageChannel channel, @Nullable Expression expression) {
|
||||
if (expression != null) {
|
||||
ExpressionEvaluatingSelector selector = new ExpressionEvaluatingSelector(expression);
|
||||
this.handler.addRecipient(channel, selector);
|
||||
this.componentsToRegister.put(selector, null);
|
||||
}
|
||||
else {
|
||||
this.handler.addRecipient(channel);
|
||||
}
|
||||
return _this();
|
||||
public RecipientListRouterSpec recipient(MessageChannel channel, Expression expression) {
|
||||
ExpressionEvaluatingSelector selector = new ExpressionEvaluatingSelector(expression);
|
||||
this.handler.addRecipient(channel, selector);
|
||||
this.componentsToRegister.put(selector, null);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +171,7 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
public <P> RecipientListRouterSpec recipient(MessageChannel channel, GenericSelector<P> selector) {
|
||||
MessageSelector messageSelector = wrapToMessageSelectorIfNecessary(selector);
|
||||
this.handler.addRecipient(channel, messageSelector);
|
||||
return _this();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,7 +213,13 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
* @return the router spec.
|
||||
*/
|
||||
public RecipientListRouterSpec recipientFlow(@Nullable String expression, IntegrationFlow subFlow) {
|
||||
return recipientFlow(StringUtils.hasText(expression) ? PARSER.parseExpression(expression) : null, subFlow);
|
||||
if (StringUtils.hasText(expression)) {
|
||||
return recipientFlow(PARSER.parseExpression(expression), subFlow);
|
||||
}
|
||||
else {
|
||||
MessageChannel channel = obtainInputChannelFromFlow(subFlow);
|
||||
return recipient(channel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,7 +228,7 @@ public class RecipientListRouterSpec extends AbstractRouterSpec<RecipientListRou
|
||||
* @param subFlow the subflow.
|
||||
* @return the router spec.
|
||||
*/
|
||||
public RecipientListRouterSpec recipientFlow(@Nullable Expression expression, IntegrationFlow subFlow) {
|
||||
public RecipientListRouterSpec recipientFlow(Expression expression, IntegrationFlow subFlow) {
|
||||
MessageChannel channel = obtainInputChannelFromFlow(subFlow);
|
||||
return recipient(channel, expression);
|
||||
}
|
||||
|
||||
@@ -136,8 +136,8 @@ public class StandardIntegrationFlow
|
||||
ListIterator<Object> iterator = components.listIterator(this.integrationComponents.size());
|
||||
while (iterator.hasPrevious()) {
|
||||
Object component = iterator.previous();
|
||||
if (component instanceof SmartLifecycle) {
|
||||
((SmartLifecycle) component).start();
|
||||
if (component instanceof SmartLifecycle lifecycle) {
|
||||
lifecycle.start();
|
||||
}
|
||||
}
|
||||
this.running = true;
|
||||
@@ -148,11 +148,9 @@ public class StandardIntegrationFlow
|
||||
public void stop(Runnable callback) {
|
||||
AggregatingCallback aggregatingCallback = new AggregatingCallback(this.integrationComponents.size(), callback);
|
||||
for (Object component : this.integrationComponents.keySet()) {
|
||||
if (component instanceof SmartLifecycle lifecycle) {
|
||||
if (lifecycle.isRunning()) {
|
||||
lifecycle.stop(aggregatingCallback);
|
||||
continue;
|
||||
}
|
||||
if (component instanceof SmartLifecycle lifecycle && lifecycle.isRunning()) {
|
||||
lifecycle.stop(aggregatingCallback);
|
||||
continue;
|
||||
}
|
||||
aggregatingCallback.run();
|
||||
}
|
||||
@@ -162,10 +160,8 @@ public class StandardIntegrationFlow
|
||||
@Override
|
||||
public void stop() {
|
||||
for (Object component : this.integrationComponents.keySet()) {
|
||||
if (component instanceof SmartLifecycle lifecycle) {
|
||||
if (lifecycle.isRunning()) {
|
||||
lifecycle.stop();
|
||||
}
|
||||
if (component instanceof SmartLifecycle lifecycle && lifecycle.isRunning()) {
|
||||
lifecycle.stop();
|
||||
}
|
||||
}
|
||||
this.running = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 the original author or authors.
|
||||
* Copyright 2020-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,11 +35,7 @@ import org.springframework.messaging.MessageChannel
|
||||
class KotlinRecipientListRouterSpec(override val delegate: RecipientListRouterSpec)
|
||||
: AbstractKotlinRouterSpec<RecipientListRouterSpec, RecipientListRouter>(delegate) {
|
||||
|
||||
fun recipient(channelName: String) {
|
||||
this.delegate.recipient(channelName)
|
||||
}
|
||||
|
||||
fun recipient(channelName: String, expression: String) {
|
||||
fun recipient(channelName: String, expression: String? = null) {
|
||||
this.delegate.recipient(channelName, expression)
|
||||
}
|
||||
|
||||
@@ -54,11 +50,7 @@ class KotlinRecipientListRouterSpec(override val delegate: RecipientListRouterSp
|
||||
this.delegate.recipient<P>(channelName) { selector(it) }
|
||||
}
|
||||
|
||||
fun recipient(channel: MessageChannel) {
|
||||
this.delegate.recipient(channel)
|
||||
}
|
||||
|
||||
fun recipient(channel: MessageChannel, expression: String) {
|
||||
fun recipient(channel: MessageChannel, expression: String? = null) {
|
||||
this.delegate.recipient(channel, expression)
|
||||
}
|
||||
|
||||
@@ -68,9 +60,9 @@ class KotlinRecipientListRouterSpec(override val delegate: RecipientListRouterSp
|
||||
|
||||
inline fun <reified P> recipient(channel: MessageChannel, crossinline selector: (P) -> Boolean) {
|
||||
if (Message::class.java.isAssignableFrom(P::class.java))
|
||||
this.delegate.recipientMessageSelector(channel, MessageSelector { selector(it as P) })
|
||||
this.delegate.recipientMessageSelector(channel) { selector(it as P) }
|
||||
else
|
||||
this.delegate.recipient<P>(channel, GenericSelector { selector(it) })
|
||||
this.delegate.recipient<P>(channel) { selector(it) }
|
||||
}
|
||||
|
||||
inline fun <reified P> recipientFlow(crossinline selector: (P) -> Boolean,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2022 the original author or authors.
|
||||
* Copyright 2022-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -126,7 +126,7 @@ class GroovyIntegrationFlowDefinition {
|
||||
* at the current {@link IntegrationFlow} chain position using the {@link MessageChannelSpec}
|
||||
* fluent API.
|
||||
* @param messageChannelSpec the {@link MessageChannelSpec} to use.
|
||||
* @see MessageChannels
|
||||
* @see org.springframework.integration.dsl.MessageChannels
|
||||
*/
|
||||
GroovyIntegrationFlowDefinition channel(MessageChannelSpec messageChannelSpec) {
|
||||
this.delegate.channel messageChannelSpec
|
||||
|
||||
Reference in New Issue
Block a user