diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractHandlerEndpointParser.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractHandlerEndpointParser.java index 3dcfc71a4d..e7453f5ea3 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractHandlerEndpointParser.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/AbstractHandlerEndpointParser.java @@ -28,7 +28,7 @@ import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.integration.ConfigurationException; import org.springframework.integration.endpoint.MessageEndpoint; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; @@ -127,7 +127,7 @@ public abstract class AbstractHandlerEndpointParser extends AbstractSingleBeanDe * Subclasses may override this to return a specific MessageEndpoint class. */ protected Class getEndpointClass() { - return SimpleEndpoint.class; + return DefaultEndpoint.class; } protected void postProcessEndpointBean(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) { diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/HandlerAnnotationPostProcessor.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/HandlerAnnotationPostProcessor.java index fb5f2fff78..a6330c84d6 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/HandlerAnnotationPostProcessor.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/HandlerAnnotationPostProcessor.java @@ -40,7 +40,7 @@ import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.ChannelRegistryAware; import org.springframework.integration.endpoint.ConcurrencyPolicy; import org.springframework.integration.endpoint.MessageEndpoint; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.endpoint.interceptor.ConcurrencyInterceptor; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.handler.MessageHandlerChain; @@ -131,7 +131,7 @@ public class HandlerAnnotationPostProcessor extends AbstractAnnotationMethodPost public MessageEndpoint createEndpoint(Object bean, String beanName, Class originalBeanClass, org.springframework.integration.annotation.MessageEndpoint endpointAnnotation) { - SimpleEndpoint endpoint = new SimpleEndpoint((MessageHandler) bean); + DefaultEndpoint endpoint = new DefaultEndpoint((MessageHandler) bean); String outputChannelName = endpointAnnotation.output(); if (StringUtils.hasText(outputChannelName)) { endpoint.setOutputChannelName(outputChannelName); diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/SubscriberAnnotationPostProcessor.java b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/SubscriberAnnotationPostProcessor.java index 24a3e99155..af2e5ba00e 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/SubscriberAnnotationPostProcessor.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/config/annotation/SubscriberAnnotationPostProcessor.java @@ -28,7 +28,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.integration.annotation.Subscriber; import org.springframework.integration.bus.MessageBus; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.DefaultMessageHandler; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -92,7 +92,7 @@ public class SubscriberAnnotationPostProcessor implements BeanPostProcessor { handler.afterPropertiesSet(); String endpointName = ClassUtils.getShortNameAsProperty(targetClass) + "." + method.getName() + ".endpoint"; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setBeanName(endpointName); endpoint.setInputChannelName(channelName); messageBus.registerEndpoint(endpoint); diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java b/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/DefaultEndpoint.java similarity index 96% rename from org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java rename to org.springframework.integration/src/main/java/org/springframework/integration/endpoint/DefaultEndpoint.java index 610e189c84..d58c73bc7a 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/SimpleEndpoint.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/endpoint/DefaultEndpoint.java @@ -45,7 +45,7 @@ import org.springframework.integration.util.ErrorHandler; import org.springframework.util.Assert; /** - * The most basic Message Endpoint implementation. Serves as a "host" for any + * The default Message Endpoint implementation. Serves as a "host" for any * {@link MessageHandler} and resolves the target for any reply Message(s) * returned by that handler. If the handler returns a non-empty * {@link CompositeMessage}, each Message in its list will be sent @@ -66,7 +66,7 @@ import org.springframework.util.Assert; * * @author Mark Fisher */ -public class SimpleEndpoint implements MessageEndpoint, ChannelRegistryAware, BeanNameAware { +public class DefaultEndpoint implements MessageEndpoint, ChannelRegistryAware, BeanNameAware { private final Log logger = LogFactory.getLog(this.getClass()); @@ -92,7 +92,7 @@ public class SimpleEndpoint implements MessageEndpoint /** * Create an endpoint for the given handler. */ - public SimpleEndpoint(T handler) { + public DefaultEndpoint(T handler) { Assert.notNull(handler, "handler must not be null"); this.handler = handler; } @@ -239,7 +239,7 @@ public class SimpleEndpoint implements MessageEndpoint return nextInterceptor.aroundHandle(requestMessage, new MessageHandler() { @SuppressWarnings("unchecked") public Message handle(Message message) { - return SimpleEndpoint.this.handleMessage(message, index + 1); + return DefaultEndpoint.this.handleMessage(message, index + 1); } }); } @@ -330,7 +330,7 @@ public class SimpleEndpoint implements MessageEndpoint return (this.name != null) ? this.name : super.toString(); } - /* TODO: remove the following methods after they are removed from the MessageEndpoint interface. */ + /* TODO: the following properties/methods are candidates for removal from the MessageEndpoint interface. */ private volatile String inputChannelName; private volatile String outputChannelName; diff --git a/org.springframework.integration/src/main/java/org/springframework/integration/gateway/SimpleMessagingGateway.java b/org.springframework.integration/src/main/java/org/springframework/integration/gateway/SimpleMessagingGateway.java index 1e47547b83..26d978bbd1 100644 --- a/org.springframework.integration/src/main/java/org/springframework/integration/gateway/SimpleMessagingGateway.java +++ b/org.springframework.integration/src/main/java/org/springframework/integration/gateway/SimpleMessagingGateway.java @@ -23,7 +23,7 @@ import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.PollableChannel; import org.springframework.integration.endpoint.EndpointRegistry; import org.springframework.integration.endpoint.MessagingGateway; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.ReplyMessageCorrelator; import org.springframework.integration.message.DefaultMessageCreator; import org.springframework.integration.message.DefaultMessageMapper; @@ -205,7 +205,7 @@ public class SimpleMessagingGateway extends MessagingGatewaySupport implements M throw new ConfigurationException("No EndpointRegistry available. Cannot register ReplyMessageCorrelator."); } ReplyMessageCorrelator correlator = new ReplyMessageCorrelator(this.replyMapCapacity); - SimpleEndpoint endpoint = new SimpleEndpoint(correlator); + DefaultEndpoint endpoint = new DefaultEndpoint(correlator); endpoint.setBeanName("internal.correlator." + this); endpoint.setSource(this.replyChannel); this.endpointRegistry.registerEndpoint(endpoint); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java index 755eb681f0..66811a4b8c 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DefaultMessageBusTests.java @@ -33,7 +33,7 @@ import org.springframework.integration.channel.PollableChannel; import org.springframework.integration.channel.PollableChannelAdapter; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.dispatcher.PublishSubscribeChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.ErrorMessage; import org.springframework.integration.message.GenericMessage; @@ -63,7 +63,7 @@ public class DefaultMessageBusTests { return message; } }; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setBeanName("testEndpoint"); endpoint.setSource(sourceChannel); bus.registerEndpoint(endpoint); @@ -88,7 +88,7 @@ public class DefaultMessageBusTests { return message; } }; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setBeanName("testEndpoint"); endpoint.setInputChannelName("sourceChannel"); bus.registerEndpoint(endpoint); @@ -146,10 +146,10 @@ public class DefaultMessageBusTests { bus.registerChannel("input", inputChannel); bus.registerChannel("output1", outputChannel1); bus.registerChannel("output2", outputChannel2); - SimpleEndpoint endpoint1 = new SimpleEndpoint(handler1); + DefaultEndpoint endpoint1 = new DefaultEndpoint(handler1); endpoint1.setBeanName("testEndpoint1"); endpoint1.setSource(inputChannel); - SimpleEndpoint endpoint2 = new SimpleEndpoint(handler2); + DefaultEndpoint endpoint2 = new DefaultEndpoint(handler2); endpoint2.setBeanName("testEndpoint2"); endpoint2.setSource(inputChannel); bus.registerEndpoint(endpoint1); @@ -188,10 +188,10 @@ public class DefaultMessageBusTests { bus.registerChannel("input", inputChannel); bus.registerChannel("output1", outputChannel1); bus.registerChannel("output2", outputChannel2); - SimpleEndpoint endpoint1 = new SimpleEndpoint(handler1); + DefaultEndpoint endpoint1 = new DefaultEndpoint(handler1); endpoint1.setBeanName("testEndpoint1"); endpoint1.setSource(inputChannel); - SimpleEndpoint endpoint2 = new SimpleEndpoint(handler2); + DefaultEndpoint endpoint2 = new DefaultEndpoint(handler2); endpoint2.setBeanName("testEndpoint2"); endpoint2.setSource(inputChannel); bus.registerEndpoint(endpoint1); @@ -218,7 +218,7 @@ public class DefaultMessageBusTests { return message; } }; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setBeanName("testEndpoint"); endpoint.setSource(channelAdapter); bus.registerEndpoint(endpoint); @@ -258,7 +258,7 @@ public class DefaultMessageBusTests { return null; } }; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setBeanName("testEndpoint"); endpoint.setInputChannelName(MessageBus.ERROR_CHANNEL_NAME); bus.registerEndpoint(endpoint); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java index 9b2ebc9125..91550663bf 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/DirectChannelSubscriptionTests.java @@ -28,7 +28,7 @@ import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.channel.ThreadLocalChannel; import org.springframework.integration.config.annotation.MessagingAnnotationPostProcessor; import org.springframework.integration.dispatcher.DirectChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessagingException; @@ -55,7 +55,7 @@ public class DirectChannelSubscriptionTests { @Test public void testSendAndReceiveForRegisteredEndpoint() { - SimpleEndpoint endpoint = new SimpleEndpoint(new TestHandler()); + DefaultEndpoint endpoint = new DefaultEndpoint(new TestHandler()); endpoint.setInputChannelName("sourceChannel"); endpoint.setOutputChannelName("targetChannel"); endpoint.setBeanName("testEndpoint"); @@ -84,7 +84,7 @@ public class DirectChannelSubscriptionTests { public void testExceptionThrownFromRegisteredEndpoint() { QueueChannel errorChannel = new QueueChannel(); bus.setErrorChannel(errorChannel); - SimpleEndpoint endpoint = new SimpleEndpoint(new MessageHandler() { + DefaultEndpoint endpoint = new DefaultEndpoint(new MessageHandler() { public Message handle(Message message) { throw new RuntimeException("intentional test failure"); } diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml b/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml index fe46980d98..fdd59d3dff 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml +++ b/org.springframework.integration/src/test/java/org/springframework/integration/bus/messageBusTests.xml @@ -10,7 +10,7 @@ - + diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java index 8fd545039c..e657ff4d3f 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/AggregatorParserTests.java @@ -33,7 +33,7 @@ import org.springframework.integration.aggregator.CompletionStrategy; import org.springframework.integration.aggregator.CompletionStrategyAdapter; import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.PollableChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageBuilder; import org.springframework.integration.util.MethodInvoker; @@ -54,7 +54,7 @@ public class AggregatorParserTests { @Test public void testAggregation() { - SimpleEndpoint endpoint = (SimpleEndpoint) context.getBean("aggregatorWithReference"); + DefaultEndpoint endpoint = (DefaultEndpoint) context.getBean("aggregatorWithReference"); AggregatingMessageHandler aggregatingHandler = (AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler"); TestAggregator aggregatorBean = (TestAggregator) context.getBean("aggregatorBean"); @@ -74,7 +74,7 @@ public class AggregatorParserTests { @Test public void testPropertyAssignment() throws Exception { - SimpleEndpoint endpoint = (SimpleEndpoint) context.getBean("completelyDefinedAggregator"); + DefaultEndpoint endpoint = (DefaultEndpoint) context.getBean("completelyDefinedAggregator"); AggregatingMessageHandler completeAggregatingMessageHandler = (AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler"); TestAggregator testAggregator = (TestAggregator) context.getBean("aggregatorBean"); @@ -108,7 +108,7 @@ public class AggregatorParserTests { @Test public void testSimpleJavaBeanAggregator() { List> outboundMessages = new ArrayList>(); - SimpleEndpoint endpoint = (SimpleEndpoint) context.getBean("aggregatorWithReferenceAndMethod"); + DefaultEndpoint endpoint = (DefaultEndpoint) context.getBean("aggregatorWithReferenceAndMethod"); AggregatingMessageHandler addingAggregator = (AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler"); outboundMessages.add(createMessage(1l, "id1", 3, 1, null)); @@ -135,7 +135,7 @@ public class AggregatorParserTests { @Test public void testAggregatorWithPojoCompletionStrategy(){ - SimpleEndpoint endpoint = (SimpleEndpoint) context.getBean("aggregatorWithPojoCompletionStrategy"); + DefaultEndpoint endpoint = (DefaultEndpoint) context.getBean("aggregatorWithPojoCompletionStrategy"); AggregatingMessageHandler aggregatorWithPojoCompletionStrategy = (AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler"); CompletionStrategy completionStrategy = (CompletionStrategy) diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/MessageBusParserTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/MessageBusParserTests.java index f47279ec28..05ccf1f294 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/MessageBusParserTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/MessageBusParserTests.java @@ -41,7 +41,7 @@ import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.channel.config.ChannelParserTests; import org.springframework.integration.dispatcher.DirectChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.handler.TestHandlers; import org.springframework.integration.scheduling.spi.ProviderTaskScheduler; @@ -75,7 +75,7 @@ public class MessageBusParserTests { ApplicationContext context = new ClassPathXmlApplicationContext( "messageBusWithDefaults.xml", this.getClass()); MessageBus bus = (MessageBus) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.nullHandler()); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.nullHandler()); endpoint.setBeanName("testEndpoint"); endpoint.setInputChannelName("unknownChannel"); bus.registerEndpoint(endpoint); @@ -86,7 +86,7 @@ public class MessageBusParserTests { ApplicationContext context = new ClassPathXmlApplicationContext( "messageBusWithAutoCreateChannels.xml", this.getClass()); MessageBus bus = (MessageBus) context.getBean(MessageBusParser.MESSAGE_BUS_BEAN_NAME); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.nullHandler()); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.nullHandler()); endpoint.setBeanName("testEndpoint"); endpoint.setInputChannelName("channelToCreate"); bus.registerEndpoint(endpoint); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java index fb9e629b97..0e7235a92d 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/AggregatorAnnotationTests.java @@ -33,7 +33,7 @@ import org.springframework.integration.aggregator.CompletionStrategyAdapter; import org.springframework.integration.aggregator.SequenceSizeCompletionStrategy; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.config.MessageBusParser; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; /** @@ -111,7 +111,7 @@ public class AggregatorAnnotationTests { @SuppressWarnings("unchecked") private DirectFieldAccessor getDirectFieldAccessorForAggregatingHandler(ApplicationContext context, final String endpointName) { MessageBus messageBus = this.getMessageBus(context); - SimpleEndpoint endpoint = (SimpleEndpoint) messageBus.lookupEndpoint(endpointName + ".MessageHandler.endpoint"); + DefaultEndpoint endpoint = (DefaultEndpoint) messageBus.lookupEndpoint(endpointName + ".MessageHandler.endpoint"); MessageHandler handler = (MessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler"); try { if (AopUtils.isAopProxy(handler)) { diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java index 2798895078..ea66feb16a 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java @@ -56,7 +56,7 @@ import org.springframework.integration.channel.MessageChannel; import org.springframework.integration.channel.PollableChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.endpoint.EndpointInterceptor; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; import org.springframework.integration.message.StringMessage; @@ -184,7 +184,7 @@ public class MessagingAnnotationPostProcessorTests { postProcessor.afterPropertiesSet(); ConcurrencyAnnotationTestBean testBean = new ConcurrencyAnnotationTestBean(); postProcessor.postProcessAfterInitialization(testBean, "testBean"); - SimpleEndpoint endpoint = (SimpleEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint"); + DefaultEndpoint endpoint = (DefaultEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint"); DirectFieldAccessor accessor = new DirectFieldAccessor(endpoint); List interceptors = (List) accessor.getPropertyValue("interceptors"); assertEquals(1, interceptors.size()); @@ -362,7 +362,7 @@ public class MessagingAnnotationPostProcessorTests { postProcessor.afterPropertiesSet(); AnnotatedEndpointWithPolledAnnotation endpoint = new AnnotatedEndpointWithPolledAnnotation(); postProcessor.postProcessAfterInitialization(endpoint, "testBean"); - SimpleEndpoint processedEndpoint = (SimpleEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint"); + DefaultEndpoint processedEndpoint = (DefaultEndpoint) messageBus.lookupEndpoint("testBean.MessageHandler.endpoint"); Schedule schedule = processedEndpoint.getSchedule(); assertEquals(PollingSchedule.class, schedule.getClass()); PollingSchedule pollingSchedule = (PollingSchedule) schedule; diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/SimpleDispatcherTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/SimpleDispatcherTests.java index 82873b99fa..ea4dc00bd4 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/SimpleDispatcherTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/dispatcher/SimpleDispatcherTests.java @@ -26,7 +26,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.junit.Test; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.handler.TestHandlers; import org.springframework.integration.message.Message; @@ -74,9 +74,9 @@ public class SimpleDispatcherTests { final AtomicInteger counter2 = new AtomicInteger(); final AtomicInteger counter3 = new AtomicInteger(); final AtomicInteger selectorCounter = new AtomicInteger(); - SimpleEndpoint endpoint1 = createEndpoint(TestHandlers.countingCountDownHandler(counter1, latch)); - SimpleEndpoint endpoint2 = createEndpoint(TestHandlers.countingCountDownHandler(counter2, latch)); - SimpleEndpoint endpoint3 = createEndpoint(TestHandlers.countingCountDownHandler(counter3, latch)); + DefaultEndpoint endpoint1 = createEndpoint(TestHandlers.countingCountDownHandler(counter1, latch)); + DefaultEndpoint endpoint2 = createEndpoint(TestHandlers.countingCountDownHandler(counter2, latch)); + DefaultEndpoint endpoint3 = createEndpoint(TestHandlers.countingCountDownHandler(counter3, latch)); endpoint1.setSelector(new TestMessageSelector(selectorCounter, false)); endpoint2.setSelector(new TestMessageSelector(selectorCounter, false)); endpoint3.setSelector(new TestMessageSelector(selectorCounter, true)); @@ -101,9 +101,9 @@ public class SimpleDispatcherTests { final AtomicInteger counter2 = new AtomicInteger(); final AtomicInteger counter3 = new AtomicInteger(); final AtomicInteger selectorCounter = new AtomicInteger(); - SimpleEndpoint endpoint1 = createEndpoint(TestHandlers.countingCountDownHandler(counter1, latch)); - SimpleEndpoint endpoint2 = createEndpoint(TestHandlers.countingCountDownHandler(counter2, latch)); - SimpleEndpoint endpoint3 = createEndpoint(TestHandlers.countingCountDownHandler(counter3, latch)); + DefaultEndpoint endpoint1 = createEndpoint(TestHandlers.countingCountDownHandler(counter1, latch)); + DefaultEndpoint endpoint2 = createEndpoint(TestHandlers.countingCountDownHandler(counter2, latch)); + DefaultEndpoint endpoint3 = createEndpoint(TestHandlers.countingCountDownHandler(counter3, latch)); endpoint1.setSelector(new TestMessageSelector(selectorCounter, false)); endpoint2.setSelector(new TestMessageSelector(selectorCounter, false)); endpoint3.setSelector(new TestMessageSelector(selectorCounter, false)); @@ -133,9 +133,9 @@ public class SimpleDispatcherTests { TestMessageHandler handler1 = new TestMessageHandler(handlerCounter, 4); TestMessageHandler handler2 = new TestMessageHandler(handlerCounter, 4); TestMessageHandler handler3 = new TestMessageHandler(handlerCounter, 2); - SimpleEndpoint endpoint1 = new SimpleEndpoint(handler1); - SimpleEndpoint endpoint2 = new SimpleEndpoint(handler2); - SimpleEndpoint endpoint3 = new SimpleEndpoint(handler3); + DefaultEndpoint endpoint1 = new DefaultEndpoint(handler1); + DefaultEndpoint endpoint2 = new DefaultEndpoint(handler2); + DefaultEndpoint endpoint3 = new DefaultEndpoint(handler3); dispatcher.addTarget(endpoint1); dispatcher.addTarget(endpoint2); dispatcher.addTarget(endpoint3); @@ -147,8 +147,8 @@ public class SimpleDispatcherTests { } - private static SimpleEndpoint createEndpoint(MessageHandler handler) { - return new SimpleEndpoint(handler); + private static DefaultEndpoint createEndpoint(MessageHandler handler) { + return new DefaultEndpoint(handler); } diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/HandlerEndpointTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/DefaultEndpointTests.java similarity index 87% rename from org.springframework.integration/src/test/java/org/springframework/integration/endpoint/HandlerEndpointTests.java rename to org.springframework.integration/src/test/java/org/springframework/integration/endpoint/DefaultEndpointTests.java index 5b756d1d6c..14e2fa2d7f 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/HandlerEndpointTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/endpoint/DefaultEndpointTests.java @@ -46,13 +46,13 @@ import org.springframework.integration.message.selector.MessageSelectorChain; /** * @author Mark Fisher */ -public class HandlerEndpointTests { +public class DefaultEndpointTests { @Test public void outputChannel() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setOutputChannel(channel); Message message = MessageBuilder.fromPayload("foo").build(); endpoint.send(message); @@ -65,7 +65,7 @@ public class HandlerEndpointTests { public void returnAddressHeader() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); Message message = MessageBuilder.fromPayload("foo").setReturnAddress(channel).build(); endpoint.send(message); Message reply = channel.receive(0); @@ -79,7 +79,7 @@ public class HandlerEndpointTests { QueueChannel channel2 = new QueueChannel(1); QueueChannel channel3 = new QueueChannel(1); MessageHandler handler = new TestNextTargetSettingHandler(channel1); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setOutputChannel(channel2); Message message = MessageBuilder.fromPayload("foo").setReturnAddress(channel3).build(); endpoint.send(message); @@ -98,7 +98,7 @@ public class HandlerEndpointTests { ChannelRegistry channelRegistry = new DefaultMessageBus(); channelRegistry.registerChannel("testChannel", channel); MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setChannelRegistry(channelRegistry); Message message = MessageBuilder.fromPayload("foo").setReturnAddress("testChannel").build(); endpoint.send(message); @@ -115,7 +115,7 @@ public class HandlerEndpointTests { ChannelRegistry channelRegistry = new DefaultMessageBus(); channelRegistry.registerChannel("testChannel", channel1); MessageHandler handler = new TestNextTargetSettingHandler("testChannel"); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setChannelRegistry(channelRegistry); endpoint.setOutputChannel(channel2); Message message = MessageBuilder.fromPayload("foo").setReturnAddress(channel3).build(); @@ -140,7 +140,7 @@ public class HandlerEndpointTests { return new StringMessage("foo" + message.getPayload()); } }; - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setChannelRegistry(channelRegistry); Message testMessage1 = MessageBuilder.fromPayload("bar") .setReturnAddress(replyChannel1).build(); @@ -164,7 +164,7 @@ public class HandlerEndpointTests { public void noOutputChannelFallsBackToReturnAddress() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); Message message = MessageBuilder.fromPayload("foo").setReturnAddress(channel).build(); endpoint.send(message); Message reply = channel.receive(0); @@ -176,7 +176,7 @@ public class HandlerEndpointTests { public void unknownNextTargetChannelFallsBackToOutputChannel() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setOutputChannel(channel); Message message = MessageBuilder.fromPayload("foo").setNextTarget("unknown").build(); endpoint.send(message); @@ -188,7 +188,7 @@ public class HandlerEndpointTests { @Test(expected = MessageEndpointReplyException.class) public void noReplyTarget() { MessageHandler handler = new TestHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); Message message = MessageBuilder.fromPayload("foo").build(); endpoint.send(message); } @@ -197,7 +197,7 @@ public class HandlerEndpointTests { public void noReplyMessage() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestNullReplyHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setOutputChannel(channel); Message message = MessageBuilder.fromPayload("foo").build(); endpoint.send(message); @@ -208,7 +208,7 @@ public class HandlerEndpointTests { public void noReplyMessageWithRequiresReply() { QueueChannel channel = new QueueChannel(1); MessageHandler handler = new TestNullReplyHandler(); - SimpleEndpoint endpoint = new SimpleEndpoint(handler); + DefaultEndpoint endpoint = new DefaultEndpoint(handler); endpoint.setRequiresReply(true); endpoint.setOutputChannel(channel); Message message = MessageBuilder.fromPayload("foo").build(); @@ -217,7 +217,7 @@ public class HandlerEndpointTests { @Test(expected=MessageRejectedException.class) public void endpointWithSelectorRejecting() { - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.nullHandler()); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.nullHandler()); endpoint.setSelector(new MessageSelector() { public boolean accept(Message message) { return false; @@ -229,7 +229,7 @@ public class HandlerEndpointTests { @Test public void endpointWithSelectorAccepting() throws InterruptedException { CountDownLatch latch = new CountDownLatch(1); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.countDownHandler(latch)); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.countDownHandler(latch)); endpoint.setSelector(new MessageSelector() { public boolean accept(Message message) { return true; @@ -243,7 +243,7 @@ public class HandlerEndpointTests { @Test public void endpointWithMultipleSelectorsAndFirstRejects() { final AtomicInteger counter = new AtomicInteger(); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.countingHandler(counter)); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.countingHandler(counter)); MessageSelectorChain selectorChain = new MessageSelectorChain(); selectorChain.add(new MessageSelector() { public boolean accept(Message message) { @@ -273,7 +273,7 @@ public class HandlerEndpointTests { public void endpointWithMultipleSelectorsAndFirstAccepts() { final AtomicInteger selectorCounter = new AtomicInteger(); AtomicInteger handlerCounter = new AtomicInteger(); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.countingHandler(handlerCounter)); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.countingHandler(handlerCounter)); MessageSelectorChain selectorChain = new MessageSelectorChain(); selectorChain.add(new MessageSelector() { public boolean accept(Message message) { @@ -303,7 +303,7 @@ public class HandlerEndpointTests { @Test public void endpointWithMultipleSelectorsAndBothAccept() { final AtomicInteger counter = new AtomicInteger(); - SimpleEndpoint endpoint = new SimpleEndpoint(TestHandlers.countingHandler(counter)); + DefaultEndpoint endpoint = new DefaultEndpoint(TestHandlers.countingHandler(counter)); MessageSelectorChain selectorChain = new MessageSelectorChain(); selectorChain.add(new MessageSelector() { public boolean accept(Message message) { @@ -325,7 +325,7 @@ public class HandlerEndpointTests { @Test public void correlationId() { QueueChannel replyChannel = new QueueChannel(1); - SimpleEndpoint endpoint = new SimpleEndpoint(new MessageHandler() { + DefaultEndpoint endpoint = new DefaultEndpoint(new MessageHandler() { public Message handle(Message message) { return message; } @@ -340,7 +340,7 @@ public class HandlerEndpointTests { @Test public void correlationIdSetByHandlerTakesPrecedence() { QueueChannel replyChannel = new QueueChannel(1); - SimpleEndpoint endpoint = new SimpleEndpoint(new MessageHandler() { + DefaultEndpoint endpoint = new DefaultEndpoint(new MessageHandler() { public Message handle(Message message) { return MessageBuilder.fromMessage(message) .setCorrelationId("ABC-123").build(); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java index 1d7f0cdba4..583ddd8fc1 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/handler/CorrelationIdTests.java @@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import org.springframework.integration.channel.QueueChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageBuilder; import org.springframework.integration.message.StringMessage; @@ -114,7 +114,7 @@ public class CorrelationIdTests { QueueChannel testChannel = new QueueChannel(); SplitterMessageHandler splitter = new SplitterMessageHandler( new TestBean(), TestBean.class.getMethod("split", String.class)); - SimpleEndpoint endpoint = new SimpleEndpoint(splitter); + DefaultEndpoint endpoint = new DefaultEndpoint(splitter); endpoint.setOutputChannel(testChannel); splitter.afterPropertiesSet(); endpoint.send(message); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/handler/MethodInvokingTargetTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/handler/MethodInvokingTargetTests.java index 733acf3f63..6e39a9bea8 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/handler/MethodInvokingTargetTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/handler/MethodInvokingTargetTests.java @@ -32,7 +32,7 @@ import org.springframework.integration.bus.DefaultMessageBus; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.endpoint.MessageEndpoint; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.message.GenericMessage; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessagingException; @@ -99,7 +99,7 @@ public class MethodInvokingTargetTests { assertNull(queue.poll()); MessageBus bus = new DefaultMessageBus(); bus.registerChannel("channel", channel); - MessageEndpoint endpoint = new SimpleEndpoint(target); + MessageEndpoint endpoint = new DefaultEndpoint(target); endpoint.setBeanName("testEndpoint"); endpoint.setSource(channel); bus.registerEndpoint(endpoint); diff --git a/org.springframework.integration/src/test/java/org/springframework/integration/message/MessageExchangeTemplateTests.java b/org.springframework.integration/src/test/java/org/springframework/integration/message/MessageExchangeTemplateTests.java index b0d47176a2..45cd892c7e 100644 --- a/org.springframework.integration/src/test/java/org/springframework/integration/message/MessageExchangeTemplateTests.java +++ b/org.springframework.integration/src/test/java/org/springframework/integration/message/MessageExchangeTemplateTests.java @@ -29,7 +29,7 @@ import org.junit.Test; import org.springframework.integration.bus.DefaultMessageBus; import org.springframework.integration.bus.MessageBus; import org.springframework.integration.channel.QueueChannel; -import org.springframework.integration.endpoint.SimpleEndpoint; +import org.springframework.integration.endpoint.DefaultEndpoint; import org.springframework.integration.handler.MessageHandler; import org.springframework.integration.message.Message; import org.springframework.integration.message.MessageBuilder; @@ -53,7 +53,7 @@ public class MessageExchangeTemplateTests { }; MessageBus bus = new DefaultMessageBus(); bus.registerChannel("requestChannel", requestChannel); - SimpleEndpoint endpoint = new SimpleEndpoint(testHandler); + DefaultEndpoint endpoint = new DefaultEndpoint(testHandler); endpoint.setBeanName("testEndpoint"); endpoint.setSource(requestChannel); bus.registerEndpoint(endpoint);