class ConsulRegistryFactory extends AbstractRegistryFactory {

    @Override
    protected Registry createRegistry(URL url) {<FILL_FUNCTION_BODY>}

}

        String host = ConsulConstants.DEFAULT_HOST;
        int port = ConsulConstants.DEFAULT_PORT;
        if (StringUtils.isNotBlank(url.getHost())) {
            host = url.getHost();
        }
        if (url.getPort() > 0) {
            port = url.getPort();
        }
        //可以使用不同的client实现
        MotanConsulClient client = new ConsulEcwidClient(host, port);
        return new ConsulRegistry(url, client);
    
<methods>public non-sealed void <init>() ,public com.weibo.api.motan.registry.Registry getRegistry(com.weibo.api.motan.rpc.URL) <variables>private static final java.util.concurrent.locks.ReentrantLock lock,private static final ConcurrentHashMap<java.lang.String,com.weibo.api.motan.registry.Registry> registries