for (Element methodEle : methods) {
String methodName = methodEle.getAttribute(METHOD_NAME_ATTRIBUTE);
TypedStringValue nameHolder = new TypedStringValue(methodName);
nameHolder.setSource(parserContext.extractSource(methodEle));
RuleBasedCircuitBreakerAttribute attribute = new RuleBasedCircuitBreakerAttribute();
attribute.setMethodName(methodName);
String cbName = methodEle.getAttribute(CB_NAME_ATTRIBUTE);
if (StringUtils.isEmpty(cbName)) {
attribute.setName(methodName);
} else {
attribute.setName(cbName);
}
ManagedMap<String, String> props = new ManagedMap<String, String>();
Element propsElement = DomUtils.getChildElementByTagName(methodEle, "properties");
if (propsElement != null) {
//Map<String, String> props = new HashMap<String, String>();
List<Element> propElements = DomUtils.getChildElementsByTagName(propsElement, "prop");
for (Element propElement : propElements) {
String key = propElement.getAttribute("key");
String val = DomUtils.getTextValue(propElement);
props.put(key, new TypedStringValue(val).getValue());
}
attribute.setProperties(props);
}
if (log.isDebugEnabled()) {
for (Map.Entry<String, String> e : attribute.getProperties().entrySet()) {
log.debug("{} prop : {} : {}", cbName, e.getKey(), e.getValue());
}
}
circuitBreakerAttributeMap.put(nameHolder, attribute);