From eaed95445878889394f96aaf8b69fe5815b27b1c Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 26 Aug 2016 12:56:11 -0400 Subject: [PATCH] INT-3913 Remove/resolve deprecation from the past JIRA: https://jira.spring.io/browse/INT-3913 * Remove deprecated classes and methods/constructors, deprecated XML attributes * Remove `TcpConnectionEventListeningMessageProducer` and rework tests logic to the `ApplicationEventListeningMessageProducer` * Fix several typos * Remove/rework deprecated entities mentioning --- build.gradle | 1 + .../amqp/outbound/AmqpOutboundEndpoint.java | 27 -- .../amqp/support/DefaultAmqpHeaderMapper.java | 9 - .../config/spring-integration-amqp-5.0.xsd | 2 +- .../PassThroughMessageGroupProcessor.java | 39 --- .../integration/annotation/Header.java | 50 ---- .../integration/annotation/Headers.java | 41 --- .../integration/annotation/Payload.java | 51 ---- ...thodAnnotationPublisherMetadataSource.java | 14 +- .../integration/codec/kryo/MessageCodec.java | 2 +- .../CorrelationStrategyFactoryBean.java | 26 -- .../config/IntegrationRegistrar.java | 7 - .../config/ReleaseStrategyFactoryBean.java | 26 -- .../integration/config/RouterFactoryBean.java | 9 - .../ExpressionMessageProducerSupport.java | 9 - .../IntegrationEvaluationContextAware.java | 46 ---- ...aluationContextAwareBeanPostProcessor.java | 80 ------ .../GatewayMethodInboundMessageMapper.java | 21 +- .../gateway/GatewayProxyFactoryBean.java | 8 +- .../integration/handler/LoggingHandler.java | 10 - .../router/AbstractMessageRouter.java | 11 - .../store/AbstractKeyValueMessageStore.java | 23 -- .../integration/store/MessageGroupStore.java | 11 - .../integration/store/SimpleMessageStore.java | 28 -- ...MessageTransformingChannelInterceptor.java | 70 ----- .../util/MessagingAnnotationUtils.java | 6 +- .../util/MessagingMethodInvokerHelper.java | 10 +- .../config/spring-integration-5.0.xsd | 24 -- .../SendTimeoutConfigurationTests-context.xml | 2 +- ...RecipientListRouterParserTests-context.xml | 4 +- .../config/RouterParserTests-context.xml | 2 +- .../integration/store/MessageStoreTests.java | 6 - .../integration/file/FileHeaders.java | 6 - .../file/FileReadingMessageSource.java | 12 - .../RecursiveLeafOnlyDirectoryScanner.java | 56 ---- .../file/WatchServiceDirectoryScanner.java | 254 ------------------ .../AbstractRemoteFileOutboundGateway.java | 9 - ...ecursiveLeafOnlyDirectoryScannerTests.java | 77 ------ ...terWithRecursiveDirectoryTests-context.xml | 28 -- ...nelAdapterWithRecursiveDirectoryTests.java | 80 ------ .../gemfire/store/GemfireMessageStore.java | 15 +- ...dlerRescheduleIntegrationTests-context.xml | 2 +- ...ayerHandlerRescheduleIntegrationTests.java | 13 +- .../gemfire/store/GemfireGroupStoreTests.java | 4 +- .../store/gemfire-aggregator-config-a.xml | 2 +- .../store/gemfire-aggregator-config.xml | 2 +- .../gemfire/store/gemfire-queue-config.xml | 2 +- .../ip/config/IpAdapterParserUtils.java | 9 - .../ip/config/IpNamespaceHandler.java | 2 - ...ctionEventInboundChannelAdapterParser.java | 47 ---- ...nnectionEventListeningMessageProducer.java | 88 ------ .../ip/config/spring-integration-ip-5.0.xsd | 65 ----- .../ip/config/ParserUnitTests-context.xml | 13 +- .../ip/config/ParserUnitTests.java | 32 --- .../ConnectionToConnectionTests-context.xml | 7 +- .../TcpConnectionEventListenerTests.java | 46 +++- .../integration/jdbc/JdbcMessageStore.java | 23 -- .../integration/jms/JmsHeaders.java | 51 ---- .../jms/config/spring-integration-jms-5.0.xsd | 24 +- .../jms/config/jmsInboundWithPubSubDomain.xml | 2 +- .../JpaOutboundGatewayFactoryBean.java | 12 - .../jpa/config/spring-integration-jpa-5.0.xsd | 12 +- ...stractConfigurableMongoDbMessageStore.java | 6 - .../ConfigurableMongoDbMessageStore.java | 13 - .../mongodb/store/MongoDbMessageStore.java | 12 - .../outbound/AbstractMqttMessageHandler.java | 11 - .../inbound/RedisQueueInboundGateway.java | 10 - .../RedisQueueMessageDrivenEndpoint.java | 11 - .../redis/outbound/RedisOutboundGateway.java | 9 - .../integration/sftp/session/SftpSession.java | 3 +- ...hatMessageInboundChannelAdapterParser.java | 5 - .../config/XmppConnectionFactoryBean.java | 11 - .../inbound/ChatMessageListeningEndpoint.java | 15 -- .../config/spring-integration-xmpp-5.0.xsd | 11 - ...boundChannelAdapterParserTests-context.xml | 2 +- .../xmpp/ignore/InboundChatTests-context.xml | 12 +- .../ChatMessageListeningEndpointTests.java | 10 +- .../config/LeaderInitiatorFactoryBean.java | 16 -- src/reference/asciidoc/file.adoc | 10 +- src/reference/asciidoc/ftp.adoc | 3 - src/reference/asciidoc/gateway.adoc | 3 - src/reference/asciidoc/http.adoc | 2 - src/reference/asciidoc/ip.adoc | 16 +- src/reference/asciidoc/jpa.adoc | 2 +- src/reference/asciidoc/sftp.adoc | 3 - src/reference/asciidoc/xml.adoc | 2 +- src/reference/asciidoc/xmpp.adoc | 3 - 87 files changed, 106 insertions(+), 1765 deletions(-) delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/aggregator/PassThroughMessageGroupProcessor.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/annotation/Header.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/annotation/Headers.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAware.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAwareBeanPostProcessor.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingChannelInterceptor.java delete mode 100644 spring-integration-file/src/main/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScanner.java delete mode 100644 spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java delete mode 100644 spring-integration-file/src/test/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScannerTests.java delete mode 100644 spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests-context.xml delete mode 100644 spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests.java delete mode 100644 spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionEventInboundChannelAdapterParser.java delete mode 100644 spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java delete mode 100644 spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaders.java diff --git a/build.gradle b/build.gradle index 8965dd5fd5..d0a51d4510 100644 --- a/build.gradle +++ b/build.gradle @@ -389,6 +389,7 @@ project('spring-integration-ip') { dependencies { compile project(":spring-integration-core") testCompile project(":spring-integration-stream") + testCompile project(":spring-integration-event") } } diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java index 51b36c3bc0..c0f246adee 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AmqpOutboundEndpoint.java @@ -24,7 +24,6 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnCallback; import org.springframework.amqp.rabbit.support.CorrelationData; import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.context.Lifecycle; -import org.springframework.expression.Expression; import org.springframework.integration.amqp.support.MappingUtils; import org.springframework.messaging.Message; import org.springframework.util.Assert; @@ -53,36 +52,10 @@ public class AmqpOutboundEndpoint extends AbstractAmqpOutboundEndpoint } } - /** - * @param exchangeNameExpression the expression to set. - * @deprecated in favor of {@link #setExchangeNameExpression}. - */ - @Deprecated - public void setExpressionExchangeName(Expression exchangeNameExpression) { - setExchangeNameExpression(exchangeNameExpression); - } - - /** - * @param routingKeyExpression the expression to set. - * @deprecated in favor of {@link #setRoutingKeyExpression}. - */ - @Deprecated - public void setExpressionRoutingKey(Expression routingKeyExpression) { - setRoutingKeyExpression(routingKeyExpression); - } - public void setExpectReply(boolean expectReply) { this.expectReply = expectReply; } - /** - * @param confirmCorrelationExpression the expression to set. - * @deprecated in favor of {@link #setConfirmCorrelationExpression}. - */ - @Deprecated - public void setExpressionConfirmCorrelation(Expression confirmCorrelationExpression) { - setConfirmCorrelationExpression(confirmCorrelationExpression); - } @Override public String getComponentType() { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java index 5cd0b78037..9186a595fb 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java @@ -113,15 +113,6 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/PassThroughMessageGroupProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aggregator/PassThroughMessageGroupProcessor.java deleted file mode 100644 index 890b7dceba..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/aggregator/PassThroughMessageGroupProcessor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2002-2016 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 - * - * http://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.aggregator; - -import org.springframework.integration.store.MessageGroup; - -/** - * This implementation of MessageGroupProcessor will return all messages inside the group. - * This is useful if there is no requirement to process the messages, but they should just be - * blocked as a group until their ReleaseStrategy lets them pass through. - * - * @deprecated since 4.2; use {@link SimpleMessageGroupProcessor} - * - * @author Iwein Fuld - * @since 2.0.0 - */ -@Deprecated -public class PassThroughMessageGroupProcessor implements MessageGroupProcessor { - - @Override - public Object processMessageGroup(MessageGroup group) { - return group.getMessages(); - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Header.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Header.java deleted file mode 100644 index ce8bb48e20..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Header.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2002-2010 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 - * - * http://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.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation indicating that a method parameter's value should be - * retrieved from the message headers. The value of the annotation - * can either be a header name (e.g., 'foo') or SpEL expression - * (e.g., 'payload.getCustomerId()') which is quite useful when - * the name of the header has to be dynamically computed. It also - * provides an optional 'required' property which - * specifies whether the attribute value must be available within - * the header. The default value for 'required' is true. - * - * @author Mark Fisher - * - * @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Header}. - * Will be removed in a future release. - */ -@Target(ElementType.PARAMETER) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Deprecated -public @interface Header { - - String value() default ""; - - boolean required() default true; - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Headers.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Headers.java deleted file mode 100644 index 8a67f7f13f..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Headers.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2002-2010 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 - * - * http://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.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation indicating that a method parameter's value should be mapped to or - * from the message headers. The annotated parameter must be assignable to - * {@link java.util.Map}, and all of the Map's keys must be Strings. - * - * @author Mark Fisher - * - * @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Headers}. - * Will be removed in a future release. - */ -@Target(ElementType.PARAMETER) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Deprecated -public @interface Headers { - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java b/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java deleted file mode 100644 index 79a947aec1..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/annotation/Payload.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2002-2014 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 - * - * http://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.annotation; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * This annotation allows you to specify a SpEL expression indicating that a method - * parameter's value should be mapped from the payload of a Message. The expression - * will be evaluated against the payload object as the root context. The annotated - * parameter type must match or be convertible from the evaluation result. - *

- * Example: void foo(@Payload("city.name") String cityName) - will map the value of - * the 'name' property of the 'city' property of the payload object. - * - * @author Oleg Zhurakousky - * @since 2.0 - * - * @deprecated since 4.1 in favor of {@link org.springframework.messaging.handler.annotation.Payload}. - * Will be removed in a future release. - */ -@Target({ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Deprecated -public @interface Payload { - - /** - * @return The expression for matching against nested properties of the payload. - */ - String value() default ""; - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java index 151f1e9a1d..2f0f44cf57 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java @@ -74,14 +74,9 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat return (StringUtils.hasText(channelName) ? channelName : null); } - @SuppressWarnings("deprecation") public String getPayloadExpression(Method method) { String payloadExpression = null; - Annotation methodPayloadAnnotation = - AnnotationUtils.findAnnotation(method, org.springframework.integration.annotation.Payload.class); - if (methodPayloadAnnotation == null) { - methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class); - } + Annotation methodPayloadAnnotation = AnnotationUtils.findAnnotation(method, Payload.class); if (methodPayloadAnnotation != null) { payloadExpression = getAnnotationValue(methodPayloadAnnotation, null, String.class); @@ -94,8 +89,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat for (int i = 0; i < annotationArray.length; i++) { Annotation[] parameterAnnotations = annotationArray[i]; for (Annotation currentAnnotation : parameterAnnotations) { - if (org.springframework.integration.annotation.Payload.class.equals(currentAnnotation.annotationType()) - || Payload.class.equals(currentAnnotation.annotationType())) { + if (Payload.class.equals(currentAnnotation.annotationType())) { Assert.state(payloadExpression == null, "@Payload can be used at most once on a @Publisher method, " + "either at method-level or on a single parameter"); @@ -114,7 +108,6 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat return payloadExpression; } - @SuppressWarnings("deprecation") public Map getHeaderExpressions(Method method) { Map headerExpressions = new HashMap(); String[] parameterNames = this.parameterNameDiscoverer.getParameterNames(method); @@ -122,8 +115,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat for (int i = 0; i < annotationArray.length; i++) { Annotation[] parameterAnnotations = annotationArray[i]; for (Annotation currentAnnotation : parameterAnnotations) { - if (org.springframework.integration.annotation.Header.class.equals(currentAnnotation.annotationType()) - || Header.class.equals(currentAnnotation.annotationType())) { + if (Header.class.equals(currentAnnotation.annotationType())) { String name = getAnnotationValue(currentAnnotation, null, String.class); if (!StringUtils.hasText(name)) { name = parameterNames[i]; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MessageCodec.java b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MessageCodec.java index 188e199273..d448884312 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MessageCodec.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/codec/kryo/MessageCodec.java @@ -25,7 +25,7 @@ package org.springframework.integration.codec.kryo; public class MessageCodec extends PojoCodec { /** - * Construct an instance using the default registration ids for messsage + * Construct an instance using the default registration ids for message * headers. */ public MessageCodec() { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java index 532155d2fb..b8bcdfa374 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/CorrelationStrategyFactoryBean.java @@ -47,32 +47,6 @@ public class CorrelationStrategyFactoryBean implements FactoryBean, public ReleaseStrategyFactoryBean() { } - /** - * Create a factory and set up the strategy which clients of the factory will see as its product. - * @param target the target object (null if default strategy is acceptable) - * @deprecated since {@literal 4.2.5} in favor of appropriate setters - * to avoid {@code BeanCurrentlyInCreationException} - * during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()} - */ - @Deprecated - public ReleaseStrategyFactoryBean(Object target) { - this.target = target; - } - - /** - * Create a factory and set up the strategy which clients of the factory will see as its product. - * @param target the target object (null if default strategy is acceptable) - * @param methodName the method name to invoke in the target (null if it can be inferred) - * @deprecated since {@literal 4.2.5} in favor of appropriate setters - * to avoid {@code BeanCurrentlyInCreationException} - * during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()} - */ - @Deprecated - public ReleaseStrategyFactoryBean(Object target, String methodName) { - this.target = target; - this.methodName = methodName; - } - public void setTarget(Object target) { this.target = target; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/RouterFactoryBean.java b/spring-integration-core/src/main/java/org/springframework/integration/config/RouterFactoryBean.java index 89f4a7c937..b7dbc966c7 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/RouterFactoryBean.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/RouterFactoryBean.java @@ -63,15 +63,6 @@ public class RouterFactoryBean extends AbstractStandardMessageHandlerFactoryBean this.defaultOutputChannelName = defaultOutputChannelName; } - /** - * @param timeout the timeout. - * @deprecated in favor of {@link #setSendTimeout(Long)}. - */ - @Deprecated - public void setTimeout(Long timeout) { - this.sendTimeout = timeout; - } - public void setSendTimeout(Long timeout) { this.sendTimeout = timeout; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java index ffd61f5b56..0d91a30031 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/endpoint/ExpressionMessageProducerSupport.java @@ -54,15 +54,6 @@ public abstract class ExpressionMessageProducerSupport extends MessageProducerSu this.payloadExpression = EXPRESSION_PARSER.parseExpression(payloadExpression); } - /** - * @param payloadExpression the expression to set. - * @deprecated in favor of {@link #setPayloadExpression}. - */ - @Deprecated - public void setExpressionPayload(Expression payloadExpression) { - setPayloadExpression(payloadExpression); - } - public void setIntegrationEvaluationContext(EvaluationContext evaluationContext) { this.evaluationContext = evaluationContext; } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAware.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAware.java deleted file mode 100644 index 815c233109..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAware.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2013 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 - * - * http://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.expression; - -import org.springframework.expression.EvaluationContext; -import org.springframework.integration.context.IntegrationContextUtils; - -/** - * Interface to be implemented by beans that wish to be aware of their - * owning integration {@link EvaluationContext}, which is the result of - * {@link org.springframework.integration.config.IntegrationEvaluationContextFactoryBean} - *

- * The {@link #setIntegrationEvaluationContext} is invoked from - * the {@code IntegrationEvaluationContextAwareBeanPostProcessor#afterSingletonsInstantiated()}, - * not during standard {@code postProcessBefore(After)Initialization} to avoid any - * {@code BeanFactory} early access during integration {@link EvaluationContext} retrieval. - * Therefore, if it is necessary to use {@link EvaluationContext} in the {@code afterPropertiesSet()}, - * the {@code IntegrationContextUtils.getEvaluationContext(this.beanFactory)} should be used instead - * of this interface implementation. - * - * @author Artem Bilan - * @since 3.0 - * @deprecated since 4.2 in favor of {@link IntegrationContextUtils#getEvaluationContext} - * direct usage from the {@code afterPropertiesSet} implementation. - * Will be removed in the next release. - */ -@Deprecated -public interface IntegrationEvaluationContextAware { - - void setIntegrationEvaluationContext(EvaluationContext evaluationContext); - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAwareBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAwareBeanPostProcessor.java deleted file mode 100644 index 2e118e1c29..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/expression/IntegrationEvaluationContextAwareBeanPostProcessor.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2013-2015 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 - * - * http://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.expression; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.BeanFactory; -import org.springframework.beans.factory.BeanFactoryAware; -import org.springframework.beans.factory.SmartInitializingSingleton; -import org.springframework.beans.factory.config.BeanPostProcessor; -import org.springframework.core.Ordered; -import org.springframework.expression.spel.support.StandardEvaluationContext; -import org.springframework.integration.context.IntegrationContextUtils; - -/** - * @author Artem Bilan - * @author Gary Russell - * @since 3.0 - * @deprecated since 4.2 in favor of {@link IntegrationContextUtils#getEvaluationContext} - * direct usage from the {@code afterPropertiesSet} implementation. - * Will be removed in the next release. - */ -@Deprecated -@SuppressWarnings("deprecation") -public class IntegrationEvaluationContextAwareBeanPostProcessor - implements BeanPostProcessor, Ordered, BeanFactoryAware, SmartInitializingSingleton { - - private final List evaluationContextAwares = - new ArrayList(); - - private volatile BeanFactory beanFactory; - - @Override - public void setBeanFactory(BeanFactory beanFactory) throws BeansException { - this.beanFactory = beanFactory; - } - - @Override - public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof IntegrationEvaluationContextAware) { - this.evaluationContextAwares.add((IntegrationEvaluationContextAware) bean); - } - return bean; - } - - @Override - public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - return bean; - } - - @Override - public void afterSingletonsInstantiated() { - StandardEvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory); - for (IntegrationEvaluationContextAware evaluationContextAware : this.evaluationContextAwares) { - evaluationContextAware.setIntegrationEvaluationContext(evaluationContext); - } - } - - @Override - public int getOrder() { - return LOWEST_PRECEDENCE; - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java index 5eda8fd98b..6216595fac 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapper.java @@ -254,13 +254,9 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper toMessage(MethodArgsHolder holder) throws Exception { Object messageOrPayload = null; boolean foundPayloadAnnotation = false; @@ -290,23 +285,20 @@ class GatewayMethodInboundMessageMapper implements InboundMessageMapper returnType = invocation.getMethod().getReturnType(); if (this.asyncExecutor != null && !Object.class.equals(returnType)) { @@ -426,10 +425,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint boolean shouldReply = returnType != void.class; int paramCount = method.getParameterTypes().length; Object response = null; - @SuppressWarnings("deprecation") - boolean hasPayloadExpression = - method.isAnnotationPresent(org.springframework.integration.annotation.Payload.class) - || method.isAnnotationPresent(Payload.class); + boolean hasPayloadExpression = method.isAnnotationPresent(Payload.class); if (!hasPayloadExpression && this.methodMetadataMap != null) { // check for the method metadata next GatewayMethodMetadata metadata = this.methodMetadataMap.get(method.getName()); @@ -702,7 +698,7 @@ public class GatewayProxyFactoryBean extends AbstractEndpoint if (t instanceof RuntimeException) { throw (RuntimeException) t; } - throw new MessagingException("asynchronous gateway invocation failed", t); + throw new MessagingException("Asynchronous gateway invocation failed", t); } } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java index c687f961d9..89f5f38d27 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/LoggingHandler.java @@ -89,16 +89,6 @@ public class LoggingHandler extends AbstractMessageHandler { this.level = level; } - /** - * Set a SpEL expression string to use. - * @param expressionString the SpEL expression string to use. - * @deprecated in favor of {@link #setLogExpressionString(String)} - */ - @Deprecated - public void setExpression(String expressionString) { - setLogExpressionString(expressionString); - } - /** * Set a SpEL expression string to use. * @param expressionString the SpEL expression string to use. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java index e36cf3544f..817b0a19a9 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java @@ -92,17 +92,6 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler imple this.defaultOutputChannelName = defaultOutputChannelName; } - /** - * Set the timeout for sending a message to the resolved channel. By default, there is no timeout, meaning the send - * will block indefinitely. - * @param timeout The timeout. - * @deprecated in favor of {@link #setSendTimeout(long)}. - */ - @Deprecated - public void setTimeout(long timeout) { - this.messagingTemplate.setSendTimeout(timeout); - } - /** * Set the timeout for sending a message to the resolved channel. * By default, there is no timeout, meaning the send will block indefinitely. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java index ac4fb4a9b6..0755d54d87 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/AbstractKeyValueMessageStore.java @@ -156,29 +156,6 @@ public abstract class AbstractKeyValueMessageStore extends AbstractMessageGroupS doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, metadata); } - /** - * Remove a Message from the group with the provided group ID. - */ - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(Object groupId, Message messageToRemove) { - Assert.notNull(groupId, "'groupId' must not be null"); - Assert.notNull(messageToRemove, "'messageToRemove' must not be null"); - - UUID id = messageToRemove.getHeaders().getId(); - removeMessage(id); - - MessageGroupMetadata metadata = getGroupMetadata(groupId); - if (metadata != null) { - metadata.remove(id); - metadata.setLastModified(System.currentTimeMillis()); - doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, metadata); - } - - return getMessageGroup(groupId); - } - - @Override public void removeMessagesFromGroup(Object groupId, Collection> messages) { Assert.notNull(groupId, "'groupId' must not be null"); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java index b434f8f46c..cf5b8b3e5f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/MessageGroupStore.java @@ -54,17 +54,6 @@ public interface MessageGroupStore extends BasicMessageGroupStore { @ManagedAttribute int getMessageGroupCount(); - /** - * Persist the deletion of a single message from the group. - * The group is modified to reflect that 'messageToRemove' is no longer present in the group. - * @param key The groupId for the group containing the message. - * @param messageToRemove The message to be removed. - * @return The message Group. - * @deprecated in favor of {@link #removeMessagesFromGroup} - */ - @Deprecated - MessageGroup removeMessageFromGroup(Object key, Message messageToRemove); - /** * Persist the deletion of messages from the group. * @param key The groupId for the group containing the message(s). diff --git a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java index 4e37c45272..4801444ae0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/store/SimpleMessageStore.java @@ -324,34 +324,6 @@ public class SimpleMessageStore extends AbstractMessageGroupStore } } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(Object groupId, Message messageToRemove) { - Lock lock = this.lockRegistry.obtain(groupId); - try { - lock.lockInterruptibly(); - try { - MessageGroup group = this.groupIdToMessageGroup.get(groupId); - Assert.notNull(group, "MessageGroup for groupId '" + groupId + "' " + - "can not be located while attempting to remove Message from the MessageGroup"); - if (group.remove(messageToRemove)) { - UpperBound upperBound = this.groupToUpperBound.get(groupId); - Assert.state(upperBound != null, "'upperBound' must not be null."); - upperBound.release(); - group.setLastModified(System.currentTimeMillis()); - } - return group; - } - finally { - lock.unlock(); - } - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new MessagingException("Interrupted while obtaining lock", e); - } - } - @Override public void removeMessagesFromGroup(Object groupId, Collection> messages) { Lock lock = this.lockRegistry.obtain(groupId); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingChannelInterceptor.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingChannelInterceptor.java deleted file mode 100644 index ad727e644f..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MessageTransformingChannelInterceptor.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2002-2013 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 - * - * http://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.transformer; - -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.support.ChannelInterceptor; -import org.springframework.messaging.support.ChannelInterceptorAdapter; - -/** - * A {@link ChannelInterceptor} which invokes a {@link Transformer} - * when either sending-to or receiving-from a channel. - * - * @deprecated It is not generally recommended to perform functions - * such as transformation in a channel interceptor. - * - * @author Jonas Partner - */ -@Deprecated -public class MessageTransformingChannelInterceptor extends ChannelInterceptorAdapter { - - private final Transformer transformer; - - private volatile boolean transformOnSend = true; - - - public MessageTransformingChannelInterceptor(Transformer transformer) { - this.transformer = transformer; - } - - - public boolean getTransformOnSend() { - return this.transformOnSend; - } - - public void setTransformOnSend(boolean transformOnSend) { - this.transformOnSend = transformOnSend; - } - - @Override - public Message preSend(Message message, MessageChannel channel) { - if (this.transformOnSend) { - message = this.transformer.transform(message); - } - return message; - } - - @Override - public Message postReceive(Message message, MessageChannel channel) { - if (!this.transformOnSend) { - message = this.transformer.transform(message); - } - return message; - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingAnnotationUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingAnnotationUtils.java index 3014bdb949..60f0030b8c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingAnnotationUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingAnnotationUtils.java @@ -105,7 +105,6 @@ public final class MessagingAnnotationUtils { * @throws MessagingException if more than one of {@link Payload}, {@link Header} * or {@link Headers} annotations are presented. */ - @SuppressWarnings("deprecation") public static Annotation findMessagePartAnnotation(Annotation[] annotations, boolean payloads) { if (annotations == null || annotations.length == 0) { return null; @@ -113,11 +112,8 @@ public final class MessagingAnnotationUtils { Annotation match = null; for (Annotation annotation : annotations) { Class type = annotation.annotationType(); - if (type.equals(org.springframework.integration.annotation.Payload.class) - || type.equals(Payload.class) - || type.equals(org.springframework.integration.annotation.Header.class) + if (type.equals(Payload.class) || type.equals(Header.class) - || type.equals(org.springframework.integration.annotation.Headers.class) || type.equals(Headers.class) || (payloads && type.equals(Payloads.class))) { if (match != null) { diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java index 2f56eea796..379574390c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/MessagingMethodInvokerHelper.java @@ -697,7 +697,6 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator return this.method.toString(); } - @SuppressWarnings("deprecation") private Expression generateExpression(Method method) { StringBuilder sb = new StringBuilder("#target." + method.getName() + "("); Class[] parameterTypes = method.getParameterTypes(); @@ -714,8 +713,7 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator MessagingAnnotationUtils.findMessagePartAnnotation(parameterAnnotations[i], true); if (mappingAnnotation != null) { Class annotationType = mappingAnnotation.annotationType(); - if (annotationType.equals(org.springframework.integration.annotation.Payload.class) - || annotationType.equals(Payload.class)) { + if (annotationType.equals(Payload.class)) { sb.append("payload"); String qualifierExpression = (String) AnnotationUtils.getValue(mappingAnnotation); if (StringUtils.hasText(qualifierExpression)) { @@ -736,14 +734,12 @@ public class MessagingMethodInvokerHelper extends AbstractExpressionEvaluator this.setExclusiveTargetParameterType(parameterTypeDescriptor, methodParameter); } } - else if (annotationType.equals(org.springframework.integration.annotation.Headers.class) - || annotationType.equals(Headers.class)) { + else if (annotationType.equals(Headers.class)) { Assert.isTrue(Map.class.isAssignableFrom(parameterType), "The @Headers annotation can only be applied to a Map-typed parameter."); sb.append("headers"); } - else if (annotationType.equals(org.springframework.integration.annotation.Header.class) - || annotationType.equals(Header.class)) { + else if (annotationType.equals(Header.class)) { sb.append(this.determineHeaderExpression(mappingAnnotation, methodParameter)); } } diff --git a/spring-integration-core/src/main/resources/org/springframework/integration/config/spring-integration-5.0.xsd b/spring-integration-core/src/main/resources/org/springframework/integration/config/spring-integration-5.0.xsd index ea5489a092..7c821c0197 100644 --- a/spring-integration-core/src/main/resources/org/springframework/integration/config/spring-integration-5.0.xsd +++ b/spring-integration-core/src/main/resources/org/springframework/integration/config/spring-integration-5.0.xsd @@ -785,19 +785,6 @@ - - - - DEPRECATED with no-op in favor of global JVM-wide Reactor configuration. - Provide a reference to 'reactor.core.Environment' - to use for any of the interface methods that have a 'reactor.core.composable.Promise' return type. - The Reactor's Environment will only be used for those async methods; the sync methods - will be invoked in the caller's thread. - This attribute is required if any 'service-interface' methods - have a 'reactor.core.composable.Promise' return type. - - - @@ -3488,17 +3475,6 @@ - - - - Specify the maximum amount of time in milliseconds to wait - when sending Messages to the target MessageChannels if blocking - is possible (e.g. a bounded queue channel that is currently full). - By default the send will block indefinitely. - DEPRECATED in favor of 'send-timeout' for consistency with other elements. - - - diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests-context.xml b/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests-context.xml index 51559d4876..7491ae944c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests-context.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/SendTimeoutConfigurationTests-context.xml @@ -9,7 +9,7 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RecipientListRouterParserTests-context.xml b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RecipientListRouterParserTests-context.xml index 5aa4db3b39..63257d288c 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RecipientListRouterParserTests-context.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RecipientListRouterParserTests-context.xml @@ -29,9 +29,9 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests-context.xml b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests-context.xml index 6f9e050cab..fb95b98e3e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests-context.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/RouterParserTests-context.xml @@ -79,7 +79,7 @@ - + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java index c00e624614..961634c137 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/store/MessageStoreTests.java @@ -105,12 +105,6 @@ public class MessageStoreTests { return removed ? new SimpleMessageGroup(correlationKey) : testMessages; } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(Object key, Message messageToRemove) { - throw new UnsupportedOperationException(); - } - @Override public void removeMessagesFromGroup(Object key, Collection> messages) { throw new UnsupportedOperationException(); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileHeaders.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileHeaders.java index b561d08ce7..ec1ac7e973 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileHeaders.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileHeaders.java @@ -35,12 +35,6 @@ public abstract class FileHeaders { public static final String REMOTE_FILE = PREFIX + "remoteFile"; - /** - * @deprecated - use {@code IntegrationMessageHeaderAccessor#CLOSEABLE_RESOURCE}. - */ - @Deprecated - public static final String REMOTE_SESSION = PREFIX + "remoteSession"; - public static final String RENAME_TO = PREFIX + "renameTo"; public static final String SET_MODIFIED = PREFIX + "setModified"; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java index 1578010356..0a065d7dc1 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/FileReadingMessageSource.java @@ -392,18 +392,6 @@ public class FileReadingMessageSource extends IntegrationObjectSupport implement this.toBeReceived.offer(failedMessage.getPayload()); } - /** - * The message is just logged. It was already removed from the queue during - * the call to receive() - * @param sentMessage the message that was successfully delivered - * @deprecated with no replacement. Redundant method. - */ - @Deprecated - public void onSend(Message sentMessage) { - if (logger.isDebugEnabled()) { - logger.debug("Sent: " + sentMessage); - } - } public enum WatchEventType { diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScanner.java b/spring-integration-file/src/main/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScanner.java deleted file mode 100644 index 4269e7f47c..0000000000 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScanner.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2002-2015 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 - * - * http://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.file; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * DirectoryScanner that lists all files inside a directory and subdirectories, - * without limit. This scanner should not be used with directories that contain - * a vast number of files or on deep trees, as all the file names will be read - * into memory and the scanning will be done recursively. - * - * @author Iwein Fuld - * @author Gary Russell - * - * @deprecated in favor of {@link FileReadingMessageSource#setUseWatchService(boolean)} (when using Java 7 or later) - */ -@Deprecated -public class RecursiveLeafOnlyDirectoryScanner extends DefaultDirectoryScanner { - - @Override - protected File[] listEligibleFiles(File directory) throws IllegalArgumentException { - File[] rootFiles = directory.listFiles(); - if (rootFiles == null) { - return new File[0]; - } - List files = new ArrayList(rootFiles.length); - for (File rootFile : rootFiles) { - if (rootFile.isDirectory()) { - files.addAll(Arrays.asList(listEligibleFiles(rootFile))); - } - else { - files.add(rootFile); - } - } - return files.toArray(new File[files.size()]); - } - -} diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java b/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java deleted file mode 100644 index d6798b0561..0000000000 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/WatchServiceDirectoryScanner.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2015-2016 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 - * - * http://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.file; - -import java.io.File; -import java.io.IOException; -import java.nio.file.FileSystems; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.StandardWatchEventKinds; -import java.nio.file.WatchEvent; -import java.nio.file.WatchKey; -import java.nio.file.WatchService; -import java.nio.file.attribute.BasicFileAttributes; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.context.SmartLifecycle; -import org.springframework.util.Assert; - -/** - * Directory scanner that uses Java 7 {@link WatchService}. - * - * The initial state of the directory is collected during {@link #start()}. Subsequent - * polls return new files as reported by {@code ENTRY_CREATE} events. - *

- * While initially walking the directory, any subdirectories encountered are registered - * to watch for creation events. - *

- * If subdirectories are subsequently added, they are walked and registered for - * new creation events, too. - *

- * When a {@link StandardWatchEventKinds#OVERFLOW} {@link WatchKey} event is occurred, - * the {@link #directory} is rescanned to avoid the loss for any new entries according - * to the "missed events" logic around {@link StandardWatchEventKinds#OVERFLOW}. - * - * @author Hezi Schrager - * @author Gary Russell - * @author Artem Bilan - * @since 4.2 - * @deprecated since 4.3 in favor of internal {@link WatchService} logic in the {@link FileReadingMessageSource}. - * Will be removed in Spring Integration 5.0. - * - */ -@Deprecated -@SuppressWarnings("deprecation") -public class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements SmartLifecycle { - - private final static Log logger = LogFactory.getLog(WatchServiceDirectoryScanner.class); - - private final Path directory; - - private volatile WatchService watcher; - - private volatile int phase; - - private volatile boolean running; - - private volatile boolean autoStartup; - - private volatile Collection initialFiles; - - /** - * Construct an instance for the given directory. - * @param directory the directory. - */ - public WatchServiceDirectoryScanner(String directory) { - this.directory = Paths.get(directory); - } - - @Override - public int getPhase() { - return this.phase; - } - - /** - * see {@link #getPhase()} - * @param phase the phase. - */ - public void setPhase(int phase) { - this.phase = phase; - } - - @Override - public boolean isRunning() { - return this.running; - } - - /** - * @see #isRunning() - * @param running true if running. - */ - public void setRunning(boolean running) { - this.running = running; - } - - @Override - public boolean isAutoStartup() { - return this.autoStartup; - } - - /** - * @see #isAutoStartup() - * @param autoStartup true to auto start. - */ - public void setAutoStartup(boolean autoStartup) { - this.autoStartup = autoStartup; - } - - @Override - public synchronized void start() { - if (!this.running) { - try { - this.watcher = FileSystems.getDefault().newWatchService(); - } - catch (IOException e) { - logger.error("Failed to create watcher for " + this.directory.toString(), e); - } - final Set initialFiles = walkDirectory(this.directory); - initialFiles.addAll(filesFromEvents()); - this.initialFiles = initialFiles; - this.running = true; - } - } - - @Override - public synchronized void stop() { - if (this.running) { - try { - this.watcher.close(); - } - catch (IOException e) { - logger.error("Failed to close watcher for " + this.directory.toString(), e); - } - this.running = false; - } - } - - @Override - public void stop(Runnable callback) { - stop(); - callback.run(); - } - - @Override - protected File[] listEligibleFiles(File directory) { - Assert.state(this.watcher != null, "Scanner needs to be started"); - if (this.initialFiles != null) { - File[] initial = this.initialFiles.toArray(new File[this.initialFiles.size()]); - this.initialFiles = null; - return initial; - } - Collection files = filesFromEvents(); - return files.toArray(new File[files.size()]); - } - - private Set filesFromEvents() { - WatchKey key = this.watcher.poll(); - Set files = new LinkedHashSet(); - while (key != null) { - for (WatchEvent event : key.pollEvents()) { - if (event.kind() == StandardWatchEventKinds.ENTRY_CREATE) { - Path item = (Path) event.context(); - File file = new File(((Path) key.watchable()).toAbsolutePath() + File.separator + item.getFileName()); - if (logger.isDebugEnabled()) { - logger.debug("Watch Event: " + event.kind() + ": " + file); - } - if (file.isDirectory()) { - files.addAll(walkDirectory(file.toPath())); - } - else { - files.add(file); - } - } - else if (event.kind() == StandardWatchEventKinds.OVERFLOW) { - if (logger.isDebugEnabled()) { - logger.debug("Watch Event: " + event.kind() + ": context: " + event.context()); - } - if (event.context() != null && event.context() instanceof Path) { - files.addAll(walkDirectory((Path) event.context())); - } - else { - files.addAll(walkDirectory(this.directory)); - } - } - else { - if (logger.isDebugEnabled()) { - logger.debug("Watch Event: " + event.kind() + ": context: " + event.context()); - } - } - } - key.reset(); - key = this.watcher.poll(); - } - return files; - } - - private Set walkDirectory(Path directory) { - final Set walkedFiles = new LinkedHashSet(); - try { - registerWatch(directory); - Files.walkFileTree(directory, new SimpleFileVisitor() { - - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { - FileVisitResult fileVisitResult = super.preVisitDirectory(dir, attrs); - registerWatch(dir); - return fileVisitResult; - } - - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - FileVisitResult fileVisitResult = super.visitFile(file, attrs); - walkedFiles.add(file.toFile()); - return fileVisitResult; - } - - }); - } - catch (IOException e) { - logger.error("Failed to walk directory: " + directory.toString(), e); - } - return walkedFiles; - } - - private void registerWatch(Path dir) throws IOException { - if (logger.isDebugEnabled()) { - logger.debug("registering: " + dir + " for file creation events"); - } - dir.register(this.watcher, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY); - } - -} diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java index afa956d2ae..2aeeb64513 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java @@ -394,15 +394,6 @@ public abstract class AbstractRemoteFileOutboundGateway extends AbstractReply setRenameExpression(EXPRESSION_PARSER.parseExpression(renameExpression)); } - /** - * @param expression the expression to set. - * @deprecated in favor of {@link #setRenameExpression}. - */ - @Deprecated - public void setExpressionRename(Expression expression) { - setRenameExpression(expression); - } - /** * @param localFilenameGeneratorExpression the expression to use. * @since 3.0 diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScannerTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScannerTests.java deleted file mode 100644 index f415efac7b..0000000000 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/RecursiveLeafOnlyDirectoryScannerTests.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2002-2015 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 - * - * http://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.file; - -import static org.hamcrest.CoreMatchers.hasItem; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; - -import java.io.File; -import java.io.IOException; -import java.util.List; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -/** - * @author Iwein Fuld - * @author Gunnar Hillert - * @author Gary Russell - */ -public class RecursiveLeafOnlyDirectoryScannerTests { - - private File folderThatShouldBeIgnored; - - private File subFolderThatShouldBeIgnored; - - private File topLevelFile; - - private File subLevelFile; - - private File subSubLevelFile; - - - @Rule - public TemporaryFolder recursivePath = new TemporaryFolder() { - - @Override - public void create() throws IOException { - super.create(); - folderThatShouldBeIgnored = this.newFolder("shouldBeIgnored"); - subFolderThatShouldBeIgnored = new File(folderThatShouldBeIgnored, "shouldBeIgnored"); - subFolderThatShouldBeIgnored.mkdir(); - topLevelFile = this.newFile("file1"); - subLevelFile = new File(folderThatShouldBeIgnored, "file2"); - subLevelFile.createNewFile(); - subSubLevelFile = new File(subFolderThatShouldBeIgnored, "file2"); - subSubLevelFile.createNewFile(); - } - }; - - - @Test - public void shouldReturnAllFiles() { - @SuppressWarnings("deprecation") - List files = new RecursiveLeafOnlyDirectoryScanner().listFiles(recursivePath.getRoot()); - assertEquals(Integer.valueOf(files.size()), Integer.valueOf(3)); - assertThat(files, hasItem(topLevelFile)); - assertThat(files, hasItem(subLevelFile)); - assertThat(files, hasItem(subSubLevelFile)); - } - -} diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests-context.xml b/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests-context.xml deleted file mode 100644 index 250da45178..0000000000 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests-context.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests.java deleted file mode 100644 index 650a70a278..0000000000 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/recursive/FileInboundChannelAdapterWithRecursiveDirectoryTests.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2002-2016 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 - * - * http://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.file.recursive; - -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.springframework.integration.test.matcher.PayloadMatcher.hasPayload; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.messaging.Message; -import org.springframework.messaging.PollableChannel; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.annotation.DirtiesContext.ClassMode; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -/** - * @author Iwein Fuld - * @author Gunnar Hillert - */ -@ContextConfiguration -@RunWith(SpringJUnit4ClassRunner.class) -@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD) -public class FileInboundChannelAdapterWithRecursiveDirectoryTests { - - @Autowired - private TemporaryFolder directory; - - @Autowired - private PollableChannel files; - - @Test(timeout = 10000) - public void shouldScanDirectoriesRecursively() throws IOException { - - //when - File folder = directory.newFolder("foo"); - File file = new File(folder, "bar"); - assertTrue(file.createNewFile()); - - //verify - assertThat(files.receive(), hasPayload(file)); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Test(timeout = 10000) - public void shouldReturnFilesMultipleLevels() throws IOException { - File folder = directory.newFolder("foo"); - File siblingFile = directory.newFile("bar"); - File childFile = new File(folder, "baz"); - assertTrue(childFile.createNewFile()); - - List received = Arrays.asList((Message) files.receive(), files.receive()); - assertThat(received, containsInAnyOrder(hasPayload(siblingFile), hasPayload(childFile))); - } - -} diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java index a305a0e496..92f30e44c2 100644 --- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java +++ b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/store/GemfireMessageStore.java @@ -62,25 +62,12 @@ public class GemfireMessageStore extends AbstractKeyValueMessageStore implements this.messageStoreRegion = messageStoreRegion; } - /** - * Provides a cache reference used to create a message store region named - * 'messageStoreRegion' - * @param cache The cache. - * - * @deprecated - use the other constructor and provide a region directly. - */ - @Deprecated - public GemfireMessageStore(Cache cache) { - Assert.notNull(cache, "'cache' must not be null"); - this.cache = cache; - } - public void setIgnoreJta(boolean ignoreJta) { this.ignoreJta = ignoreJta; } @Override - @SuppressWarnings({ "unchecked", "deprecation" }) + @SuppressWarnings("unchecked") public void afterPropertiesSet() { if (this.messageStoreRegion != null) { return; diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests-context.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests-context.xml index fa4f0dd2a3..840194ba32 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests-context.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests-context.xml @@ -7,7 +7,7 @@ + value="#{T (org.springframework.integration.gemfire.store.DelayerHandlerRescheduleIntegrationTests).region}"/> diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java index ecc622dd89..8fcd0fb443 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/DelayerHandlerRescheduleIntegrationTests.java @@ -43,6 +43,10 @@ import org.springframework.messaging.MessageChannel; import org.springframework.messaging.PollableChannel; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.Scope; + /** * @author Artem Bilan @@ -53,7 +57,9 @@ public class DelayerHandlerRescheduleIntegrationTests { public static final String DELAYER_ID = "delayerWithGemfireMS"; - public static CacheFactoryBean cacheFactoryBean; + public static Region region; + + private static CacheFactoryBean cacheFactoryBean; @ClassRule public static LongRunningIntegrationTest longTests = new LongRunningIntegrationTest(); @@ -62,10 +68,15 @@ public class DelayerHandlerRescheduleIntegrationTests { public static void startUp() throws Exception { cacheFactoryBean = new CacheFactoryBean(); cacheFactoryBean.afterPropertiesSet(); + Cache cache = cacheFactoryBean.getObject(); + region = cache.createRegionFactory().setScope(Scope.LOCAL).create("sig-tests"); } @AfterClass public static void cleanUp() throws Exception { + if (region != null) { + region.close(); + } if (cacheFactoryBean != null) { cacheFactoryBean.destroy(); } diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/GemfireGroupStoreTests.java b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/GemfireGroupStoreTests.java index 45a4564c7e..81e21f92ac 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/GemfireGroupStoreTests.java +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/GemfireGroupStoreTests.java @@ -62,9 +62,9 @@ import junit.framework.AssertionFailedError; */ public class GemfireGroupStoreTests { - public static CacheFactoryBean cacheFactoryBean; + private static CacheFactoryBean cacheFactoryBean; - private static Region region; + public static Region region; @Test public void testNonExistingEmptyMessageGroup() throws Exception { diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config-a.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config-a.xml index 500f4f5315..0dc40df049 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config-a.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config-a.xml @@ -13,7 +13,7 @@ + value="#{T (org.springframework.integration.gemfire.store.GemfireGroupStoreTests).region}"/> diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config.xml index 500f4f5315..0dc40df049 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-aggregator-config.xml @@ -13,7 +13,7 @@ + value="#{T (org.springframework.integration.gemfire.store.GemfireGroupStoreTests).region}"/> diff --git a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-queue-config.xml b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-queue-config.xml index 632100b8f4..c78ae6edb4 100644 --- a/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-queue-config.xml +++ b/spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/store/gemfire-queue-config.xml @@ -20,7 +20,7 @@ + value="#{T (org.springframework.integration.gemfire.store.GemfireGroupStoreTests).region}"/> diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java index 7684773442..ad68af0111 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpAdapterParserUtils.java @@ -134,16 +134,7 @@ public abstract class IpAdapterParserUtils { * @param builder the bean definition builder to be configured * @param element the XML element where the attribute should be defined * @param attributeName the name of the attribute whose value will be - * @param trueFalse not used - * used to populate the property - * @deprecated in favor of {@link #addConstructorValueIfAttributeDefined}. */ - @Deprecated - public static void addConstuctorValueIfAttributeDefined(BeanDefinitionBuilder builder, - Element element, String attributeName, boolean trueFalse) { - addConstructorValueIfAttributeDefined(builder, element, attributeName); - } - public static void addConstructorValueIfAttributeDefined(BeanDefinitionBuilder builder, Element element, String attributeName) { String attributeValue = element.getAttribute(attributeName); diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpNamespaceHandler.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpNamespaceHandler.java index e90ca7e651..04adedd2fb 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpNamespaceHandler.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/IpNamespaceHandler.java @@ -26,7 +26,6 @@ import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHa */ public class IpNamespaceHandler extends AbstractIntegrationNamespaceHandler { - @SuppressWarnings("deprecation") public void init() { this.registerBeanDefinitionParser("udp-inbound-channel-adapter", new UdpInboundChannelAdapterParser()); this.registerBeanDefinitionParser("udp-outbound-channel-adapter", new UdpOutboundChannelAdapterParser()); @@ -35,7 +34,6 @@ public class IpNamespaceHandler extends AbstractIntegrationNamespaceHandler { this.registerBeanDefinitionParser("tcp-connection-factory", new TcpConnectionFactoryParser()); this.registerBeanDefinitionParser("tcp-inbound-channel-adapter", new TcpInboundChannelAdapterParser()); this.registerBeanDefinitionParser("tcp-outbound-channel-adapter", new TcpOutboundChannelAdapterParser()); - this.registerBeanDefinitionParser("tcp-connection-event-inbound-channel-adapter", new TcpConnectionEventInboundChannelAdapterParser()); } } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionEventInboundChannelAdapterParser.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionEventInboundChannelAdapterParser.java deleted file mode 100644 index 268d0e167c..0000000000 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/config/TcpConnectionEventInboundChannelAdapterParser.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2002-2015 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 - * - * http://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.ip.config; - -import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.config.xml.AbstractChannelAdapterParser; -import org.springframework.integration.config.xml.IntegrationNamespaceUtils; - -import org.w3c.dom.Element; - -/** - * @author Gary Russell - * @since 3.0 - * - * @deprecated in favor of the generic event adapter. - */ -@Deprecated -public class TcpConnectionEventInboundChannelAdapterParser extends AbstractChannelAdapterParser { - - @Override - @SuppressWarnings("deprecation") - protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) { - BeanDefinitionBuilder adapterBuilder = BeanDefinitionBuilder - .rootBeanDefinition(org.springframework.integration.ip.tcp.connection.TcpConnectionEventListeningMessageProducer.class); - adapterBuilder.addPropertyReference("outputChannel", channelName); - IntegrationNamespaceUtils.setReferenceIfAttributeDefined(adapterBuilder, element, "error-channel", "errorChannel"); - IntegrationNamespaceUtils.setValueIfAttributeDefined(adapterBuilder, element, "event-types"); - return adapterBuilder.getBeanDefinition(); - } - -} diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java deleted file mode 100644 index 5fea43f1e9..0000000000 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListeningMessageProducer.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2002-2016 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 - * - * http://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.ip.tcp.connection; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.springframework.context.ApplicationListener; -import org.springframework.integration.core.MessageProducer; -import org.springframework.integration.endpoint.MessageProducerSupport; -import org.springframework.messaging.Message; -import org.springframework.util.Assert; -import org.springframework.util.CollectionUtils; - -/** - * {@link MessageProducer} that produces Messages with @link {@link TcpConnectionEvent} - * payloads. - * @author Gary Russell - * @since 3.0 - * - * @deprecated in favor of using the generic {@code ApplicationEventListeningMessageProducer} which - * can now more efficiently filter required events. Configure the adapter to handle - * {@link TcpConnectionEvent}. - * - */ -@Deprecated -public class TcpConnectionEventListeningMessageProducer extends MessageProducerSupport - implements ApplicationListener { - - private volatile Set> eventTypes = - new HashSet>(); - - /** - * Set the list of event types (classes that extend TcpConnectionEvent) that - * this adapter should send to the message channel. By default, all event - * types will be sent. - * - * @param eventTypes The event types. - */ - public void setEventTypes(Class[] eventTypes) { - Assert.notEmpty(eventTypes, "at least one event type is required"); - Set> eventTypeSet = new HashSet>(); - eventTypeSet.addAll(Arrays.asList(eventTypes)); - this.eventTypes = eventTypeSet; - } - - @Override - public String getComponentType() { - return "ip:tcp-connection-event-inbound-channel-adapter"; - } - - @Override - public void onApplicationEvent(TcpConnectionEvent event) { - if (this.isRunning()) { - if (CollectionUtils.isEmpty(this.eventTypes)) { - this.sendMessage(messageFromEvent(event)); - } - else { - for (Class eventType : this.eventTypes) { - if (eventType.isAssignableFrom(event.getClass())) { - this.sendMessage(messageFromEvent(event)); - break; - } - } - } - } - } - - protected Message messageFromEvent(TcpConnectionEvent event) { - return this.getMessageBuilderFactory().withPayload(event).build(); - } - -} diff --git a/spring-integration-ip/src/main/resources/org/springframework/integration/ip/config/spring-integration-ip-5.0.xsd b/spring-integration-ip/src/main/resources/org/springframework/integration/ip/config/spring-integration-ip-5.0.xsd index fd5c4e0813..33b00a26c6 100644 --- a/spring-integration-ip/src/main/resources/org/springframework/integration/ip/config/spring-integration-ip-5.0.xsd +++ b/spring-integration-ip/src/main/resources/org/springframework/integration/ip/config/spring-integration-ip-5.0.xsd @@ -755,71 +755,6 @@ - - - - [DEPRECATED: Use an event inbound channel adapter instead] - Configures an inbound Channel Adapter which - listens for TCP Connection - events, converts them to Messages and - sends them to a Message Channel. - - - - - - - - Comma delimited list of event types (classes that extend - TcpConnectionEvent) that this adapter - should send to the message channel. By default, all event types will be - sent [OPTIONAL]. - Note, it is NOT possible to filter by subtype, just class - for - example, the standard TcpConnectionEvent - class has 3 subtypes (OPEN, CLOSE, EXCEPTION). This feature is intended - to allow the adapter to - be used, say, to obtain just subclasses of TcpConnectionEvent - (perhaps generated by a - TcpConnectionInterceptor, perhaps to signal handshaking of some kind). - - - - - - - - - - - - The channel to which Messages generated from Application Context - events will be sent. - - - - - - - - - - - - If a (synchronous) downstream exception is thrown and an - error-channel is specified, - a MessagingException will be sent to this channel. Otherwise, any - such exception - will be propagated to the caller. - - - - - - - diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests-context.xml b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests-context.xml index a03d72240b..ccc7f8d8ea 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests-context.xml +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests-context.xml @@ -4,14 +4,12 @@ xmlns:int="http://www.springframework.org/schema/integration" xmlns:ip="http://www.springframework.org/schema/integration/ip" xmlns:task="http://www.springframework.org/schema/task" - xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> @@ -432,13 +430,4 @@ - - - - - - - diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests.java index ab46185fb3..95ef011231 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/config/ParserUnitTests.java @@ -272,13 +272,6 @@ public class ParserUnitTests { @Autowired TcpMessageMapper mapper; - @SuppressWarnings("deprecation") - @Autowired - org.springframework.integration.ip.tcp.connection.TcpConnectionEventListeningMessageProducer eventAdapter; - - @Autowired - QueueChannel eventChannel; - private static CountDownLatch adviceCalled = new CountDownLatch(1); @Test @@ -669,31 +662,6 @@ public class ParserUnitTests { assertSame(socketSupport, dfa.getPropertyValue("tcpSocketSupport")); } - @SuppressWarnings({ "unchecked", "deprecation" }) - @Test - public void testEventAdapter() { - Set eventTypes = TestUtils.getPropertyValue(this.eventAdapter, "eventTypes", Set.class); - assertEquals(2, eventTypes.size()); - assertTrue(eventTypes.contains(EventSubclass1.class)); - assertTrue(eventTypes.contains(EventSubclass2.class)); - assertFalse(TestUtils.getPropertyValue(this.eventAdapter, "autoStartup", Boolean.class)); - assertEquals(23, TestUtils.getPropertyValue(this.eventAdapter, "phase")); - assertEquals("eventErrors", TestUtils.getPropertyValue(this.eventAdapter, "errorChannel", - DirectChannel.class).getComponentName()); - - TcpConnectionSupport connection = mock(TcpConnectionSupport.class); - TcpConnectionEvent event = new TcpConnectionOpenEvent(connection, "foo"); - Class[] types = (Class[]) new Class[]{TcpConnectionEvent.class}; - this.eventAdapter.setEventTypes(types); - this.eventAdapter.onApplicationEvent(event); - assertNull(this.eventChannel.receive(0)); - this.eventAdapter.start(); - this.eventAdapter.onApplicationEvent(event); - Message eventMessage = this.eventChannel.receive(0); - assertNotNull(eventMessage); - assertSame(event, eventMessage.getPayload()); - } - public static class FooAdvice extends AbstractRequestHandlerAdvice { @Override diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests-context.xml b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests-context.xml index e762803a6e..8163bd2a5c 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests-context.xml +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ConnectionToConnectionTests-context.xml @@ -3,11 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-ip="http://www.springframework.org/schema/integration/ip" + xmlns:int-event="http://www.springframework.org/schema/integration/event" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/integration/event http://www.springframework.org/schema/integration/event/spring-integration-event.xsd"> @@ -70,7 +72,8 @@ - + diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java index 7bbf96c8b5..b1ce987712 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/connection/TcpConnectionEventListenerTests.java @@ -16,41 +16,60 @@ package org.springframework.integration.ip.tcp.connection; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; import org.junit.Test; import org.mockito.Mockito; import org.springframework.beans.factory.BeanFactory; +import org.springframework.context.event.ApplicationEventMulticaster; +import org.springframework.context.support.AbstractApplicationContext; +import org.springframework.core.ResolvableType; import org.springframework.integration.channel.QueueChannel; +import org.springframework.integration.event.inbound.ApplicationEventListeningMessageProducer; import org.springframework.messaging.Message; /** * @author Gary Russell + * @author Artem Bilan * @since 3.0 * */ public class TcpConnectionEventListenerTests { - @SuppressWarnings("deprecation") @Test public void testNoFilter() { - TcpConnectionEventListeningMessageProducer eventProducer = new TcpConnectionEventListeningMessageProducer(); + ApplicationEventListeningMessageProducer eventProducer = new ApplicationEventListeningMessageProducer(); QueueChannel outputChannel = new QueueChannel(); eventProducer.setOutputChannel(outputChannel); - eventProducer.setBeanFactory(mock(BeanFactory.class)); + eventProducer.setEventTypes(TcpConnectionEvent.class); + BeanFactory mock = mock(BeanFactory.class); + given(mock.getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, + ApplicationEventMulticaster.class)) + .willReturn(mock(ApplicationEventMulticaster.class)); + eventProducer.setBeanFactory(mock); eventProducer.afterPropertiesSet(); eventProducer.start(); TcpConnectionSupport connection = Mockito.mock(TcpConnectionSupport.class); + + assertTrue(eventProducer.supportsEventType(ResolvableType.forClass(TcpConnectionOpenEvent.class))); TcpConnectionEvent event1 = new TcpConnectionOpenEvent(connection, "foo"); eventProducer.onApplicationEvent(event1); + + assertTrue(eventProducer.supportsEventType(ResolvableType.forClass(FooEvent.class))); FooEvent event2 = new FooEvent(connection, "foo"); eventProducer.onApplicationEvent(event2); + + assertTrue(eventProducer.supportsEventType(ResolvableType.forClass(BarEvent.class))); BarEvent event3 = new BarEvent(connection, "foo"); eventProducer.onApplicationEvent(event3); + Message message = outputChannel.receive(0); assertNotNull(message); assertSame(event1, message.getPayload()); @@ -64,24 +83,31 @@ public class TcpConnectionEventListenerTests { assertNull(message); } - @SuppressWarnings({ "unchecked", "deprecation" }) @Test public void testFilter() { - TcpConnectionEventListeningMessageProducer eventProducer = new TcpConnectionEventListeningMessageProducer(); + ApplicationEventListeningMessageProducer eventProducer = new ApplicationEventListeningMessageProducer(); QueueChannel outputChannel = new QueueChannel(); eventProducer.setOutputChannel(outputChannel); - Class[] eventTypes = new Class[]{FooEvent.class, BarEvent.class}; - eventProducer.setEventTypes((Class[]) eventTypes); - eventProducer.setBeanFactory(mock(BeanFactory.class)); + eventProducer.setEventTypes(FooEvent.class, BarEvent.class); + BeanFactory mock = mock(BeanFactory.class); + given(mock.getBean(AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME, + ApplicationEventMulticaster.class)) + .willReturn(mock(ApplicationEventMulticaster.class)); + eventProducer.setBeanFactory(mock); eventProducer.afterPropertiesSet(); eventProducer.start(); TcpConnectionSupport connection = Mockito.mock(TcpConnectionSupport.class); - TcpConnectionEvent event1 = new TcpConnectionOpenEvent(connection, "foo"); - eventProducer.onApplicationEvent(event1); + + assertFalse(eventProducer.supportsEventType(ResolvableType.forClass(TcpConnectionOpenEvent.class))); + + assertTrue(eventProducer.supportsEventType(ResolvableType.forClass(FooEvent.class))); FooEvent event2 = new FooEvent(connection, "foo"); eventProducer.onApplicationEvent(event2); + + assertTrue(eventProducer.supportsEventType(ResolvableType.forClass(BarEvent.class))); BarEvent event3 = new BarEvent(connection, "foo"); eventProducer.onApplicationEvent(event3); + Message message = outputChannel.receive(0); assertNotNull(message); assertSame(event2, message.getPayload()); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java index fe079d3e6c..87173a360d 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/JdbcMessageStore.java @@ -468,29 +468,6 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa return messageGroup; } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(Object groupId, Message messageToRemove) { - final String groupKey = getKey(groupId); - final String messageId = getKey(messageToRemove.getHeaders().getId()); - - this.jdbcTemplate.update(getQuery(Query.REMOVE_MESSAGE_FROM_GROUP), new PreparedStatementSetter() { - - @Override - public void setValues(PreparedStatement ps) throws SQLException { - if (logger.isDebugEnabled()) { - logger.debug("Removing message from group with group key=" + groupKey); - } - ps.setString(1, groupKey); - ps.setString(2, messageId); - ps.setString(3, JdbcMessageStore.this.region); - } - }); - removeMessage(messageToRemove.getHeaders().getId()); - updateMessageGroup(groupKey); - return getMessageGroup(groupId); - } - @Override public void removeMessagesFromGroup(Object groupId, Collection> messages) { Assert.notNull(groupId, "'groupId' must not be null"); diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaders.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaders.java deleted file mode 100644 index 25584a2e1a..0000000000 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaders.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2002-2016 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 - * - * http://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.jms; - -/** - * Pre-defined names and prefixes to be used for setting and/or retrieving JMS - * attributes from/to integration Message Headers. - * - * @deprecated - use {@link org.springframework.jms.support.JmsHeaders}. - * Will be removed in the Spring Integration 5.0. - * - * @author Mark Fisher - * @author Gary Russell - */ -@Deprecated -public abstract class JmsHeaders { - - /** - * Prefix used for JMS API related headers in order to distinguish from - * user-defined headers and other internal headers (e.g. correlationId). - * @see DefaultJmsHeaderMapper - */ - public static final String PREFIX = org.springframework.jms.support.JmsHeaders.PREFIX; - - public static final String MESSAGE_ID = org.springframework.jms.support.JmsHeaders.MESSAGE_ID; - - public static final String CORRELATION_ID = org.springframework.jms.support.JmsHeaders.CORRELATION_ID; - - public static final String REPLY_TO = org.springframework.jms.support.JmsHeaders.REPLY_TO; - - public static final String REDELIVERED = org.springframework.jms.support.JmsHeaders.REDELIVERED; - - public static final String TYPE = org.springframework.jms.support.JmsHeaders.TYPE; - - public static final String TIMESTAMP = org.springframework.jms.support.JmsHeaders.TIMESTAMP; - -} diff --git a/spring-integration-jms/src/main/resources/org/springframework/integration/jms/config/spring-integration-jms-5.0.xsd b/spring-integration-jms/src/main/resources/org/springframework/integration/jms/config/spring-integration-jms-5.0.xsd index e66b5b2d75..362daca3bf 100644 --- a/spring-integration-jms/src/main/resources/org/springframework/integration/jms/config/spring-integration-jms-5.0.xsd +++ b/spring-integration-jms/src/main/resources/org/springframework/integration/jms/config/spring-integration-jms-5.0.xsd @@ -209,7 +209,7 @@ - Timeout for the container's consumers if messsage-driven is TRUE, or + Timeout for the container's consumers if message-driven is TRUE, or timeout for receive calls on the template if message-driven is FALSE. @@ -408,17 +408,6 @@ - - - - [DEPRECATED: Use 'subscription-durable="true"' together with 'subscription-name']. - The name of a durable subscription to create. To be applied in case of a topic (pub-sub domain) with subscription durability - activated. The durable subscription name needs to be unique within this client's JMS client id. Default is the class name of the - specified message listener. Note: Only 1 concurrent consumer (which is the default of the message listener container) is allowed - for each durable subscription. - - - @@ -728,17 +717,6 @@ - - - - [DEPRECATED: Use 'subscription-durable="true"' together with 'subscription-name']. - The name of a durable subscription to create. To be applied in case of a topic (pub-sub domain) with subscription durability - activated. The durable subscription name needs to be unique within this client's JMS client id. Default is the class name of the - specified message listener. Note: Only 1 concurrent consumer (which is the default of the message listener container) is allowed - for each durable subscription. - - - diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/jmsInboundWithPubSubDomain.xml b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/jmsInboundWithPubSubDomain.xml index a1b94947dd..a063614763 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/jmsInboundWithPubSubDomain.xml +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/jmsInboundWithPubSubDomain.xml @@ -18,7 +18,7 @@ destination-name="testDestination" pub-sub-domain="true" subscription-durable="false" - durable-subscription-name="foo" + subscription-name="foo" channel="output"/> diff --git a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java index 2a056e6111..f9b0489da6 100644 --- a/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java +++ b/spring-integration-jpa/src/main/java/org/springframework/integration/jpa/outbound/JpaOutboundGatewayFactoryBean.java @@ -77,18 +77,6 @@ public class JpaOutboundGatewayFactoryBean extends AbstractFactoryBean @@ -587,7 +587,7 @@ @@ -606,7 +606,7 @@ In rare cases it might be advisable to provide your own implementation of the JpaOperations interface, instead of relying on the - default implementation. As JpaOperations wraps the necessay + default implementation. As JpaOperations wraps the necessary datasource; the JPA Entity Manager or JPA Entity Manager Factory must not be provided if the 'jpa-operations' attribute is used. ]]> @@ -624,11 +624,11 @@ - + diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java index 9845238e21..4c7c04e9db 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/AbstractConfigurableMongoDbMessageStore.java @@ -213,12 +213,6 @@ public abstract class AbstractConfigurableMongoDbMessageStore extends AbstractMe return Query.query(Criteria.where(MessageDocumentFields.GROUP_ID).is(groupId)); } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(Object key, Message messageToRemove) { - throw new UnsupportedOperationException("The operation isn't implemented for this class."); - } - @Override public void removeMessagesFromGroup(Object key, Collection> messages) { throw new UnsupportedOperationException("The operation isn't implemented for this class."); diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java index cac6db9c13..4a267d8f05 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageStore.java @@ -199,19 +199,6 @@ public class ConfigurableMongoDbMessageStore extends AbstractConfigurableMongoDb } } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(final Object groupId, final Message messageToRemove) { - Assert.notNull(groupId, "'groupId' must not be null"); - Assert.notNull(messageToRemove, "'messageToRemove' must not be null"); - - Query query = groupIdQuery(groupId) - .addCriteria(Criteria.where(MessageDocumentFields.MESSAGE_ID).is(messageToRemove.getHeaders().getId())); - this.mongoTemplate.remove(query, this.collectionName); - updateGroup(groupId, lastModifiedUpdate()); - return getMessageGroup(groupId); - } - @Override public void removeMessagesFromGroup(Object groupId, Collection> messages) { Assert.notNull(groupId, "'groupId' must not be null"); diff --git a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java index 3a74e69c10..85b3d695bc 100644 --- a/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java +++ b/spring-integration-mongodb/src/main/java/org/springframework/integration/mongodb/store/MongoDbMessageStore.java @@ -292,18 +292,6 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore } } - @Override - @Deprecated - public MessageGroup removeMessageFromGroup(final Object groupId, final Message messageToRemove) { - Assert.notNull(groupId, "'groupId' must not be null"); - Assert.notNull(messageToRemove, "'messageToRemove' must not be null"); - - this.template.findAndRemove(whereMessageIdIsAndGroupIdIs(messageToRemove.getHeaders().getId(), groupId), - MessageWrapper.class, this.collectionName); - updateGroup(groupId, lastModifiedUpdate()); - return getMessageGroup(groupId); - } - @Override public void removeMessagesFromGroup(Object groupId, Collection> messages) { Assert.notNull(groupId, "'groupId' must not be null"); diff --git a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java index 3a6095bf02..e88c3e99ae 100644 --- a/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java +++ b/spring-integration-mqtt/src/main/java/org/springframework/integration/mqtt/outbound/AbstractMqttMessageHandler.java @@ -133,9 +133,7 @@ public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler } @Override - @SuppressWarnings("deprecation") protected void handleMessageInternal(Message message) throws Exception { - connectIfNeeded(); String topic = (String) message.getHeaders().get(MqttHeaders.TOPIC); Object mqttMessage = this.converter.fromMessage(message, Object.class); if (topic == null && this.defaultTopic == null) { @@ -145,15 +143,6 @@ public abstract class AbstractMqttMessageHandler extends AbstractMessageHandler this.publish(topic == null ? this.defaultTopic : topic, mqttMessage, message); } - /** - * Invoked before {@link #publish(String, Object, Message)}. - * @deprecated subclasses should check the connection in - * {@link #publish(String, Object, Message)}. - */ - @Deprecated - protected void connectIfNeeded() { - } - protected abstract void publish(String topic, Object mqttMessage, Message message) throws Exception; } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java index 010ce50157..d11ac5c3d1 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueInboundGateway.java @@ -130,16 +130,6 @@ public class RedisQueueInboundGateway extends MessagingGatewaySupport implements this.receiveTimeout = receiveTimeout; } - /** - * @param stopTimeout the timeout to block {@link #doStop()} until the last message - * will be processed or this timeout is reached. Should be less than or equal to {@link #receiveTimeout} - * @deprecated since {@literal 4.3} with no-op in favor of delayer call {@code callback.run()} - * in the {@link #stop(Runnable)}. - */ - @Deprecated - public void setStopTimeout(long stopTimeout) { - } - public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java index 118e6ef04d..d91bfb14fb 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java @@ -136,17 +136,6 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl this.receiveTimeout = receiveTimeout; } - /** - * @param stopTimeout the timeout to block {@link #doStop()} until the last message will be processed - * or this timeout is reached. Should be less than or equal to {@link #receiveTimeout} - * @since 4.0.3 - * @deprecated since {@literal 4.3} with no-op in favor of delayer call {@code callback.run()} - * in the {@link #stop(Runnable)}. - */ - @Deprecated - public void setStopTimeout(long stopTimeout) { - } - public void setTaskExecutor(Executor taskExecutor) { this.taskExecutor = taskExecutor; } diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisOutboundGateway.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisOutboundGateway.java index 7c0dfbccb4..fda5cc522e 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisOutboundGateway.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisOutboundGateway.java @@ -88,15 +88,6 @@ public class RedisOutboundGateway extends AbstractReplyProducingMessageHandler { this.commandExpression = EXPRESSION_PARSER.parseExpression(commandExpression); } - /** - * @param commandExpression the expression to set. - * @deprecated in favor of {@link #setCommandExpression}. - */ - @Deprecated - public void setExpressionCommand(Expression commandExpression) { - setCommandExpression(commandExpression); - } - public void setArgumentsStrategy(ArgumentsStrategy argumentsStrategy) { this.argumentsStrategy = argumentsStrategy; } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java index 787adf84ad..160c396ba3 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpSession.java @@ -80,8 +80,7 @@ public class SftpSession implements Session { return true; } catch (SftpException e) { - // TODO: in 5.0 remove e.toString() INT-3913 - throw new NestedIOException("Failed to remove file: " + e.toString(), e); + throw new NestedIOException("Failed to remove file.", e); } } diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParser.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParser.java index 27e0b0d913..f2e2c4f6de 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParser.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParser.java @@ -40,11 +40,6 @@ public class ChatMessageInboundChannelAdapterParser extends AbstractXmppInboundC @Override protected void postProcess(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { - if (element.hasAttribute("extract-payload")) { - parserContext.getReaderContext() - .warning("The 'extract-payload' is deprecated. Use 'payload-expression' instead.", element); - IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); - } BeanDefinition expression = IntegrationNamespaceUtils.createExpressionDefIfAttributeDefined("payload-expression", element); if (expression != null) { diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java index 4acfd53b30..24172e1736 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/config/XmppConnectionFactoryBean.java @@ -73,17 +73,6 @@ public class XmppConnectionFactoryBean extends AbstractFactoryBeantrue by default. - * @param extractPayload true if the payload should be extracted. - * @deprecated since version 4.3 in favor of {@link #setPayloadExpression(Expression)} - */ - @Deprecated - public void setExtractPayload(boolean extractPayload) { - if (this.payloadExpression == null) { - setPayloadExpression(extractPayload ? null : EXPRESSION_PARSER.parseExpression("#this")); - } - } - /** * Specify a {@link StanzaFilter} to use for the incoming packets. * @param stanzaFilter the {@link StanzaFilter} to use diff --git a/spring-integration-xmpp/src/main/resources/org/springframework/integration/xmpp/config/spring-integration-xmpp-5.0.xsd b/spring-integration-xmpp/src/main/resources/org/springframework/integration/xmpp/config/spring-integration-xmpp-5.0.xsd index 4c1bd278dd..3a4fac93c6 100644 --- a/spring-integration-xmpp/src/main/resources/org/springframework/integration/xmpp/config/spring-integration-xmpp-5.0.xsd +++ b/spring-integration-xmpp/src/main/resources/org/springframework/integration/xmpp/config/spring-integration-xmpp-5.0.xsd @@ -108,17 +108,6 @@ - - - - [DEPRECATED] - Specifies if generated Message payload should consist of only - the text of the XMPP message or the entire XMPP (Smack API specific) message. - Default is true. - Deprecated since 4.3 in favor of 'payload-expression'. - - - diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParserTests-context.xml b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParserTests-context.xml index 47cf66bdcb..f11a4b21d3 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParserTests-context.xml +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/config/ChatMessageInboundChannelAdapterParserTests-context.xml @@ -34,7 +34,7 @@ stanza-filter="stanzaFilter"/> diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundChatTests-context.xml b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundChatTests-context.xml index d6f57cfb95..d6e9ef8fe6 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundChatTests-context.xml +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/ignore/InboundChatTests-context.xml @@ -3,20 +3,13 @@ xmlns="http://www.springframework.org/schema/integration" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" - xmlns:util="http://www.springframework.org/schema/util" xmlns:xmpp="http://www.springframework.org/schema/integration/xmpp" - xmlns:tool="http://www.springframework.org/schema/tool" - xmlns:lang="http://www.springframework.org/schema/lang" xsi:schemaLocation="http://www.springframework.org/schema/integration/xmpp http://www.springframework.org/schema/integration/xmpp/spring-integration-xmpp.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd - http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd - http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd"> + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> @@ -27,7 +20,8 @@ host="${user.1.host}" service-name="${user.1.service}"/> - + diff --git a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java index bf7623e23b..b25fc14017 100644 --- a/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java +++ b/spring-integration-xmpp/src/test/java/org/springframework/integration/xmpp/inbound/ChatMessageListeningEndpointTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -73,7 +73,7 @@ public class ChatMessageListeningEndpointTests { @Test - /** + /* * Should add/remove StanzaListener when endpoint started/stopped */ public void testLifecycle() { @@ -172,14 +172,14 @@ public class ChatMessageListeningEndpointTests { } @Test - @SuppressWarnings("deprecation") public void testExpression() throws Exception { TestXMPPConnection testXMPPConnection = new TestXMPPConnection(); QueueChannel inputChannel = new QueueChannel(); ChatMessageListeningEndpoint endpoint = new ChatMessageListeningEndpoint(testXMPPConnection); - endpoint.setExtractPayload(false); + SpelExpressionParser parser = new SpelExpressionParser(); + endpoint.setPayloadExpression(parser.parseExpression("#root")); endpoint.setOutputChannel(inputChannel); endpoint.setBeanFactory(mock(BeanFactory.class)); endpoint.afterPropertiesSet(); @@ -223,7 +223,7 @@ public class ChatMessageListeningEndpointTests { xmlPullParser.next(); testXMPPConnection.parseAndProcessStanza(xmlPullParser); - ArgumentCaptor argumentCaptor = new ArgumentCaptor(); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); assertTrue(logLatch.await(10, TimeUnit.SECONDS)); diff --git a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/LeaderInitiatorFactoryBean.java b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/LeaderInitiatorFactoryBean.java index cad2955c74..ea5b9befa9 100644 --- a/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/LeaderInitiatorFactoryBean.java +++ b/spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/config/LeaderInitiatorFactoryBean.java @@ -60,22 +60,6 @@ public class LeaderInitiatorFactoryBean public LeaderInitiatorFactoryBean() { } - /** - * Construct the instance. - * @param client the {@link CuratorFramework}. - * @param path the path in zookeeper. - * @param role the role of the leader. - * @deprecated since {@literal 4.2.5} in favor of appropriate setters - * to avoid {@code BeanCurrentlyInCreationException} - * during {@code AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()} - */ - @Deprecated - public LeaderInitiatorFactoryBean(CuratorFramework client, String path, String role) { - this.client = client; - this.path = path; - this.candidate = new DefaultCandidate(UUID.randomUUID().toString(), role); - } - public LeaderInitiatorFactoryBean setClient(CuratorFramework client) { this.client = client; return this; diff --git a/src/reference/asciidoc/file.adoc b/src/reference/asciidoc/file.adoc index d6ad56d4ca..38f1db063c 100644 --- a/src/reference/asciidoc/file.adoc +++ b/src/reference/asciidoc/file.adoc @@ -234,11 +234,7 @@ To prevent their use, you should configure your own filter (e.g. `AcceptAllFileL [[watch-service-directory-scanner]] ==== WatchServiceDirectoryScanner -This scanner was added in _version 4.2_. It replaces the existing `RecursiveLeafOnlyDirectoryScanner` which is -inefficient for large directory trees. -The `FileReadingMessageSource.WatchServiceDirectoryScanner` requires Java 7 or above. - -This scanner relies on file system events when new files are added to the directory. +The `FileReadingMessageSource.WatchServiceDirectoryScanner` relies on file system events when new files are added to the directory. During initialization, the directory is registered to generate events; the initial file list is also built. While walking the directory tree, any subdirectories encountered are also registered to generate events. On the first poll, the initial file list from walking the directory is returned. @@ -254,9 +250,7 @@ In this case, the root directory is re-scanned completely. To avoid duplicates consider using an appropriate `FileListFilter` such as the `AcceptOnceFileListFilter` and/or remove files when processing is completed. -Since _version 4.3_, the top level `WatchServiceDirectoryScanner` has been deprecated in favor of -`FileReadingMessageSource` internal logic for the `WatchService`. -Now this can be enable via `use-watch-service` option, which is mutually exclusive with the `scanner` option. +The `WatchServiceDirectoryScanner` can be enable via `FileReadingMessageSource.use-watch-service` option, which is mutually exclusive with the `scanner` option. An internal `FileReadingMessageSource.WatchServiceDirectoryScanner` instance is populated for the provided `directory`. In addition, now the `WatchService` polling logic can track the `StandardWatchEventKinds.ENTRY_MODIFY` and diff --git a/src/reference/asciidoc/ftp.adoc b/src/reference/asciidoc/ftp.adoc index 2f67ffe89a..9473e457cd 100644 --- a/src/reference/asciidoc/ftp.adoc +++ b/src/reference/asciidoc/ftp.adoc @@ -720,9 +720,6 @@ if (closeable != null) { } ---- -Note: In previous releases the session was in the `file_remoteSession` header, but this is deprecated - use -`closeableResource` instead. - Framework components such as the <> and <> will automatically close the session after the data is transferred. diff --git a/src/reference/asciidoc/gateway.adoc b/src/reference/asciidoc/gateway.adoc index 1461d349e5..ec1e500ec4 100644 --- a/src/reference/asciidoc/gateway.adoc +++ b/src/reference/asciidoc/gateway.adoc @@ -145,9 +145,6 @@ For example, if you wish to route on the simple method name, you might add a hea NOTE: The `java.reflect.Method` is not serializable; a header with expression `#gatewayMethod` will be lost if you later serialize the message. So, you may wish to use `#gatewayMethod.name` or `#gatewayMethod.toString()` in those cases; the `toString()` method provides a String representation of the method, including parameter and return types. -NOTE: Prior to 3.0, the `#method` variable was available, representing the method name only. -This is still available, but deprecated; use `#gatewayMethod.name` instead. - Since 3.0, `` s can be defined to add headers to all messages produced by the gateway, regardless of the method invoked. Specific headers defined for a method take precedence over default headers. Specific headers defined for a method here will override any `@Header` annotations in the service interface. diff --git a/src/reference/asciidoc/http.adoc b/src/reference/asciidoc/http.adoc index 6be010b463..39a230954a 100644 --- a/src/reference/asciidoc/http.adoc +++ b/src/reference/asciidoc/http.adoc @@ -632,8 +632,6 @@ http://static.springsource.org/spring/docs/current/javadoc-api/org/springframewo http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.html[HttpComponentsClientHttpRequestFactory] - Uses http://hc.apache.org/httpcomponents-client-ga/[Apache HttpComponents HttpClient] (Since Spring 3.1) -http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/client/CommonsClientHttpRequestFactory.html[ClientHttpRequestFactory] - Uses http://hc.apache.org/httpclient-3.x/[Jakarta Commons HttpClient] (Deprecated as of Spring 3.1) - If you don't explicitly configure the _request-factory_ or _rest-template_ attribute respectively, then a default RestTemplate which uses a `SimpleClientHttpRequestFactory` will be instantiated. [NOTE] diff --git a/src/reference/asciidoc/ip.adoc b/src/reference/asciidoc/ip.adoc index dc5330815a..296a658ab3 100644 --- a/src/reference/asciidoc/ip.adoc +++ b/src/reference/asciidoc/ip.adoc @@ -420,21 +420,7 @@ Configuring a connection interceptor factory chain. === TCP Connection Events Beginning with version 3.0, changes to `TcpConnection` s are reported by `TcpConnectionEvent` s. -`TcpConnectionEvent` is a subclass of `ApplicationEvent` and thus can be received by any `ApplicationListener` defined in the `ApplicationContext`. - -[NOTE] -===== -The following is deprecated as of _version 4.2_; use the generic Event Inbound Channel Adapter instead. -See <>. - -For convenience, a `` is provided. -This adapter will receive all `TcpConnectionEvent` s (by default), and send them to its `channel`. -The adapter accepts an `event-type` attribute, which is a list of class names for events that should be sent. -This can be used if an application subclasses `TcpConnectionEvent` for some reason, and wishes to only receive those events. -Omitting this attribute will mean that all `TcpConnectionEvent` s will be sent. -You can also use this to limit which `TcpConnectionEvent` s you are interested in ( `TcpConnectionOpenEvent`, `TcpConnectionCloseEvent`, or `TcpConnectionExceptionEvent`). -===== - +`TcpConnectionEvent` is a subclass of `ApplicationEvent` and thus can be received by any `ApplicationListener` defined in the `ApplicationContext`, for example <>. `TcpConnectionEvents` have the following properties: diff --git a/src/reference/asciidoc/jpa.adoc b/src/reference/asciidoc/jpa.adoc index 46e5b5f62d..5ea7b70b5a 100644 --- a/src/reference/asciidoc/jpa.adoc +++ b/src/reference/asciidoc/jpa.adoc @@ -144,7 +144,7 @@ Either this attribute or the _entity-manager_ attribute or the _jpa-operations_ *entity-manager* The reference to the JPA Entity Manager that will be used by the component. -Either this attribute or the _enity-manager-factory_ attribute or the _jpa-operations_ attribute must be provided. +Either this attribute or the _entity-manager-factory_ attribute or the _jpa-operations_ attribute must be provided. NOTE: Usually your Spring Application Context only defines a JPA Entity Manager Factory and the EntityManager is injected using the @PersistenceContext annotation. This, however, is not applicable for the Spring Integration JPA components. diff --git a/src/reference/asciidoc/sftp.adoc b/src/reference/asciidoc/sftp.adoc index 5f42bb6c21..e6fd58cb4c 100644 --- a/src/reference/asciidoc/sftp.adoc +++ b/src/reference/asciidoc/sftp.adoc @@ -809,9 +809,6 @@ if (closeable != null) { } ---- -Note: In previous releases the session was in the `file_remoteSession` header, but this is deprecated - use -`closeableResource` instead. - Framework components such as the <> and <> will automatically close the session after the data is transferred. diff --git a/src/reference/asciidoc/xml.adoc b/src/reference/asciidoc/xml.adoc index 3204b28027..b296037863 100644 --- a/src/reference/asciidoc/xml.adoc +++ b/src/reference/asciidoc/xml.adoc @@ -814,7 +814,7 @@ If you need to extend beyond the capabilities of that default implementation, th [[xml-xpath-header-enricher]] === XPath Header Enricher -The XPath Header Enricher defines a Header Enricher Message Transformer that evaluates XPath expressions against the message payload and inserts the result of the evaluation into a messsage header. +The XPath Header Enricher defines a Header Enricher Message Transformer that evaluates XPath expressions against the message payload and inserts the result of the evaluation into a message header. Please see below for an overview of all available configuration parameters: diff --git a/src/reference/asciidoc/xmpp.adoc b/src/reference/asciidoc/xmpp.adoc index f23a1170bb..ffd9987678 100644 --- a/src/reference/asciidoc/xmpp.adoc +++ b/src/reference/asciidoc/xmpp.adoc @@ -120,9 +120,6 @@ The samples above with the `namespace` manipulations can be simplified to someth payload-expression="#extension.bodies[0]" ---- - -NOTE: The `extract-payload` option has been deprecated in favor of the new `payload-expression` one. - [[xmpp-message-outbound-channel-adapter]] ==== Outbound Message Channel Adapter