Package com.developmentsprint.spring.breaker.interceptor

Examples of com.developmentsprint.spring.breaker.interceptor.RuleBasedCircuitBreakerAttribute


        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);
            }

            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, val);
                }
                attribute.setProperties(props);
            }

            circuitBreakerAttributeMap.put(nameHolder, attribute);
        }
View Full Code Here


        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);
View Full Code Here

TOP

Related Classes of com.developmentsprint.spring.breaker.interceptor.RuleBasedCircuitBreakerAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.