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 93b7075861..49b1ce36a9 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.springframework.beans.factory.BeanFactory; import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.integration.Message; import org.springframework.integration.MessageChannel; import org.springframework.integration.MessageDeliveryException; @@ -194,7 +194,7 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler { protected ConversionService getRequiredConversionService() { if (this.getConversionService() == null) { - this.setConversionService(new DefaultConversionService()); + this.setConversionService(ConversionServiceFactory.createDefaultConversionService()); } return this.getConversionService(); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java index cb4f3c336f..4c504cff5f 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/transformer/MapToObjectTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -22,7 +22,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.util.Assert; import org.springframework.util.StringUtils; import org.springframework.validation.DataBinder; @@ -73,7 +73,7 @@ public class MapToObjectTransformer extends AbstractPayloadTransformer, conversionService = ((ConfigurableBeanFactory)this.getBeanFactory()).getConversionService(); } if (conversionService == null){ - conversionService = new DefaultConversionService(); + conversionService = ConversionServiceFactory.createDefaultConversionService(); } binder.setConversionService(conversionService); binder.bind(new MutablePropertyValues(payload)); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java index 152b4e6774..59f08cdcb0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/BeanFactoryTypeConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -25,7 +25,7 @@ import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.expression.TypeConverter; /** @@ -45,7 +45,7 @@ public class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware public BeanFactoryTypeConverter() { synchronized (BeanFactoryTypeConverter.class) { if (defaultConversionService == null) { - defaultConversionService = new DefaultConversionService(); + defaultConversionService = ConversionServiceFactory.createDefaultConversionService(); } } this.conversionService = defaultConversionService; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java index f2f83b3f2c..9d5b9ff1a6 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/MethodInvokingMessageGroupProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -30,7 +30,7 @@ import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.aop.framework.ProxyFactory; import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; import org.springframework.integration.Message; import org.springframework.integration.annotation.Aggregator; @@ -240,7 +240,7 @@ public class MethodInvokingMessageGroupProcessorTests { } MethodInvokingMessageGroupProcessor processor = new MethodInvokingMessageGroupProcessor(new SimpleAggregator()); - GenericConversionService conversionService = new DefaultConversionService(); + GenericConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); conversionService.addConverter(new Converter, Iterator>() { public Iterator convert(ArrayList source) { return source.iterator(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java index 05689ee50b..334d101a78 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/DatatypeChannelTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -25,7 +25,7 @@ import org.springframework.context.support.ConversionServiceFactoryBean; import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; import org.springframework.integration.MessageChannel; import org.springframework.integration.MessageDeliveryException; @@ -59,7 +59,7 @@ public class DatatypeChannelTests { @Test public void unsupportedTypeButConversionServiceSupports() { QueueChannel channel = createChannel(Integer.class); - ConversionService conversionService = new DefaultConversionService(); + ConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); channel.setConversionService(conversionService); assertTrue(channel.send(new GenericMessage("123"))); } @@ -67,7 +67,7 @@ public class DatatypeChannelTests { @Test(expected = MessageDeliveryException.class) public void unsupportedTypeAndConversionServiceDoesNotSupport() { QueueChannel channel = createChannel(Integer.class); - ConversionService conversionService = new DefaultConversionService(); + ConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); channel.setConversionService(conversionService); assertTrue(channel.send(new GenericMessage(Boolean.TRUE))); } @@ -75,7 +75,7 @@ public class DatatypeChannelTests { @Test public void unsupportedTypeButCustomConversionServiceSupports() { QueueChannel channel = createChannel(Integer.class); - GenericConversionService conversionService = new DefaultConversionService(); + GenericConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); conversionService.addConverter(new Converter() { public Integer convert(Boolean source) { return source ? 1 : 0; @@ -115,7 +115,7 @@ public class DatatypeChannelTests { return source ? 1 : 0; } }; - GenericConversionService customConversionService = new DefaultConversionService(); + GenericConversionService customConversionService = ConversionServiceFactory.createDefaultConversionService(); customConversionService.addConverter(new Converter() { public Integer convert(Boolean source) { return source ? 99 : -99; diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java index b1ff7fc770..51f92ed852 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -25,11 +25,12 @@ import java.util.concurrent.TimeUnit; import org.junit.Test; import org.mockito.Mockito; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; import org.springframework.integration.Message; import org.springframework.integration.MessageChannel; @@ -69,7 +70,7 @@ public class GatewayProxyFactoryBeanTests { public void testRequestReplyWithAnonymousChannelConvertedTypeViaConversionService() throws Exception { QueueChannel requestChannel = new QueueChannel(); startResponder(requestChannel); - GenericConversionService cs = new DefaultConversionService(); + GenericConversionService cs = ConversionServiceFactory.createDefaultConversionService(); Converter stringToByteConverter = new Converter() { public byte[] convert(String source) { return source.getBytes(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java index 4550cad1f3..f02af338d4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/transformer/MapToObjectTransformerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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,12 @@ import java.util.HashMap; import java.util.Map; import org.junit.Test; + import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.StaticApplicationContext; import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; import org.springframework.integration.Message; import org.springframework.integration.support.MessageBuilder; @@ -113,7 +114,7 @@ public class MapToObjectTransformerTests { private ConfigurableBeanFactory getBeanFactory(){ DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); - GenericConversionService conversionService = new DefaultConversionService(); + GenericConversionService conversionService = ConversionServiceFactory.createDefaultConversionService(); beanFactory.setConversionService(conversionService); return beanFactory; } diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java index df47123b4c..ed6a46d4e5 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/support/DefaultHttpHeaderMapperFromMessageInboundTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.converter.Converter; -import org.springframework.core.convert.support.DefaultConversionService; +import org.springframework.core.convert.support.ConversionServiceFactory; import org.springframework.core.convert.support.GenericConversionService; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -460,7 +460,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests { public void validateCustomHeadersWithNonStringValuesAndDefaultConverterOnly() throws Exception{ DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper(); mapper.setOutboundHeaderNames(new String[] {"customHeader*"}); - ConversionService cs = new DefaultConversionService(); + ConversionService cs = ConversionServiceFactory.createDefaultConversionService(); DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); beanFactory.registerSingleton("integrationConversionService", cs); mapper.setBeanFactory(beanFactory); @@ -481,7 +481,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests { public void validateCustomHeadersWithNonStringValuesAndDefaultConverterWithCustomConverter() throws Exception{ DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper(); mapper.setOutboundHeaderNames(new String[] {"customHeader*"}); - GenericConversionService cs = new DefaultConversionService(); + GenericConversionService cs = ConversionServiceFactory.createDefaultConversionService(); cs.addConverter(new TestClassConverter()); DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); beanFactory.registerSingleton("integrationConversionService", cs);