}
mapConfigManagedMap.put(name, beanDefinition);
}
public void handleWanReplication(Node node) {
final BeanDefinitionBuilder wanRepConfigBuilder = createBeanBuilder(WanReplicationConfig.class);
final AbstractBeanDefinition beanDefinition = wanRepConfigBuilder.getBeanDefinition();
final Node attName = node.getAttributes().getNamedItem("name");
final String name = getTextContent(attName);
wanRepConfigBuilder.addPropertyValue("name", name);
final ManagedList targetClusters = new ManagedList();
for (Node n : new IterableNodeList(node.getChildNodes(), Node.ELEMENT_NODE)) {
final String nName = cleanNodeName(n);
if ("target-cluster".equals(nName)) {
final BeanDefinitionBuilder targetClusterConfigBuilder = createBeanBuilder(
WanTargetClusterConfig.class);
final AbstractBeanDefinition childBeanDefinition = targetClusterConfigBuilder.getBeanDefinition();
fillAttributeValues(n, targetClusterConfigBuilder, Collections.<String>emptyList());
for (Node childNode : new IterableNodeList(n.getChildNodes(), Node.ELEMENT_NODE)) {
final String childNodeName = cleanNodeName(childNode);
if ("replication-impl".equals(childNodeName)) {
targetClusterConfigBuilder
.addPropertyValue(xmlToJavaName(childNodeName), getTextContent(childNode));
} else if ("replication-impl-object".equals(childNodeName)) {
Node refName = childNode.getAttributes().getNamedItem("ref");
targetClusterConfigBuilder
.addPropertyReference(xmlToJavaName(childNodeName), getTextContent(refName));
} else if ("end-points".equals(childNodeName)) {
final ManagedList addresses = new ManagedList();
for (Node addressNode : new IterableNodeList(childNode.getChildNodes(),
Node.ELEMENT_NODE)) {
if ("address".equals(cleanNodeName(addressNode))) {
addresses.add(getTextContent(addressNode));
}
}
targetClusterConfigBuilder.addPropertyValue("endpoints", addresses);
}
}
targetClusters.add(childBeanDefinition);
}
}