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

xin.bluesky.leiothrix.server.storage.zk.ZookeeperClientFactory Maven / Gradle / Ivy

The newest version!
package xin.bluesky.leiothrix.server.storage.zk;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;
import xin.bluesky.leiothrix.server.conf.ServerConfigure;

/**
 * @author 张轲
 */
public class ZookeeperClientFactory {

    public static final String ROOT_PATH = "/leiothrix";

    private static CuratorFramework client;

    static {
        client = CuratorFrameworkFactory.newClient(ServerConfigure.get("zookeeper.address"), new ExponentialBackoffRetry(1000, 3));
        client.start();
    }

    public static CuratorFramework get() {
        return client;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy