diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/ChannelAdapterAnnotationPostProcessor.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/ChannelAdapterAnnotationPostProcessor.java index 226cde4d12..302a5d440e 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/ChannelAdapterAnnotationPostProcessor.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/ChannelAdapterAnnotationPostProcessor.java @@ -34,7 +34,7 @@ import org.springframework.integration.endpoint.PollingConsumer; import org.springframework.integration.endpoint.SourcePollingChannelAdapter; import org.springframework.integration.endpoint.EventDrivenConsumer; import org.springframework.integration.handler.MethodInvokingMessageHandler; -import org.springframework.integration.message.MethodInvokingSource; +import org.springframework.integration.message.MethodInvokingMessageSource; import org.springframework.integration.scheduling.IntervalTrigger; import org.springframework.integration.scheduling.Trigger; import org.springframework.util.Assert; @@ -65,7 +65,7 @@ public class ChannelAdapterAnnotationPostProcessor implements MethodAnnotationPo MessageChannel channel = this.resolveOrCreateChannel(annotation.value()); Poller pollerAnnotation = AnnotationUtils.findAnnotation(method, Poller.class); if (method.getParameterTypes().length == 0 && hasReturnValue(method)) { - MethodInvokingSource source = new MethodInvokingSource(); + MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(bean); source.setMethod(method); endpoint = this.createInboundChannelAdapter(source, channel, pollerAnnotation); @@ -99,7 +99,7 @@ public class ChannelAdapterAnnotationPostProcessor implements MethodAnnotationPo } } - private SourcePollingChannelAdapter createInboundChannelAdapter(MethodInvokingSource source, MessageChannel channel, Poller pollerAnnotation) { + private SourcePollingChannelAdapter createInboundChannelAdapter(MethodInvokingMessageSource source, MessageChannel channel, Poller pollerAnnotation) { Assert.notNull(pollerAnnotation, "The @Poller annotation is required (at method-level) " + "when using the @ChannelAdapter annotation with a no-arg method."); SourcePollingChannelAdapter adapter = new SourcePollingChannelAdapter(); diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/MethodInvokingInboundChannelAdapterParser.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/MethodInvokingInboundChannelAdapterParser.java index 117184ab04..6e761daccd 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/MethodInvokingInboundChannelAdapterParser.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/xml/MethodInvokingInboundChannelAdapterParser.java @@ -21,7 +21,7 @@ import org.w3c.dom.Element; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.integration.message.MethodInvokingSource; +import org.springframework.integration.message.MethodInvokingMessageSource; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -38,7 +38,7 @@ public class MethodInvokingInboundChannelAdapterParser extends AbstractPollingIn Assert.hasText(sourceRef, "The 'ref' attribute is required."); String methodName = element.getAttribute("method"); if (StringUtils.hasText(methodName)) { - BeanDefinitionBuilder invokerBuilder = BeanDefinitionBuilder.genericBeanDefinition(MethodInvokingSource.class); + BeanDefinitionBuilder invokerBuilder = BeanDefinitionBuilder.genericBeanDefinition(MethodInvokingMessageSource.class); invokerBuilder.addPropertyReference("object", sourceRef); invokerBuilder.addPropertyValue("methodName", methodName); sourceRef = BeanDefinitionReaderUtils.registerWithGeneratedName( diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingMessageSource.java similarity index 93% rename from org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java rename to org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingMessageSource.java index 5f0d9b221f..4dd38fb8d6 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingSource.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/message/MethodInvokingMessageSource.java @@ -29,12 +29,12 @@ import org.springframework.integration.util.NameResolvingMethodInvoker; import org.springframework.util.Assert; /** - * A pollable source that invokes a no-argument method so that its return value - * may be sent to a channel. + * A {@link MessageSource} implementation that invokes a no-argument method so + * that its return value may be sent to a channel. * * @author Mark Fisher */ -public class MethodInvokingSource implements MessageSource, InitializingBean { +public class MethodInvokingMessageSource implements MessageSource, InitializingBean { private volatile Object object; diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingSourceTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingSourceTests.java index fa9c8e6caf..31a43d4e19 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingSourceTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/message/MethodInvokingSourceTests.java @@ -23,7 +23,7 @@ import org.junit.Test; import org.springframework.integration.core.Message; import org.springframework.integration.core.MessagingException; -import org.springframework.integration.message.MethodInvokingSource; +import org.springframework.integration.message.MethodInvokingMessageSource; /** * @author Mark Fisher @@ -32,7 +32,7 @@ public class MethodInvokingSourceTests { @Test public void testValidMethod() { - MethodInvokingSource source = new MethodInvokingSource(); + MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(new TestBean()); source.setMethodName("validMethod"); Message result = source.receive(); @@ -43,7 +43,7 @@ public class MethodInvokingSourceTests { @Test(expected=MessagingException.class) public void testNoMatchingMethodName() { - MethodInvokingSource source = new MethodInvokingSource(); + MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(new TestBean()); source.setMethodName("noMatchingMethod"); source.receive(); @@ -51,7 +51,7 @@ public class MethodInvokingSourceTests { @Test(expected=MessagingException.class) public void testInvalidMethodWithArg() { - MethodInvokingSource source = new MethodInvokingSource(); + MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(new TestBean()); source.setMethodName("invalidMethodWithArg"); source.receive(); @@ -59,7 +59,7 @@ public class MethodInvokingSourceTests { @Test(expected=MessagingException.class) public void testInvalidMethodWithNoReturnValue() { - MethodInvokingSource source = new MethodInvokingSource(); + MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(new TestBean()); source.setMethodName("invalidMethodWithNoReturnValue"); source.receive();