Examples of CircuitBreakerAttribute


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

    }

    @Override
    public Object execute(final Invoker invoker) {

        CircuitBreakerAttribute attr = invoker.getCircuitBreakerAttribute();

        String circuitBreakerName = determineCommandName(attr);
        String circuitBreakerGroup = determineGroupName(attr);
        String threadPoolName = determineThreadPoolName(attr);

        if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
            synchronized (circuitBreakerName) {
                if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
                    for (Map.Entry<String, String> entry : attr.getProperties().entrySet()) {
                        String commandKey = String.format(INSTANCE_COMMAND_PROP_KEY_FORMAT, circuitBreakerName, entry.getKey());
                        configuration.setProperty(commandKey, entry.getValue());
                        String threadPoolKey = String.format(INSTANCE_THREADPOOL_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
                        configuration.setProperty(threadPoolKey, entry.getValue());
                        String collapserKey = String.format(INSTANCE_COLLAPSER_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
View Full Code Here

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

    private static final Map<String, Boolean> CONFIGURED_BREAKERS = new ConcurrentHashMap<String, Boolean>();

    @Override
    public Object execute(final Invoker invoker) {

        CircuitBreakerAttribute attr = invoker.getCircuitBreakerAttribute();

        String circuitBreakerName = determineCommandName(attr);
        String circuitBreakerGroup = determineGroupName(attr);
        String threadPoolName = determineThreadPoolName(attr);

        if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
            synchronized (circuitBreakerName) {
                if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
                    for (Map.Entry<String, String> entry : attr.getProperties().entrySet()) {
                        String commandKey = String.format(INSTANCE_COMMAND_PROP_KEY_FORMAT, circuitBreakerName, entry.getKey());
                        ConfigurationManager.getConfigInstance().setProperty(commandKey, entry.getValue());
                        String threadPoolKey = String.format(INSTANCE_THREADPOOL_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
                        ConfigurationManager.getConfigInstance().setProperty(threadPoolKey, entry.getValue());
                        String collapserKey = String.format(INSTANCE_COLLAPSER_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
View Full Code Here

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

    private static final Map<String, Boolean> CONFIGURED_BREAKERS = new ConcurrentHashMap<String, Boolean>();

    @Override
    public Object execute(final Invoker invoker) {

        CircuitBreakerAttribute attr = invoker.getCircuitBreakerAttribute();

        String circuitBreakerName = determineCommandName(attr);
        String circuitBreakerGroup = determineGroupName(attr);
        String threadPoolName = determineThreadPoolName(attr);

        if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
            synchronized (circuitBreakerName) {
                if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
                    for (Map.Entry<String, String> entry : attr.getProperties().entrySet()) {
                        String commandKey = String.format(INSTANCE_COMMAND_PROP_KEY_FORMAT, circuitBreakerName, entry.getKey());
                        ConfigurationManager.getConfigInstance().setProperty(commandKey, entry.getValue());
                        String threadPoolKey = String.format(INSTANCE_THREADPOOL_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
                        ConfigurationManager.getConfigInstance().setProperty(threadPoolKey, entry.getValue());
                        String collapserKey = String.format(INSTANCE_COLLAPSER_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
View Full Code Here

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

    }

    @Override
    public Object execute(final Invoker invoker) {

        CircuitBreakerAttribute attr = invoker.getCircuitBreakerAttribute();

        String circuitBreakerName = determineCommandName(attr);
        String circuitBreakerGroup = determineGroupName(attr);
        String threadPoolName = determineThreadPoolName(attr);

        if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
            synchronized (circuitBreakerName) {
                if (!CONFIGURED_BREAKERS.containsKey(circuitBreakerName)) {
                    for (Map.Entry<String, String> entry : attr.getProperties().entrySet()) {
                        String commandKey = String.format(INSTANCE_COMMAND_PROP_KEY_FORMAT, circuitBreakerName, entry.getKey());
                        configuration.setProperty(commandKey, entry.getValue());
                        String threadPoolKey = String.format(INSTANCE_THREADPOOL_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
                        configuration.setProperty(threadPoolKey, entry.getValue());
                        String collapserKey = String.format(INSTANCE_COLLAPSER_PROP_KEY_FORMAT, threadPoolName, entry.getKey());
View Full Code Here

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

                return (CircuitBreakerAttribute) cached;
            }
        }
        else {
            // We need to work it out.
            CircuitBreakerAttribute cbAttribute = computeCircuitBreakerAttribute(method, targetClass);
            // Put it in the cache.
            if (cbAttribute == null) {
                this.attributeCache.put(cacheKey, NULL_CIRCUIT_BREAKER_ATTRIBUTE);
            }
            else {
View Full Code Here

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

        // If we are dealing with method with generic parameters, find the original method.
        specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);

        // First try is the method in the target class.
        CircuitBreakerAttribute cbAttribute = findCircuitBreakerAttribute(specificMethod);
        if (cbAttribute != null) {
            return cbAttribute;
        }

        // Second try is the circuit breaker attribute on the target class.
View Full Code Here

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

     *            the annotated method or class
     * @return CircuitBreakerAttribute the configured circuit breaker attribute, or {@code null} if none was found
     */
    protected CircuitBreakerAttribute determineCircuitBreakerAttribute(AnnotatedElement ae) {
        for (CircuitBreakerAnnotationParser annotationParser : this.annotationParsers) {
            CircuitBreakerAttribute attr = annotationParser.parseCircuitBreakerAnnotation(ae);
            if (attr != null) {
                return attr;
            }
        }
        return null;
View Full Code Here

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

    private static final long serialVersionUID = 1L;

    public CircuitBreakerAttribute parseCircuitBreakerAnnotation(AnnotatedElement ae) {
        CircuitBreaker ann = AnnotationUtils.getAnnotation(ae, CircuitBreaker.class);
        if (ann != null) {
            CircuitBreakerAttribute cbAttribute = parseCircuitBreakerAnnotation(ann, ae);
            return cbAttribute;
        }
        else {
            return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.