All Downloads are FREE. Search and download functionalities are using the official Maven repository.

group.flyfish.rest.registry.proxy.RestInvokers Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
package group.flyfish.rest.registry.proxy;

import group.flyfish.rest.configuration.RestClientProperties;

import java.util.ArrayList;
import java.util.List;

/**
 * rest执行器实例集合
 *
 * @author wangyu
 */
public class RestInvokers {

    private static RestClientProperties properties;

    private static List invokers = new ArrayList<>();

    public static void add(RestProxyInvoker invoker) {
        if (null != properties) {
            invoker.configure(properties);
        } else {
            invokers.add(invoker);
        }
    }

    public static synchronized void configure(RestClientProperties properties) {
        invokers.forEach(invoker -> invoker.configure(properties));
        invokers.clear();
        invokers = null;
        RestInvokers.properties = properties;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy