From 6579497de7ac8e254081d4c426e3693861b68e2c Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Mon, 1 Nov 2021 14:13:01 -0400 Subject: [PATCH] GH-3656: Fix package tangles Fixes https://github.com/spring-projects/spring-integration/issues/3656 * Move `JavaUtils` from `util` package to the root one to break any possible tangling to/from other packages. * Deprecate an existing `JavaUtils` for backward compatibility * Remove `@IntegrationConverter` from the `JsonNodeWrapperToJsonNodeConverter` and register it manually in the `ConverterRegistrar`. The bean registration for the `JsonNodeWrapperToJsonNodeConverter` must be removed in the next `6.0` * Remove usage of `IntegrationContextUtils` from the `support` package --- .../amqp/config/AmqpChannelFactoryBean.java | 4 +- .../integration/JavaUtils.java | 174 ++++++++++++++++++ ...stractSimpleMessageHandlerFactoryBean.java | 46 ++--- .../config/AggregatorFactoryBean.java | 2 +- .../config/ConverterRegistrar.java | 5 + ...ltConfiguringBeanFactoryPostProcessor.java | 1 + .../context/IntegrationProperties.java | 2 +- .../AnnotationGatewayProxyFactoryBean.java | 4 +- .../gateway/GatewayProxyFactoryBean.java | 4 +- .../JsonNodeWrapperToJsonNodeConverter.java | 2 - .../channel/BeanFactoryChannelResolver.java | 9 +- .../support/utils/IntegrationUtils.java | 3 +- ...TransactionSynchronizationFactoryBean.java | 4 +- .../transformer/ContentEnricher.java | 2 +- .../integration/util/JavaUtils.java | 5 +- ...eTailInboundChannelAdapterFactoryBean.java | 28 +-- .../FileWritingMessageHandlerFactoryBean.java | 34 ++-- .../session/DefaultFtpsSessionFactory.java | 4 +- .../integration/jms/JmsOutboundGateway.java | 4 +- .../jms/config/JmsChannelFactoryBean.java | 48 ++--- .../session/DefaultSftpSessionFactory.java | 2 +- .../syslog/RFC5424SyslogParser.java | 4 +- ...logReceivingChannelAdapterFactoryBean.java | 4 +- .../websocket/ServerWebSocketContainer.java | 2 +- .../ws/dsl/BaseWsOutboundGatewaySpec.java | 8 +- 25 files changed, 292 insertions(+), 113 deletions(-) create mode 100644 spring-integration-core/src/main/java/org/springframework/integration/JavaUtils.java diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java index 0ac46b6c627..f150c4fd5a9 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/config/AmqpChannelFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -39,13 +39,13 @@ import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.context.Lifecycle; import org.springframework.context.SmartLifecycle; +import org.springframework.integration.JavaUtils; import org.springframework.integration.amqp.channel.AbstractAmqpChannel; import org.springframework.integration.amqp.channel.PointToPointSubscribableAmqpChannel; import org.springframework.integration.amqp.channel.PollableAmqpChannel; import org.springframework.integration.amqp.channel.PublishSubscribeAmqpChannel; import org.springframework.integration.amqp.support.AmqpHeaderMapper; import org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper; -import org.springframework.integration.util.JavaUtils; import org.springframework.lang.Nullable; import org.springframework.messaging.support.ChannelInterceptor; import org.springframework.transaction.PlatformTransactionManager; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/JavaUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/JavaUtils.java new file mode 100644 index 00000000000..aedfcb6e9df --- /dev/null +++ b/spring-integration-core/src/main/java/org/springframework/integration/JavaUtils.java @@ -0,0 +1,174 @@ +/* + * Copyright 2019-2021 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.integration; + +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +import org.springframework.util.CollectionUtils; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +/** + * Chained utility methods to simplify some Java repetitive code. Obtain a reference to + * the singleton {@link #INSTANCE} and then chain calls to the utility methods. + * + * @author Gary Russell + * @author Artem Bilan + * + * @since 5.1.3 + */ +public final class JavaUtils { + + /** + * The singleton instance of this utility class. + */ + public static final JavaUtils INSTANCE = new JavaUtils(); + + private JavaUtils() { + } + + /** + * Invoke {@link Consumer#accept(Object)} with the value if the condition is true. + * @param condition the condition. + * @param value the value. + * @param consumer the consumer. + * @param the value type. + * @return this. + */ + public JavaUtils acceptIfCondition(boolean condition, T value, Consumer consumer) { + if (condition) { + consumer.accept(value); + } + return this; + } + + /** + * Invoke {@link Consumer#accept(Object)} with the value if it is not null. + * @param value the value. + * @param consumer the consumer. + * @param the value type. + * @return this. + */ + public JavaUtils acceptIfNotNull(T value, Consumer consumer) { + if (value != null) { + consumer.accept(value); + } + return this; + } + + /** + * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. + * @param value the value. + * @param consumer the consumer. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfHasText(String value, Consumer consumer) { + if (StringUtils.hasText(value)) { + consumer.accept(value); + } + return this; + } + + /** + * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. + * @param value the value. + * @param consumer the consumer. + * @param the value type. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfNotEmpty(List value, Consumer> consumer) { + if (!CollectionUtils.isEmpty(value)) { + consumer.accept(value); + } + return this; + } + + /** + * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. + * @param value the value. + * @param consumer the consumer. + * @param the value type. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfNotEmpty(T[] value, Consumer consumer) { + if (!ObjectUtils.isEmpty(value)) { + consumer.accept(value); + } + return this; + } + + /** + * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the + * condition is true. + * @param condition the condition. + * @param t1 the first consumer argument + * @param t2 the second consumer argument + * @param consumer the consumer. + * @param the first argument type. + * @param the second argument type. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfCondition(boolean condition, T1 t1, T2 t2, BiConsumer consumer) { + if (condition) { + consumer.accept(t1, t2); + } + return this; + } + + /** + * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the t2 + * argument is not null. + * @param t1 the first argument + * @param t2 the second consumer argument + * @param consumer the consumer. + * @param the first argument type. + * @param the second argument type. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfNotNull(T1 t1, T2 t2, BiConsumer consumer) { + if (t2 != null) { + consumer.accept(t1, t2); + } + return this; + } + + /** + * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the value + * argument is not null or empty. + * @param t1 the first consumer argument. + * @param value the second consumer argument + * @param the first argument type. + * @param consumer the consumer. + * @return this. + * @since 5.2 + */ + public JavaUtils acceptIfHasText(T t1, String value, BiConsumer consumer) { + if (StringUtils.hasText(value)) { + consumer.accept(t1, value); + } + return this; + } + + +} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java index 4fa5464621d..c6cff07d100 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AbstractSimpleMessageHandlerFactoryBean.java @@ -35,13 +35,13 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; +import org.springframework.integration.JavaUtils; import org.springframework.integration.context.IntegrationObjectSupport; import org.springframework.integration.context.Orderable; import org.springframework.integration.core.MessageProducer; import org.springframework.integration.handler.AbstractMessageProducingHandler; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.support.context.NamedComponent; -import org.springframework.integration.util.JavaUtils; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; import org.springframework.messaging.core.DestinationResolver; @@ -199,19 +199,19 @@ protected final H createHandlerInternal() { } this.handler = createHandler(); JavaUtils.INSTANCE - .acceptIfCondition(this.handler instanceof ApplicationContextAware && this.applicationContext != null, - this.applicationContext, - context -> ((ApplicationContextAware) this.handler).setApplicationContext(this.applicationContext)) - .acceptIfCondition(this.handler instanceof BeanFactoryAware && getBeanFactory() != null, - getBeanFactory(), - factory -> ((BeanFactoryAware) this.handler).setBeanFactory(factory)) - .acceptIfCondition(this.handler instanceof BeanNameAware && this.beanName != null, this.beanName, - name -> ((BeanNameAware) this.handler).setBeanName(this.beanName)) - .acceptIfCondition(this.handler instanceof ApplicationEventPublisherAware - && this.applicationEventPublisher != null, - this.applicationEventPublisher, - publisher -> ((ApplicationEventPublisherAware) this.handler) - .setApplicationEventPublisher(publisher)); + .acceptIfCondition(this.handler instanceof ApplicationContextAware && this.applicationContext != null, + this.applicationContext, + context -> ((ApplicationContextAware) this.handler).setApplicationContext(this.applicationContext)) + .acceptIfCondition(this.handler instanceof BeanFactoryAware && getBeanFactory() != null, + getBeanFactory(), + factory -> ((BeanFactoryAware) this.handler).setBeanFactory(factory)) + .acceptIfCondition(this.handler instanceof BeanNameAware && this.beanName != null, this.beanName, + name -> ((BeanNameAware) this.handler).setBeanName(this.beanName)) + .acceptIfCondition(this.handler instanceof ApplicationEventPublisherAware + && this.applicationEventPublisher != null, + this.applicationEventPublisher, + publisher -> ((ApplicationEventPublisherAware) this.handler) + .setApplicationEventPublisher(publisher)); configureOutputChannelIfAny(); Object actualHandler = extractTarget(this.handler); if (actualHandler == null) { @@ -221,11 +221,11 @@ protected final H createHandlerInternal() { integrationObjectSupport(actualHandler, handlerToConfigure); adviceChain(actualHandler); JavaUtils.INSTANCE - .acceptIfCondition(this.async != null && actualHandler instanceof AbstractMessageProducingHandler, - this.async, - asyncValue -> ((AbstractMessageProducingHandler) handlerToConfigure).setAsync(asyncValue)) - .acceptIfCondition(this.handler instanceof Orderable && this.order != null, - this.order, theOrder -> ((Orderable) this.handler).setOrder(theOrder)); + .acceptIfCondition(this.async != null && actualHandler instanceof AbstractMessageProducingHandler, + this.async, + asyncValue -> ((AbstractMessageProducingHandler) handlerToConfigure).setAsync(asyncValue)) + .acceptIfCondition(this.handler instanceof Orderable && this.order != null, + this.order, theOrder -> ((Orderable) this.handler).setOrder(theOrder)); this.initialized = true; } initializingBean(); @@ -235,10 +235,10 @@ protected final H createHandlerInternal() { private void integrationObjectSupport(Object actualHandler, final Object handlerToConfigure) { if (actualHandler instanceof IntegrationObjectSupport) { JavaUtils.INSTANCE - .acceptIfNotNull(this.componentName, - name -> ((IntegrationObjectSupport) handlerToConfigure).setComponentName(name)) - .acceptIfNotNull(this.channelResolver, - resolver -> ((IntegrationObjectSupport) handlerToConfigure).setChannelResolver(resolver)); + .acceptIfNotNull(this.componentName, + name -> ((IntegrationObjectSupport) handlerToConfigure).setComponentName(name)) + .acceptIfNotNull(this.channelResolver, + resolver -> ((IntegrationObjectSupport) handlerToConfigure).setChannelResolver(resolver)); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorFactoryBean.java index 9c04d3c10de..7832925b1d9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/AggregatorFactoryBean.java @@ -26,6 +26,7 @@ import org.jetbrains.annotations.Nullable; import org.springframework.expression.Expression; +import org.springframework.integration.JavaUtils; import org.springframework.integration.aggregator.AbstractAggregatingMessageGroupProcessor; import org.springframework.integration.aggregator.AggregatingMessageHandler; import org.springframework.integration.aggregator.CorrelationStrategy; @@ -36,7 +37,6 @@ import org.springframework.integration.store.MessageGroup; import org.springframework.integration.store.MessageGroupStore; import org.springframework.integration.support.locks.LockRegistry; -import org.springframework.integration.util.JavaUtils; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandler; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/ConverterRegistrar.java b/spring-integration-core/src/main/java/org/springframework/integration/config/ConverterRegistrar.java index f8f7d95330c..2f330913365 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/ConverterRegistrar.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/ConverterRegistrar.java @@ -26,6 +26,8 @@ import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; +import org.springframework.integration.json.JsonNodeWrapperToJsonNodeConverter; +import org.springframework.integration.support.json.JacksonPresent; import org.springframework.integration.support.utils.IntegrationUtils; import org.springframework.util.Assert; @@ -74,6 +76,9 @@ public void afterPropertiesSet() { private void registerConverters(GenericConversionService conversionService) { this.converters.addAll(this.applicationContext.getBeansWithAnnotation(IntegrationConverter.class).values()); + if (JacksonPresent.isJackson2Present()) { + this.converters.add(new JsonNodeWrapperToJsonNodeConverter()); + } ConversionServiceFactory.registerConverters(this.converters, conversionService); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java index 1700f496d2b..d9d7eacb13d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/DefaultConfiguringBeanFactoryPostProcessor.java @@ -385,6 +385,7 @@ private void xpath(int registryId) throws LinkageError { } } + // TODO Remove in 6.0 private void jsonNodeToString(int registryId) { if (!this.beanFactory.containsBean( IntegrationContextUtils.JSON_NODE_WRAPPER_TO_JSON_NODE_CONVERTER) && diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java index d0705884468..9629ac4160c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationProperties.java @@ -19,7 +19,7 @@ import java.util.Arrays; import java.util.Properties; -import org.springframework.integration.util.JavaUtils; +import org.springframework.integration.JavaUtils; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java index edd0bc079e3..1e18b409345 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/AnnotationGatewayProxyFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 the original author or authors. + * Copyright 2017-2021 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. @@ -28,9 +28,9 @@ import org.springframework.core.annotation.AnnotationUtils; import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; +import org.springframework.integration.JavaUtils; import org.springframework.integration.annotation.AnnotationConstants; import org.springframework.integration.annotation.MessagingGateway; -import org.springframework.integration.util.JavaUtils; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java index 520ef495aa4..2f45691ab2e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayProxyFactoryBean.java @@ -58,6 +58,7 @@ import org.springframework.expression.common.LiteralExpression; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.integration.IntegrationPatternType; +import org.springframework.integration.JavaUtils; import org.springframework.integration.annotation.Gateway; import org.springframework.integration.annotation.GatewayHeader; import org.springframework.integration.context.IntegrationContextUtils; @@ -68,7 +69,6 @@ import org.springframework.integration.support.management.IntegrationManagement; import org.springframework.integration.support.management.TrackableComponent; import org.springframework.integration.support.management.metrics.MetricsCaptor; -import org.springframework.integration.util.JavaUtils; import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; @@ -865,7 +865,7 @@ private MethodInvocationGateway doCreateMethodInvocationGateway(Method method, String gatewayMethodBeanName = getComponentName() + '#' + method.getName() + - '(' + Arrays.stream(method.getParameterTypes()) + '(' + Arrays.stream(method.getParameterTypes()) .map(Class::getSimpleName) .collect(Collectors.joining(", ")) + ')'; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperToJsonNodeConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperToJsonNodeConverter.java index ddaaca11cc0..9682a12e675 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperToJsonNodeConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/json/JsonNodeWrapperToJsonNodeConverter.java @@ -21,7 +21,6 @@ import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.GenericConverter; -import org.springframework.integration.config.IntegrationConverter; import org.springframework.integration.json.JsonPropertyAccessor.JsonNodeWrapper; import org.springframework.lang.Nullable; @@ -38,7 +37,6 @@ * * @since 5.5 */ -@IntegrationConverter public class JsonNodeWrapperToJsonNodeConverter implements GenericConverter { @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/channel/BeanFactoryChannelResolver.java b/spring-integration-core/src/main/java/org/springframework/integration/support/channel/BeanFactoryChannelResolver.java index 192900553ee..1817685c692 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/channel/BeanFactoryChannelResolver.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/channel/BeanFactoryChannelResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -23,7 +23,6 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.NoSuchBeanDefinitionException; -import org.springframework.integration.context.IntegrationContextUtils; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.core.DestinationResolutionException; import org.springframework.messaging.core.DestinationResolver; @@ -97,9 +96,9 @@ public MessageChannel resolveDestination(String name) { synchronized (this) { if (!this.initialized) { try { - this.replyChannelRegistry = this.beanFactory.getBean( - IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, - HeaderChannelRegistry.class); + this.replyChannelRegistry = + this.beanFactory.getBean("integrationHeaderChannelRegistry", + HeaderChannelRegistry.class); } catch (Exception ex) { LOGGER.debug("No HeaderChannelRegistry found"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java index 02e104f8ecc..6b8c06cd631 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java @@ -24,7 +24,6 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.core.convert.ConversionService; -import org.springframework.integration.context.IntegrationContextUtils; import org.springframework.integration.support.DefaultMessageBuilderFactory; import org.springframework.integration.support.MessageBuilderFactory; import org.springframework.integration.support.context.NamedComponent; @@ -49,7 +48,7 @@ public final class IntegrationUtils { private static final Log LOGGER = LogFactory.getLog(IntegrationUtils.class); - private static final String INTERNAL_COMPONENT_PREFIX = '_' + IntegrationContextUtils.BASE_PACKAGE; + private static final String INTERNAL_COMPONENT_PREFIX = "_org.springframework.integration"; public static final String INTEGRATION_CONVERSION_SERVICE_BEAN_NAME = "integrationConversionService"; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java index 6a86b5bf9c3..f8fed5d65da 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transaction/TransactionSynchronizationFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2021 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. @@ -24,7 +24,7 @@ import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.expression.spel.standard.SpelExpressionParser; -import org.springframework.integration.util.JavaUtils; +import org.springframework.integration.JavaUtils; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.core.BeanFactoryMessageChannelDestinationResolver; import org.springframework.messaging.core.DestinationResolver; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java index 7f0dbd6cac4..7d54c467ae3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/ContentEnricher.java @@ -31,6 +31,7 @@ import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.integration.IntegrationPatternType; +import org.springframework.integration.JavaUtils; import org.springframework.integration.expression.ExpressionUtils; import org.springframework.integration.gateway.MessagingGatewaySupport; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; @@ -38,7 +39,6 @@ import org.springframework.integration.support.DefaultMessageBuilderFactory; import org.springframework.integration.support.management.ManageableLifecycle; import org.springframework.integration.transformer.support.HeaderValueMessageProcessor; -import org.springframework.integration.util.JavaUtils; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHandlingException; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java index 68d12d88f8e..7e3290ebb5b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 the original author or authors. + * Copyright 2019-2021 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. @@ -32,7 +32,10 @@ * @author Artem Bilan * * @since 5.1.3 + * + * @deprecated since 5.5.6 in favor of {@link org.springframework.integration.JavaUtils}. */ +@Deprecated public final class JavaUtils { /** diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterFactoryBean.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterFactoryBean.java index 32bfd4027e6..683011f905c 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterFactoryBean.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileTailInboundChannelAdapterFactoryBean.java @@ -25,10 +25,10 @@ import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.SmartLifecycle; import org.springframework.core.task.TaskExecutor; +import org.springframework.integration.JavaUtils; import org.springframework.integration.file.tail.ApacheCommonsFileTailingMessageProducer; import org.springframework.integration.file.tail.FileTailingMessageProducerSupport; import org.springframework.integration.file.tail.OSDelegatingFileTailingMessageProducer; -import org.springframework.integration.util.JavaUtils; import org.springframework.messaging.MessageChannel; import org.springframework.scheduling.TaskScheduler; import org.springframework.util.Assert; @@ -232,9 +232,9 @@ protected FileTailingMessageProducerSupport createInstance() { "'native-options' is not allowed with 'delay', 'end', or 'reopen'"); ApacheCommonsFileTailingMessageProducer apache = new ApacheCommonsFileTailingMessageProducer(); JavaUtils.INSTANCE - .acceptIfNotNull(this.delay, apache::setPollingDelay) - .acceptIfNotNull(this.end, apache::setEnd) - .acceptIfNotNull(this.reopen, apache::setReopen); + .acceptIfNotNull(this.delay, apache::setPollingDelay) + .acceptIfNotNull(this.end, apache::setEnd) + .acceptIfNotNull(this.reopen, apache::setReopen); adapter = apache; } adapter.setFile(this.file); @@ -243,16 +243,16 @@ protected FileTailingMessageProducerSupport createInstance() { adapter.setBeanName(this.beanName); BeanFactory beanFactory = getBeanFactory(); JavaUtils.INSTANCE - .acceptIfNotNull(this.taskExecutor, adapter::setTaskExecutor) - .acceptIfNotNull(this.taskScheduler, adapter::setTaskScheduler) - .acceptIfNotNull(this.fileDelay, adapter::setTailAttemptsDelay) - .acceptIfNotNull(this.idleEventInterval, adapter::setIdleEventInterval) - .acceptIfNotNull(this.autoStartup, adapter::setAutoStartup) - .acceptIfNotNull(this.phase, adapter::setPhase) - .acceptIfNotNull(this.applicationEventPublisher, adapter::setApplicationEventPublisher) - .acceptIfNotNull(this.outputChannelName, adapter::setOutputChannelName) - .acceptIfNotNull(this.errorChannelName, adapter::setErrorChannelName) - .acceptIfNotNull(beanFactory, adapter::setBeanFactory); + .acceptIfNotNull(this.taskExecutor, adapter::setTaskExecutor) + .acceptIfNotNull(this.taskScheduler, adapter::setTaskScheduler) + .acceptIfNotNull(this.fileDelay, adapter::setTailAttemptsDelay) + .acceptIfNotNull(this.idleEventInterval, adapter::setIdleEventInterval) + .acceptIfNotNull(this.autoStartup, adapter::setAutoStartup) + .acceptIfNotNull(this.phase, adapter::setPhase) + .acceptIfNotNull(this.applicationEventPublisher, adapter::setApplicationEventPublisher) + .acceptIfNotNull(this.outputChannelName, adapter::setOutputChannelName) + .acceptIfNotNull(this.errorChannelName, adapter::setErrorChannelName) + .acceptIfNotNull(beanFactory, adapter::setBeanFactory); adapter.afterPropertiesSet(); this.tailAdapter = adapter; return adapter; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileWritingMessageHandlerFactoryBean.java b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileWritingMessageHandlerFactoryBean.java index e1210aeeda1..1fde7466c3e 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileWritingMessageHandlerFactoryBean.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/config/FileWritingMessageHandlerFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -19,12 +19,12 @@ import java.io.File; import org.springframework.expression.Expression; +import org.springframework.integration.JavaUtils; import org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean; import org.springframework.integration.file.FileNameGenerator; import org.springframework.integration.file.FileWritingMessageHandler; import org.springframework.integration.file.FileWritingMessageHandler.MessageFlushPredicate; import org.springframework.integration.file.support.FileExistsMode; -import org.springframework.integration.util.JavaUtils; /** * Factory bean used to create {@link FileWritingMessageHandler}s. @@ -170,21 +170,21 @@ else if (this.directoryExpression != null) { handler.setExpectReply(this.expectReply); JavaUtils.INSTANCE - .acceptIfNotNull(this.charset, handler::setCharset) - .acceptIfNotNull(this.fileNameGenerator, handler::setFileNameGenerator) - .acceptIfNotNull(this.deleteSourceFiles, handler::setDeleteSourceFiles) - .acceptIfNotNull(this.autoCreateDirectory, handler::setAutoCreateDirectory) - .acceptIfNotNull(this.requiresReply, handler::setRequiresReply) - .acceptIfNotNull(this.sendTimeout, handler::setSendTimeout) - .acceptIfNotNull(this.temporaryFileSuffix, handler::setTemporaryFileSuffix) - .acceptIfNotNull(this.appendNewLine, handler::setAppendNewLine) - .acceptIfNotNull(this.fileExistsMode, handler::setFileExistsMode) - .acceptIfNotNull(this.bufferSize, handler::setBufferSize) - .acceptIfNotNull(this.flushInterval, handler::setFlushInterval) - .acceptIfNotNull(this.flushWhenIdle, handler::setFlushWhenIdle) - .acceptIfNotNull(this.flushPredicate, handler::setFlushPredicate) - .acceptIfNotNull(this.chmod, handler::setChmodOctal) - .acceptIfNotNull(this.preserveTimestamp, handler::setPreserveTimestamp); + .acceptIfNotNull(this.charset, handler::setCharset) + .acceptIfNotNull(this.fileNameGenerator, handler::setFileNameGenerator) + .acceptIfNotNull(this.deleteSourceFiles, handler::setDeleteSourceFiles) + .acceptIfNotNull(this.autoCreateDirectory, handler::setAutoCreateDirectory) + .acceptIfNotNull(this.requiresReply, handler::setRequiresReply) + .acceptIfNotNull(this.sendTimeout, handler::setSendTimeout) + .acceptIfNotNull(this.temporaryFileSuffix, handler::setTemporaryFileSuffix) + .acceptIfNotNull(this.appendNewLine, handler::setAppendNewLine) + .acceptIfNotNull(this.fileExistsMode, handler::setFileExistsMode) + .acceptIfNotNull(this.bufferSize, handler::setBufferSize) + .acceptIfNotNull(this.flushInterval, handler::setFlushInterval) + .acceptIfNotNull(this.flushWhenIdle, handler::setFlushWhenIdle) + .acceptIfNotNull(this.flushPredicate, handler::setFlushPredicate) + .acceptIfNotNull(this.chmod, handler::setChmodOctal) + .acceptIfNotNull(this.preserveTimestamp, handler::setPreserveTimestamp); return handler; } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java index a607deab707..d0450c5b1ef 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/DefaultFtpsSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -24,7 +24,7 @@ import org.apache.commons.net.ftp.FTPSClient; -import org.springframework.integration.util.JavaUtils; +import org.springframework.integration.JavaUtils; import org.springframework.util.StringUtils; /** diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java index b00e56f09b4..4b6bd4eb9bf 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -47,6 +47,7 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.core.convert.ConversionService; import org.springframework.expression.Expression; +import org.springframework.integration.JavaUtils; import org.springframework.integration.MessageTimeoutException; import org.springframework.integration.StaticMessageHeaderAccessor; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; @@ -54,7 +55,6 @@ import org.springframework.integration.jms.util.JmsAdapterUtils; import org.springframework.integration.support.AbstractIntegrationMessageBuilder; import org.springframework.integration.support.management.ManageableLifecycle; -import org.springframework.integration.util.JavaUtils; import org.springframework.jms.connection.ConnectionFactoryUtils; import org.springframework.jms.listener.DefaultMessageListenerContainer; import org.springframework.jms.support.JmsUtils; diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java index eb229843e92..24d80bb3f3b 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/config/JmsChannelFactoryBean.java @@ -29,11 +29,11 @@ import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.context.SmartLifecycle; +import org.springframework.integration.JavaUtils; import org.springframework.integration.jms.AbstractJmsChannel; import org.springframework.integration.jms.DynamicJmsTemplate; import org.springframework.integration.jms.PollableJmsChannel; import org.springframework.integration.jms.SubscribableJmsChannel; -import org.springframework.integration.util.JavaUtils; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.listener.AbstractMessageListenerContainer; import org.springframework.jms.listener.DefaultMessageListenerContainer; @@ -385,7 +385,7 @@ protected AbstractJmsChannel createInstance() { "A JMS Topic-backed 'publish-subscribe-channel' must be message-driven."); PollableJmsChannel pollableJmschannel = new PollableJmsChannel(this.jmsTemplate); JavaUtils.INSTANCE - .acceptIfNotNull(this.messageSelector, pollableJmschannel::setMessageSelector); + .acceptIfNotNull(this.messageSelector, pollableJmschannel::setMessageSelector); this.channel = pollableJmschannel; } if (!CollectionUtils.isEmpty(this.interceptors)) { @@ -394,7 +394,7 @@ protected AbstractJmsChannel createInstance() { this.channel.setBeanName(this.beanName); BeanFactory beanFactory = this.getBeanFactory(); JavaUtils.INSTANCE - .acceptIfNotNull(beanFactory, this.channel::setBeanFactory); + .acceptIfNotNull(beanFactory, this.channel::setBeanFactory); this.channel.afterPropertiesSet(); return this.channel; } @@ -403,8 +403,8 @@ private void initializeJmsTemplate() { Assert.isTrue(this.destination != null ^ this.destinationName != null, "Exactly one of destination or destinationName is required."); JavaUtils.INSTANCE - .acceptIfNotNull(this.destination, this.jmsTemplate::setDefaultDestination) - .acceptIfNotNull(this.destinationName, this.jmsTemplate::setDefaultDestinationName); + .acceptIfNotNull(this.destination, this.jmsTemplate::setDefaultDestination) + .acceptIfNotNull(this.destinationName, this.jmsTemplate::setDefaultDestinationName); } private AbstractMessageListenerContainer createContainer() { @@ -418,18 +418,18 @@ private AbstractMessageListenerContainer createContainer() { container.setClientId(this.clientId); container.setConnectionFactory(this.connectionFactory); JavaUtils.INSTANCE - .acceptIfNotNull(this.destination, container::setDestination) - .acceptIfNotNull(this.destinationName, container::setDestinationName) - .acceptIfNotNull(this.destinationResolver, container::setDestinationResolver); + .acceptIfNotNull(this.destination, container::setDestination) + .acceptIfNotNull(this.destinationName, container::setDestinationName) + .acceptIfNotNull(this.destinationResolver, container::setDestinationResolver); container.setDurableSubscriptionName(this.durableSubscriptionName); container.setErrorHandler(this.errorHandler); container.setExceptionListener(this.exceptionListener); JavaUtils.INSTANCE - .acceptIfNotNull(this.exposeListenerSession, container::setExposeListenerSession); + .acceptIfNotNull(this.exposeListenerSession, container::setExposeListenerSession); container.setMessageSelector(this.messageSelector); JavaUtils.INSTANCE - .acceptIfNotNull(this.phase, container::setPhase) - .acceptIfNotNull(this.pubSubDomain, container::setPubSubDomain); + .acceptIfNotNull(this.phase, container::setPhase) + .acceptIfNotNull(this.pubSubDomain, container::setPubSubDomain); container.setSessionAcknowledgeMode(this.sessionAcknowledgeMode); container.setSessionTransacted(this.sessionTransacted); container.setSubscriptionDurable(this.subscriptionDurable); @@ -438,28 +438,28 @@ private AbstractMessageListenerContainer createContainer() { if (container instanceof DefaultMessageListenerContainer) { DefaultMessageListenerContainer dmlc = (DefaultMessageListenerContainer) container; JavaUtils.INSTANCE - .acceptIfNotNull(this.cacheLevelName, dmlc::setCacheLevelName) - .acceptIfNotNull(this.cacheLevel, dmlc::setCacheLevel) - .acceptIfHasText(this.concurrency, dmlc::setConcurrency) - .acceptIfNotNull(this.concurrentConsumers, dmlc::setConcurrentConsumers) - .acceptIfNotNull(this.maxConcurrentConsumers, dmlc::setMaxConcurrentConsumers) - .acceptIfNotNull(this.idleTaskExecutionLimit, dmlc::setIdleTaskExecutionLimit) - .acceptIfNotNull(this.maxMessagesPerTask, dmlc::setMaxMessagesPerTask); + .acceptIfNotNull(this.cacheLevelName, dmlc::setCacheLevelName) + .acceptIfNotNull(this.cacheLevel, dmlc::setCacheLevel) + .acceptIfHasText(this.concurrency, dmlc::setConcurrency) + .acceptIfNotNull(this.concurrentConsumers, dmlc::setConcurrentConsumers) + .acceptIfNotNull(this.maxConcurrentConsumers, dmlc::setMaxConcurrentConsumers) + .acceptIfNotNull(this.idleTaskExecutionLimit, dmlc::setIdleTaskExecutionLimit) + .acceptIfNotNull(this.maxMessagesPerTask, dmlc::setMaxMessagesPerTask); dmlc.setPubSubNoLocal(this.pubSubNoLocal); JavaUtils.INSTANCE - .acceptIfNotNull(this.receiveTimeout, dmlc::setReceiveTimeout) - .acceptIfNotNull(this.recoveryInterval, dmlc::setRecoveryInterval); + .acceptIfNotNull(this.receiveTimeout, dmlc::setReceiveTimeout) + .acceptIfNotNull(this.recoveryInterval, dmlc::setRecoveryInterval); dmlc.setTaskExecutor(this.taskExecutor); dmlc.setTransactionManager(this.transactionManager); JavaUtils.INSTANCE - .acceptIfNotNull(this.transactionName, dmlc::setTransactionName) - .acceptIfNotNull(this.transactionTimeout, dmlc::setTransactionTimeout); + .acceptIfNotNull(this.transactionName, dmlc::setTransactionName) + .acceptIfNotNull(this.transactionTimeout, dmlc::setTransactionTimeout); } else if (container instanceof SimpleMessageListenerContainer) { SimpleMessageListenerContainer smlc = (SimpleMessageListenerContainer) container; JavaUtils.INSTANCE - .acceptIfHasText(this.concurrency, smlc::setConcurrency) - .acceptIfNotNull(this.concurrentConsumers, smlc::setConcurrentConsumers); + .acceptIfHasText(this.concurrency, smlc::setConcurrency) + .acceptIfNotNull(this.concurrentConsumers, smlc::setConcurrentConsumers); smlc.setPubSubNoLocal(this.pubSubNoLocal); smlc.setTaskExecutor(this.taskExecutor); } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java index 141b6dc935c..b97e261ae50 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java @@ -29,9 +29,9 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; +import org.springframework.integration.JavaUtils; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.file.remote.session.SharedSessionCapable; -import org.springframework.integration.util.JavaUtils; import org.springframework.util.Assert; import org.springframework.util.FileCopyUtils; import org.springframework.util.StringUtils; diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java index 79e3d8e9ca6..6b142d16a3e 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/RFC5424SyslogParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-2021 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. @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -import org.springframework.integration.util.JavaUtils; +import org.springframework.integration.JavaUtils; import org.springframework.util.Assert; /** diff --git a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterFactoryBean.java b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterFactoryBean.java index 503b55cd57f..dc661d2eb78 100644 --- a/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterFactoryBean.java +++ b/spring-integration-syslog/src/main/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -21,13 +21,13 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.SmartLifecycle; +import org.springframework.integration.JavaUtils; import org.springframework.integration.ip.tcp.connection.AbstractServerConnectionFactory; import org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter; import org.springframework.integration.syslog.MessageConverter; import org.springframework.integration.syslog.inbound.SyslogReceivingChannelAdapterSupport; import org.springframework.integration.syslog.inbound.TcpSyslogReceivingChannelAdapter; import org.springframework.integration.syslog.inbound.UdpSyslogReceivingChannelAdapter; -import org.springframework.integration.util.JavaUtils; import org.springframework.messaging.MessageChannel; import org.springframework.util.Assert; diff --git a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java index 5f9047c144c..e0f600e3ff7 100644 --- a/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java +++ b/spring-integration-websocket/src/main/java/org/springframework/integration/websocket/ServerWebSocketContainer.java @@ -20,7 +20,7 @@ import org.springframework.context.Lifecycle; import org.springframework.context.SmartLifecycle; -import org.springframework.integration.util.JavaUtils; +import org.springframework.integration.JavaUtils; import org.springframework.scheduling.TaskScheduler; import org.springframework.util.Assert; import org.springframework.util.ObjectUtils; diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java index 7e89fd4e569..cc2d3105175 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 the original author or authors. + * Copyright 2020-2021 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. @@ -20,8 +20,8 @@ import java.util.Map; import org.springframework.expression.Expression; +import org.springframework.integration.JavaUtils; import org.springframework.integration.dsl.MessageHandlerSpec; -import org.springframework.integration.util.JavaUtils; import org.springframework.integration.ws.AbstractWebServiceOutboundGateway; import org.springframework.integration.ws.SoapHeaderMapper; import org.springframework.web.util.DefaultUriBuilderFactory; @@ -47,7 +47,7 @@ */ public abstract class BaseWsOutboundGatewaySpec< S extends BaseWsOutboundGatewaySpec, E extends AbstractWebServiceOutboundGateway> - extends MessageHandlerSpec { + extends MessageHandlerSpec { private final Map uriVariableExpressions = new HashMap<>(); @@ -158,7 +158,7 @@ protected E doGet() { protected E assemble(E gateway) { gateway.setUriVariableExpressions(this.uriVariableExpressions); JavaUtils.INSTANCE - .acceptIfNotNull(this.headerMapper, gateway::setHeaderMapper); + .acceptIfNotNull(this.headerMapper, gateway::setHeaderMapper); gateway.setEncodingMode(this.encodingMode); gateway.setIgnoreEmptyResponses(this.ignoreEmptyResponses); gateway.setRequestCallback(this.requestCallback);