INT-1528 IntegrationNamespaceUtils.parseInnerHandlerDefinition(..) no longer registers the inner bean definition. Relatedly, all polling inbound adapter parsers now return BeanMetadataElement rather than a pre-registered bean's name (flexibility: RuntimeBeanReference, BeanDefintion, etc.)

This commit is contained in:
Mark Fisher
2010-10-27 15:59:29 -04:00
committed by Chris Beams
parent 5a04779bbe
commit 1e9c3c6a8d
15 changed files with 202 additions and 122 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 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.
@@ -18,8 +18,8 @@ package org.springframework.integration.stream.config;
import org.w3c.dom.Element;
import org.springframework.beans.BeanMetadataElement;
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.config.xml.AbstractPollingInboundChannelAdapterParser;
import org.springframework.util.StringUtils;
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
public class ConsoleInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser {
@Override
protected String parseSource(Element element, ParserContext parserContext) {
protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(
"org.springframework.integration.stream.CharacterStreamReadingMessageSource");
builder.setFactoryMethod("stdin");
@@ -40,7 +40,7 @@ public class ConsoleInboundChannelAdapterParser extends AbstractPollingInboundCh
if (StringUtils.hasText(charsetName)) {
builder.addConstructorArgValue(charsetName);
}
return BeanDefinitionReaderUtils.registerWithGeneratedName(builder.getBeanDefinition(), parserContext.getRegistry());
return builder.getBeanDefinition();
}
}