diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java index 271e807ccb..6793dec11a 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/AbstractMethodAnnotationPostProcessor.java @@ -27,7 +27,6 @@ import org.aopalliance.aop.Advice; import org.springframework.aop.TargetSource; import org.springframework.aop.framework.Advised; -import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.GenericTypeResolver; @@ -36,7 +35,6 @@ import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.annotation.Order; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; -import org.springframework.core.env.Environment; import org.springframework.core.task.TaskExecutor; import org.springframework.integration.annotation.Poller; import org.springframework.integration.channel.DirectChannel; @@ -81,18 +79,14 @@ public abstract class AbstractMethodAnnotationPostProcessor channelResolver; protected final Class annotationType; @SuppressWarnings("unchecked") - public AbstractMethodAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { + public AbstractMethodAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { Assert.notNull(beanFactory, "'beanFactory' must not be null"); - Assert.isInstanceOf(ConfigurableListableBeanFactory.class, beanFactory, - "'beanFactory' must be instanceOf ConfigurableListableBeanFactory"); - this.beanFactory = (ConfigurableListableBeanFactory) beanFactory; + this.beanFactory = beanFactory; ConversionService conversionService = this.beanFactory.getConversionService(); if (conversionService != null) { this.conversionService = conversionService; @@ -100,7 +94,6 @@ public abstract class AbstractMethodAnnotationPostProcessor) GenericTypeResolver.resolveTypeArgument(this.getClass(), MethodAnnotationPostProcessor.class); @@ -242,10 +235,10 @@ public abstract class AbstractMethodAnnotationPostProcessor { - public AggregatorAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public AggregatorAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeFromAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeFromAnnotationPostProcessor.java index ba980769c6..1a645ff0c3 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeFromAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeFromAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -20,11 +20,10 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.BridgeFrom; import org.springframework.integration.annotation.BridgeTo; import org.springframework.integration.handler.BridgeHandler; @@ -41,8 +40,8 @@ import org.springframework.util.StringUtils; */ public class BridgeFromAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public BridgeFromAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public BridgeFromAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeToAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeToAnnotationPostProcessor.java index 898381e4b9..4d4288bb0e 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeToAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/BridgeToAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -20,10 +20,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.BridgeFrom; import org.springframework.integration.annotation.BridgeTo; import org.springframework.integration.endpoint.AbstractEndpoint; @@ -40,8 +39,8 @@ import org.springframework.util.Assert; */ public class BridgeToAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public BridgeToAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public BridgeToAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessor.java index d039a9ac9d..b91aa6b5c6 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -20,10 +20,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.Filter; import org.springframework.integration.core.MessageSelector; import org.springframework.integration.filter.MessageFilter; @@ -42,8 +41,8 @@ import org.springframework.util.StringUtils; */ public class FilterAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public FilterAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public FilterAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @@ -86,7 +85,7 @@ public class FilterAnnotationPostProcessor extends AbstractMethodAnnotationPostP String throwExceptionOnRejection = MessagingAnnotationUtils.resolveAttribute(annotations, "throwExceptionOnRejection", String.class); if (StringUtils.hasText(throwExceptionOnRejection)) { - String throwExceptionOnRejectionValue = this.environment.resolvePlaceholders(throwExceptionOnRejection); + String throwExceptionOnRejectionValue = this.beanFactory.resolveEmbeddedValue(throwExceptionOnRejection); filter.setThrowExceptionOnRejection(Boolean.parseBoolean(throwExceptionOnRejectionValue)); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/InboundChannelAdapterAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/InboundChannelAdapterAnnotationPostProcessor.java index 84e0f374fc..9bcbd33a2c 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/InboundChannelAdapterAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/InboundChannelAdapterAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -20,11 +20,10 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.InboundChannelAdapter; import org.springframework.integration.config.IntegrationConfigUtils; import org.springframework.integration.core.MessageSource; @@ -44,8 +43,8 @@ import org.springframework.util.Assert; public class InboundChannelAdapterAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public InboundChannelAdapterAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public InboundChannelAdapterAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java index 5f1fabd6db..2b172c7788 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -70,14 +70,12 @@ import org.springframework.util.StringUtils; * @author Gary Russell */ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, BeanFactoryAware, - InitializingBean, Lifecycle, ApplicationListener, EnvironmentAware { + InitializingBean, Lifecycle, ApplicationListener { private final Log logger = LogFactory.getLog(this.getClass()); private volatile ConfigurableListableBeanFactory beanFactory; - private Environment environment; - private final Map, MethodAnnotationPostProcessor> postProcessors = new HashMap, MethodAnnotationPostProcessor>(); @@ -95,23 +93,18 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean this.beanFactory = (ConfigurableListableBeanFactory) beanFactory; } - @Override - public void setEnvironment(Environment environment) { - this.environment = environment; - } - @Override public void afterPropertiesSet() { Assert.notNull(this.beanFactory, "BeanFactory must not be null"); - postProcessors.put(Filter.class, new FilterAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(Router.class, new RouterAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(Transformer.class, new TransformerAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(ServiceActivator.class, new ServiceActivatorAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(Splitter.class, new SplitterAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(Aggregator.class, new AggregatorAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(InboundChannelAdapter.class, new InboundChannelAdapterAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(BridgeFrom.class, new BridgeFromAnnotationPostProcessor(this.beanFactory, this.environment)); - postProcessors.put(BridgeTo.class, new BridgeToAnnotationPostProcessor(this.beanFactory, this.environment)); + postProcessors.put(Filter.class, new FilterAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(Router.class, new RouterAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(Transformer.class, new TransformerAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(ServiceActivator.class, new ServiceActivatorAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(Splitter.class, new SplitterAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(Aggregator.class, new AggregatorAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(InboundChannelAdapter.class, new InboundChannelAdapterAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(BridgeFrom.class, new BridgeFromAnnotationPostProcessor(this.beanFactory)); + postProcessors.put(BridgeTo.class, new BridgeToAnnotationPostProcessor(this.beanFactory)); } @Override @@ -153,9 +146,7 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean String autoStartup = MessagingAnnotationUtils.resolveAttribute(annotations, "autoStartup", String.class); if (StringUtils.hasText(autoStartup)) { - if (environment != null) { - autoStartup = environment.resolvePlaceholders(autoStartup); - } + autoStartup = beanFactory.resolveEmbeddedValue(autoStartup); if (StringUtils.hasText(autoStartup)) { endpoint.setAutoStartup(Boolean.parseBoolean(autoStartup)); } @@ -163,9 +154,7 @@ public class MessagingAnnotationPostProcessor implements BeanPostProcessor, Bean String phase = MessagingAnnotationUtils.resolveAttribute(annotations, "phase", String.class); if (StringUtils.hasText(phase)) { - if (environment != null) { - phase = environment.resolvePlaceholders(phase); - } + phase = beanFactory.resolveEmbeddedValue(phase); if (StringUtils.hasText(phase)) { endpoint.setPhase(Integer.parseInt(phase)); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessor.java index 4a962bb35b..f81723d324 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/RouterAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -21,11 +21,10 @@ import java.lang.reflect.Method; import java.util.List; import java.util.Properties; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.convert.TypeDescriptor; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.Router; import org.springframework.integration.router.AbstractMessageRouter; import org.springframework.integration.router.MethodInvokingRouter; @@ -43,8 +42,8 @@ import org.springframework.util.StringUtils; */ public class RouterAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public RouterAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public RouterAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @@ -79,13 +78,13 @@ public class RouterAnnotationPostProcessor extends AbstractMethodAnnotationPostP String applySequence = MessagingAnnotationUtils.resolveAttribute(annotations, "applySequence", String.class); if (StringUtils.hasText(applySequence)) { - router.setApplySequence(Boolean.parseBoolean(this.environment.resolvePlaceholders(applySequence))); + router.setApplySequence(Boolean.parseBoolean(this.beanFactory.resolveEmbeddedValue(applySequence))); } String ignoreSendFailures = MessagingAnnotationUtils.resolveAttribute(annotations, "ignoreSendFailures", String.class); if (StringUtils.hasText(ignoreSendFailures)) { - router.setIgnoreSendFailures(Boolean.parseBoolean(this.environment.resolvePlaceholders(ignoreSendFailures))); + router.setIgnoreSendFailures(Boolean.parseBoolean(this.beanFactory.resolveEmbeddedValue(ignoreSendFailures))); } if (this.routerAttributesProvided(annotations)) { @@ -95,7 +94,7 @@ public class RouterAnnotationPostProcessor extends AbstractMethodAnnotationPostP String resolutionRequired = MessagingAnnotationUtils.resolveAttribute(annotations, "resolutionRequired", String.class); if (StringUtils.hasText(resolutionRequired)) { - String resolutionRequiredValue = this.environment.resolvePlaceholders(resolutionRequired); + String resolutionRequiredValue = this.beanFactory.resolveEmbeddedValue(resolutionRequired); if (StringUtils.hasText(resolutionRequiredValue)) { methodInvokingRouter.setResolutionRequired(Boolean.parseBoolean(resolutionRequiredValue)); } @@ -103,12 +102,12 @@ public class RouterAnnotationPostProcessor extends AbstractMethodAnnotationPostP String prefix = MessagingAnnotationUtils.resolveAttribute(annotations, "prefix", String.class); if (StringUtils.hasText(prefix)) { - methodInvokingRouter.setPrefix(this.environment.resolvePlaceholders(prefix)); + methodInvokingRouter.setPrefix(this.beanFactory.resolveEmbeddedValue(prefix)); } String suffix = MessagingAnnotationUtils.resolveAttribute(annotations, "suffix", String.class); if (StringUtils.hasText(suffix)) { - methodInvokingRouter.setSuffix(this.environment.resolvePlaceholders(suffix)); + methodInvokingRouter.setSuffix(this.beanFactory.resolveEmbeddedValue(suffix)); } String[] channelMappings = MessagingAnnotationUtils.resolveAttribute(annotations, "channelMappings", diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/ServiceActivatorAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/ServiceActivatorAnnotationPostProcessor.java index fcc7a20a78..617f582cd0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/ServiceActivatorAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/ServiceActivatorAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -20,10 +20,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.handler.ServiceActivatingHandler; @@ -40,8 +39,8 @@ import org.springframework.util.StringUtils; */ public class ServiceActivatorAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public ServiceActivatorAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public ServiceActivatorAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @@ -81,7 +80,7 @@ public class ServiceActivatorAnnotationPostProcessor extends AbstractMethodAnnot String requiresReply = MessagingAnnotationUtils.resolveAttribute(annotations, "requiresReply", String.class); if (StringUtils.hasText(requiresReply)) { - serviceActivator.setRequiresReply(Boolean.parseBoolean(this.environment.resolvePlaceholders(requiresReply))); + serviceActivator.setRequiresReply(Boolean.parseBoolean(this.beanFactory.resolveEmbeddedValue(requiresReply))); } this.setOutputChannelIfPresent(annotations, serviceActivator); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessor.java index 3872dbb44d..350980553b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/SplitterAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -20,10 +20,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.Splitter; import org.springframework.integration.splitter.AbstractMessageSplitter; import org.springframework.integration.splitter.MethodInvokingSplitter; @@ -40,8 +39,8 @@ import org.springframework.util.StringUtils; */ public class SplitterAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public SplitterAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public SplitterAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } @@ -72,7 +71,7 @@ public class SplitterAnnotationPostProcessor extends AbstractMethodAnnotationPos } if (StringUtils.hasText(applySequence)) { - String applySequenceValue = this.environment.resolvePlaceholders(applySequence); + String applySequenceValue = this.beanFactory.resolveEmbeddedValue(applySequence); if (StringUtils.hasText(applySequenceValue)) { splitter.setApplySequence(Boolean.parseBoolean(applySequenceValue)); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/TransformerAnnotationPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/TransformerAnnotationPostProcessor.java index d1f431595c..7b758f4f4b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/TransformerAnnotationPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/annotation/TransformerAnnotationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -20,10 +20,9 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.List; -import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.annotation.AnnotatedElementUtils; -import org.springframework.core.env.Environment; import org.springframework.integration.annotation.Transformer; import org.springframework.integration.handler.AbstractReplyProducingMessageHandler; import org.springframework.integration.transformer.MessageTransformingHandler; @@ -39,8 +38,8 @@ import org.springframework.messaging.MessageHandler; */ public class TransformerAnnotationPostProcessor extends AbstractMethodAnnotationPostProcessor { - public TransformerAnnotationPostProcessor(ListableBeanFactory beanFactory, Environment environment) { - super(beanFactory, environment); + public TransformerAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) { + super(beanFactory); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java index 88053c0941..4981d362a4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/FilterAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * 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. @@ -29,17 +29,16 @@ import java.util.List; import org.junit.Before; import org.junit.Test; -import org.springframework.messaging.Message; import org.springframework.integration.annotation.Filter; import org.springframework.integration.annotation.MessageEndpoint; import org.springframework.integration.channel.DirectChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice; -import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.test.util.TestUtils; import org.springframework.integration.test.util.TestUtils.TestApplicationContext; -import org.springframework.mock.env.MockEnvironment; +import org.springframework.messaging.Message; +import org.springframework.messaging.support.GenericMessage; /** * @author Mark Fisher @@ -62,7 +61,6 @@ public class FilterAnnotationPostProcessorTests { context.registerChannel("input", inputChannel); context.registerChannel("output", outputChannel); postProcessor.setBeanFactory(context.getBeanFactory()); - postProcessor.setEnvironment(new MockEnvironment()); postProcessor.afterPropertiesSet(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests-context.xml b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests-context.xml index af2d32b8f7..fa63336b9b 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests-context.xml +++ b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests-context.xml @@ -1,10 +1,16 @@ + http://www.springframework.org/schema/integration/spring-integration.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + + diff --git a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java index c522e65c05..5142edabfe 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/configuration/EnableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-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. @@ -537,7 +537,7 @@ public class EnableIntegrationTests { @ComponentScan @IntegrationComponentScan @EnableIntegration - @PropertySource("classpath:org/springframework/integration/configuration/EnableIntegrationTests.properties") +// INT-3853 @PropertySource("classpath:org/springframework/integration/configuration/EnableIntegrationTests.properties") @EnableMessageHistory({"input", "publishedChannel", "*AnnotationTestService*"}) public static class ContextConfiguration { @@ -769,10 +769,12 @@ public class EnableIntegrationTests { @EnableAsync public static class ContextConfiguration2 { + /* + INT-3853 @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); - } + }*/ @Bean public MessageChannel sendAsyncChannel() {