AbstractHandlerEndpointParser's default endpoint type is now SimpleEndpoint instead of HandlerEndpoint. The latter will be removed shortly.
This commit is contained in:
@@ -27,8 +27,8 @@ import org.springframework.beans.factory.support.ManagedList;
|
||||
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.integration.ConfigurationException;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.endpoint.MessageEndpoint;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
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<? extends MessageEndpoint> getEndpointClass() {
|
||||
return HandlerEndpoint.class;
|
||||
return SimpleEndpoint.class;
|
||||
}
|
||||
|
||||
protected void postProcessEndpointBean(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) {
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.config;
|
||||
|
||||
import org.springframework.integration.endpoint.MessageEndpoint;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
import org.springframework.integration.router.RouterMessageHandler;
|
||||
|
||||
@@ -28,11 +26,6 @@ import org.springframework.integration.router.RouterMessageHandler;
|
||||
*/
|
||||
public class RouterParser extends AbstractHandlerEndpointParser {
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageEndpoint> getEndpointClass() {
|
||||
return SimpleEndpoint.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageHandler> getHandlerAdapterClass() {
|
||||
return RouterMessageHandler.class;
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.config;
|
||||
|
||||
import org.springframework.integration.endpoint.MessageEndpoint;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
import org.springframework.integration.handler.DefaultMessageHandler;
|
||||
|
||||
@@ -28,11 +26,6 @@ import org.springframework.integration.handler.DefaultMessageHandler;
|
||||
*/
|
||||
public class ServiceActivatorParser extends AbstractHandlerEndpointParser {
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageEndpoint> getEndpointClass() {
|
||||
return SimpleEndpoint.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageHandler> getHandlerAdapterClass() {
|
||||
return DefaultMessageHandler.class;
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.integration.config;
|
||||
|
||||
import org.springframework.integration.endpoint.MessageEndpoint;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
import org.springframework.integration.handler.MessageHandler;
|
||||
import org.springframework.integration.splitter.SplitterMessageHandler;
|
||||
|
||||
@@ -28,11 +26,6 @@ import org.springframework.integration.splitter.SplitterMessageHandler;
|
||||
*/
|
||||
public class SplitterParser extends AbstractHandlerEndpointParser {
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageEndpoint> getEndpointClass() {
|
||||
return SimpleEndpoint.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends MessageHandler> getHandlerAdapterClass() {
|
||||
return SplitterMessageHandler.class;
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.springframework.integration.bus.MessageBusAware;
|
||||
import org.springframework.integration.channel.MessageChannel;
|
||||
import org.springframework.integration.channel.PollableChannel;
|
||||
import org.springframework.integration.endpoint.EndpointRegistry;
|
||||
import org.springframework.integration.endpoint.HandlerEndpoint;
|
||||
import org.springframework.integration.endpoint.MessagingGateway;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
import org.springframework.integration.handler.ReplyMessageCorrelator;
|
||||
import org.springframework.integration.message.DefaultMessageCreator;
|
||||
import org.springframework.integration.message.DefaultMessageMapper;
|
||||
@@ -205,9 +205,9 @@ public class SimpleMessagingGateway extends MessagingGatewaySupport implements M
|
||||
throw new ConfigurationException("No EndpointRegistry available. Cannot register ReplyMessageCorrelator.");
|
||||
}
|
||||
ReplyMessageCorrelator correlator = new ReplyMessageCorrelator(this.replyMapCapacity);
|
||||
HandlerEndpoint endpoint = new HandlerEndpoint(correlator);
|
||||
SimpleEndpoint<ReplyMessageCorrelator> endpoint = new SimpleEndpoint<ReplyMessageCorrelator>(correlator);
|
||||
endpoint.setBeanName("internal.correlator." + this);
|
||||
endpoint.setSource(this.replyChannel);
|
||||
endpoint.setName("internal.correlator." + this);
|
||||
this.endpointRegistry.registerEndpoint(endpoint);
|
||||
this.replyMessageCorrelator = correlator;
|
||||
}
|
||||
|
||||
@@ -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.HandlerEndpoint;
|
||||
import org.springframework.integration.endpoint.SimpleEndpoint;
|
||||
import org.springframework.integration.message.Message;
|
||||
import org.springframework.integration.message.MessageBuilder;
|
||||
import org.springframework.integration.util.MethodInvoker;
|
||||
@@ -54,8 +54,9 @@ public class AggregatorParserTests {
|
||||
|
||||
@Test
|
||||
public void testAggregation() {
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) context.getBean("aggregatorWithReference");
|
||||
AggregatingMessageHandler aggregatingHandler = (AggregatingMessageHandler) endpoint.getHandler();
|
||||
SimpleEndpoint<?> endpoint = (SimpleEndpoint<?>) context.getBean("aggregatorWithReference");
|
||||
AggregatingMessageHandler aggregatingHandler =
|
||||
(AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler");
|
||||
TestAggregator aggregatorBean = (TestAggregator) context.getBean("aggregatorBean");
|
||||
List<Message<?>> outboundMessages = new ArrayList<Message<?>>();
|
||||
outboundMessages.add(createMessage("123", "id1", 3, 1, null));
|
||||
@@ -73,9 +74,9 @@ public class AggregatorParserTests {
|
||||
|
||||
@Test
|
||||
public void testPropertyAssignment() throws Exception {
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) context.getBean("completelyDefinedAggregator");
|
||||
SimpleEndpoint<?> endpoint = (SimpleEndpoint<?>) context.getBean("completelyDefinedAggregator");
|
||||
AggregatingMessageHandler completeAggregatingMessageHandler =
|
||||
(AggregatingMessageHandler) endpoint.getHandler();
|
||||
(AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler");
|
||||
TestAggregator testAggregator = (TestAggregator) context.getBean("aggregatorBean");
|
||||
CompletionStrategy completionStrategy = (CompletionStrategy) context.getBean("completionStrategy");
|
||||
MessageChannel outputChannel = (MessageChannel) context.getBean("outputChannel");
|
||||
@@ -107,8 +108,9 @@ public class AggregatorParserTests {
|
||||
@Test
|
||||
public void testSimpleJavaBeanAggregator() {
|
||||
List<Message<?>> outboundMessages = new ArrayList<Message<?>>();
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) context.getBean("aggregatorWithReferenceAndMethod");
|
||||
AggregatingMessageHandler addingAggregator = (AggregatingMessageHandler) endpoint.getHandler();
|
||||
SimpleEndpoint<?> endpoint = (SimpleEndpoint<?>) context.getBean("aggregatorWithReferenceAndMethod");
|
||||
AggregatingMessageHandler addingAggregator =
|
||||
(AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler");
|
||||
outboundMessages.add(createMessage(1l, "id1", 3, 1, null));
|
||||
outboundMessages.add(createMessage(2l, "id1", 3, 3, null));
|
||||
outboundMessages.add(createMessage(3l, "id1", 3, 2, null));
|
||||
@@ -133,8 +135,9 @@ public class AggregatorParserTests {
|
||||
|
||||
@Test
|
||||
public void testAggregatorWithPojoCompletionStrategy(){
|
||||
HandlerEndpoint endpoint = (HandlerEndpoint) context.getBean("aggregatorWithPojoCompletionStrategy");
|
||||
AggregatingMessageHandler aggregatorWithPojoCompletionStrategy = (AggregatingMessageHandler) endpoint.getHandler();
|
||||
SimpleEndpoint<?> endpoint = (SimpleEndpoint<?>) context.getBean("aggregatorWithPojoCompletionStrategy");
|
||||
AggregatingMessageHandler aggregatorWithPojoCompletionStrategy =
|
||||
(AggregatingMessageHandler) new DirectFieldAccessor(endpoint).getPropertyValue("handler");
|
||||
CompletionStrategy completionStrategy = (CompletionStrategy)
|
||||
new DirectFieldAccessor(aggregatorWithPojoCompletionStrategy).getPropertyValue("completionStrategy");
|
||||
Assert.assertTrue(completionStrategy instanceof CompletionStrategyAdapter);
|
||||
|
||||
Reference in New Issue
Block a user