HouZhiHouJue commented on issue #1508: feature required: set registrydirectory 
to AP when implementation is CP
URL: 
https://github.com/apache/incubator-dubbo/issues/1508#issuecomment-379517607
 
 
   ` ChildListener zkListener = listeners.get(listener);
   
                       if (zkListener == null) {
   
                           listeners.putIfAbsent(listener, new ChildListener() {
   
                               public void childChanged(String parentPath, 
List<String> currentChilds) {
   
                                   ZookeeperRegistry.this.notify(url, listener, 
toUrlsWithEmpty(url, parentPath, currentChilds));
   
                               }
   
                           });
   
                           zkListener = listeners.get(listener);
   
                       }
   
                       zkClient.create(path, false);
   
                       List<String> children = zkClient.addChildListener(path, 
zkListener);
   
                       if (children != null) {
   
                           urls.addAll(toUrlsWithEmpty(url, path, children));
   
                       }`
   
   
   `  
   private List<URL> toUrlsWithEmpty(URL consumer, String path, List<String> 
providers) {
   
           List<URL> urls = toUrlsWithoutEmpty(consumer, providers);
   
           if (urls == null || urls.isEmpty()) {
   
               int i = path.lastIndexOf('/');
   
               String category = i < 0 ? path : path.substring(i + 1);
   
               URL empty = 
consumer.setProtocol(Constants.EMPTY_PROTOCOL).addParameter(Constants.CATEGORY_KEY,
 category);
   
               urls.add(empty);
   
           }
   
           return urls;
       }`
   
   zookeeper ,sorry to did not say clearly at the beginning

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to