INT-3124 JMX Check Mutually Exclusive Attributes

Only one of query-name and query-name-ref
Only one of query-expression and query-expression-ref
This commit is contained in:
Gary Russell
2013-09-03 18:49:54 -04:00
parent 98b42cbe36
commit 81ac7e56be
2 changed files with 16 additions and 4 deletions

View File

@@ -53,6 +53,14 @@ public class MBeanTreePollingChannelAdapterParser extends AbstractPollingInbound
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "query-name", "queryName");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "query-expression", "queryExpression");
if (StringUtils.hasText(element.getAttribute("query-name"))
&& StringUtils.hasText(element.getAttribute("query-name-ref"))) {
parserContext.getReaderContext().error("Cannot have both `query-name' and 'query-name-ref'", element);
}
if (StringUtils.hasText(element.getAttribute("query-expression"))
&& StringUtils.hasText(element.getAttribute("query-expression-ref"))) {
parserContext.getReaderContext().error("Cannot have both `query-expression' and 'query-expression-ref'", element);
}
BeanComponentDefinition innerBeanDef = IntegrationNamespaceUtils.parseInnerHandlerDefinition(element, parserContext);
String beanName = element.getAttribute("converter");