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 8132f0880a..28f9b55491 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 @@ -30,7 +30,6 @@ import org.springframework.aop.framework.Advised; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor; import org.springframework.aop.support.NameMatchMethodPointcut; -import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.core.GenericTypeResolver; @@ -39,7 +38,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.IdempotentReceiver; import org.springframework.integration.annotation.Poller; @@ -86,18 +84,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; @@ -105,7 +99,6 @@ public abstract class AbstractMethodAnnotationPostProcessor) GenericTypeResolver.resolveTypeArgument(this.getClass(), MethodAnnotationPostProcessor.class); @@ -269,10 +262,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 693991889a..f87ac3bac4 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; @@ -42,8 +41,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 36027856b4..d30865cadc 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; @@ -42,8 +41,8 @@ import org.springframework.util.StringUtils; */ 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 cd7566b710..2db9ca3b95 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; @@ -43,8 +42,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); } @@ -74,7 +73,7 @@ public class FilterAnnotationPostProcessor extends AbstractMethodAnnotationPostP String discardWithinAdvice = MessagingAnnotationUtils.resolveAttribute(annotations, "discardWithinAdvice", String.class); if (StringUtils.hasText(discardWithinAdvice)) { - discardWithinAdvice = this.environment.resolvePlaceholders(discardWithinAdvice); + discardWithinAdvice = this.beanFactory.resolveEmbeddedValue(discardWithinAdvice); if (StringUtils.hasText(discardWithinAdvice)) { filter.setDiscardWithinAdvice(Boolean.parseBoolean(discardWithinAdvice)); } @@ -84,7 +83,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); if (StringUtils.hasText(throwExceptionOnRejectionValue)) { 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 0675b6d234..bd2e8684a3 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; @@ -45,8 +44,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 31f11f84f8..899819a4da 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. @@ -71,14 +71,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>(); @@ -96,23 +94,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 @@ -154,9 +147,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)); } @@ -164,9 +155,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 bb20537b33..3eea6a7582 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; @@ -44,8 +43,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); } @@ -82,13 +81,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)) { @@ -98,7 +97,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)); } @@ -106,12 +105,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 4abaf436d7..ffe8cc09b2 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,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.Lifecycle; 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; @@ -42,8 +41,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); } @@ -75,7 +74,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 67e8965da6..3975414540 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; @@ -41,8 +40,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); } @@ -73,7 +72,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 7fad4cba82..eed8baedd9 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 6cfc9f9f2b..c84d5fc819 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. @@ -609,7 +609,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 { @@ -842,10 +842,12 @@ public class EnableIntegrationTests { @EnableReactor public static class ContextConfiguration2 { + /* + INT-3853 @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); - } + }*/ @Bean public MessageChannel sendAsyncChannel() {