eagle-ui/src/main/java/eagle/jfaster/org/factory/RegistryCenterFactory.java
public static CoordinatorRegistryCenter createCoordinatorRegistryCenter(final String connectString, final String namespace, final Optional<String> digest) {
        Hasher hasher = Hashing.md5().newHasher().putString(connectString, Charsets.UTF_8).putString(namespace, Charsets.UTF_8);
        if (digest.isPresent()) {
            hasher.putString(digest.get(), Charsets.UTF_8);
        }
        HashCode hashCode = hasher.hash();
        CoordinatorRegistryCenter result = REG_CENTER_REGISTRY.get(hashCode);
        if (null != result) {
            return result;
        }
        MergeConfig zkConfig = new MergeConfig();
        zkConfig.addExt(ConfigEnum.address.getName(), connectString);
        zkConfig.addExt(ConfigEnum.namespace.getName(), namespace);
        if (digest.isPresent()) {
            zkConfig.addExt(ConfigEnum.digest.getName(), digest.get());
        }
        result = new ZookeeperRegistryCenter(zkConfig);
        result.init();
        REG_CENTER_REGISTRY.put(hashCode, result);
        return result;
    }
public static CoordinatorRegistryCenter createCoordinatorRegistryCenter(final String connectString, final String namespace, final Optional<String> digest) {
        Hasher hasher = Hashing.md5().newHasher().putString(connectString, Charsets.UTF_8).putString(namespace, Charsets.UTF_8);
        if (digest.isPresent()) {
            hasher.putString(digest.get(), Charsets.UTF_8);
        }
        HashCode hashCode = hasher.hash();
        CoordinatorRegistryCenter result = REG_CENTER_REGISTRY.get(hashCode);
        if (null != result) {
            return result;
        }
        MergeConfig zkConfig = new MergeConfig();
        zkConfig.addExt(ConfigEnum.address.getName(), connectString);
        zkConfig.addExt(ConfigEnum.namespace.getName(), namespace);
        if (digest.isPresent()) {
            zkConfig.addExt(ConfigEnum.digest.getName(), digest.get());
        }
        result = new ZookeeperRegistryCenter(zkConfig);
        result.init();
        REG_CENTER_REGISTRY.put(hashCode, result);
        return result;
    }
public static CoordinatorRegistryCenter createCoordinatorRegistryCenter ( final String connectString , final String namespace , final Optional < String > digest ) { Hasher hasher = Hashing . md5 ( ) . newHasher ( ) . putString ( connectString , Charsets . UTF_8 ) . putString ( namespace , Charsets . UTF_8 ) ; if ( digest . isPresent ( ) ) { hasher . putString ( digest . get ( ) , Charsets . UTF_8 ) ; } HashCode hashCode = hasher . hash ( ) ; CoordinatorRegistryCenter result = REG_CENTER_REGISTRY . get ( hashCode ) ; if ( null != result ) { return result ; } MergeConfig zkConfig = new MergeConfig ( ) ; zkConfig . addExt ( ConfigEnum . address . getName ( ) , connectString ) ; zkConfig . addExt ( ConfigEnum . namespace . getName ( ) , namespace ) ; if ( digest . isPresent ( ) ) { zkConfig . addExt ( ConfigEnum . digest . getName ( ) , digest . get ( ) ) ; } result = new ZookeeperRegistryCenter ( zkConfig ) ; result . init ( ) ; REG_CENTER_REGISTRY . put ( hashCode , result ) ; return result ; }
创建注册中心.

@param connectString 注册中心连接字符串
@param namespace 注册中心命名空间
@param digest 注册中心凭证
@return 注册中心对象
创建注册中心 .