com.alipay.sofa.rpc.registry.zk.ZookeeperRegistryHelper.convertUrlsToProviders()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中com.alipay.sofa.rpc.registry.zk.ZookeeperRegistryHelper.convertUrlsToProviders()方法的一些代码示例,展示了ZookeeperRegistryHelper.convertUrlsToProviders()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperRegistryHelper.convertUrlsToProviders()方法的具体详情如下:
包路径:com.alipay.sofa.rpc.registry.zk.ZookeeperRegistryHelper
类名称:ZookeeperRegistryHelper
方法名:convertUrlsToProviders

ZookeeperRegistryHelper.convertUrlsToProviders介绍

[英]Convert url to provider list.
[中]将url转换为提供者列表。

代码示例

代码示例来源:origin: alipay/sofa-rpc

private void notifyListeners(ConsumerConfig config, String providerPath, List<ChildData> currentData, boolean add)
    throws UnsupportedEncodingException {
    List<ProviderInfoListener> providerInfoListeners = providerListenerMap.get(config);
    if (CommonUtils.isNotEmpty(providerInfoListeners)) {
      List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(providerPath,
        currentData);
      List<ProviderInfo> providerInfosForProtocol = RegistryUtils.matchProviderInfos(config, providerInfos);
      for (ProviderInfoListener listener : providerInfoListeners) {
        if (add) {
          listener.addProvider(new ProviderGroup(providerInfosForProtocol));
        } else {
          listener.updateProviders(new ProviderGroup(providerInfosForProtocol));
        }
      }
    }
  }
}

代码示例来源:origin: alipay/sofa-rpc

private void notifyListeners(ConsumerConfig config, String providerPath, List<ChildData> currentData, boolean add)
    throws UnsupportedEncodingException {
    List<ProviderInfoListener> providerInfoListeners = providerListenerMap.get(config);
    if (CommonUtils.isNotEmpty(providerInfoListeners)) {
      List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(providerPath,
        currentData);
      List<ProviderInfo> providerInfosForProtocol = RegistryUtils.matchProviderInfos(config, providerInfos);
      for (ProviderInfoListener listener : providerInfoListeners) {
        if (add) {
          listener.addProvider(new ProviderGroup(providerInfosForProtocol));
        } else {
          listener.updateProviders(new ProviderGroup(providerInfosForProtocol));
        }
      }
    }
  }
}

代码示例来源:origin: alipay/sofa-rpc

INTERFACE_PROVIDER_CACHE.put(config, pathChildrenCache);
List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(
  providerPath, pathChildrenCache.getCurrentData());
matchProviders = ZookeeperRegistryHelper.matchProviderInfos(config, providerInfos);

代码示例来源:origin: alipay/sofa-rpc

INTERFACE_PROVIDER_CACHE.put(config, pathChildrenCache);
List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(
  providerPath, pathChildrenCache.getCurrentData());
matchProviders = ZookeeperRegistryHelper.matchProviderInfos(config, providerInfos);

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

private void notifyListeners(ConsumerConfig config, String providerPath, List<ChildData> currentData, boolean add)
    throws UnsupportedEncodingException {
    List<ProviderInfoListener> providerInfoListeners = providerListenerMap.get(config);
    if (CommonUtils.isNotEmpty(providerInfoListeners)) {
      List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(providerPath,
        currentData);
      List<ProviderInfo> providerInfosForProtocol = RegistryUtils.matchProviderInfos(config, providerInfos);
      for (ProviderInfoListener listener : providerInfoListeners) {
        if (add) {
          listener.addProvider(new ProviderGroup(providerInfosForProtocol));
        } else {
          listener.updateProviders(new ProviderGroup(providerInfosForProtocol));
        }
      }
    }
  }
}

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

INTERFACE_PROVIDER_CACHE.put(config, pathChildrenCache);
List<ProviderInfo> providerInfos = ZookeeperRegistryHelper.convertUrlsToProviders(
  providerPath, pathChildrenCache.getCurrentData());
matchProviders = ZookeeperRegistryHelper.matchProviderInfos(config, providerInfos);

相关文章