String localName = child.getLocalName();
if (localName.equals("beanPostProcessor")) {
createBeanPostProcessor(parserContext, contextId, childElement, builder);
createdBeanPostProcessor = true;
} else if (localName.equals("endpoint")) {
BeanDefinition definition = endpointParser.parse(childElement, parserContext);
String id = childElement.getAttribute("id");
if (ObjectHelper.isNotNullAndNonEmpty(id)) {
// TODO we can zap this?
definition.getPropertyValues()
.addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
// definition.getPropertyValues().addPropertyValue("context",
// builder.getBeanDefinition());
parserContext.registerComponent(new BeanComponentDefinition(definition, id));
}
} else {
BeanDefinitionParser parser = parserMap.get(localName);
if (parser != null) {
BeanDefinition definition = parser.parse(childElement, parserContext);
String id = childElement.getAttribute("id");
if (ObjectHelper.isNotNullAndNonEmpty(id)) {
parserContext.registerComponent(new BeanComponentDefinition(definition, id));
if (localName.equals("jmxAgent")) {
builder.addPropertyReference("camelJMXAgent", id);