test_class.declarator: testUrl
test_class.modifier: private
test_class.original_string: private URL testUrl;
test_class.type: URL
test_class.var_name: testUrl
test_class.declarator: mockUrl
test_class.modifier: private
test_class.original_string: private URL mockUrl;
test_class.type: URL
test_class.var_name: mockUrl
test_class.declarator: listener
test_class.modifier: private
test_class.original_string: private NotifyListener listener;
test_class.type: NotifyListener
test_class.var_name: listener
test_class.declarator: abstractRegistry
test_class.modifier: private
test_class.original_string: private AbstractRegistry abstractRegistry;
test_class.type: AbstractRegistry
test_class.var_name: abstractRegistry
test_class.declarator: notifySuccess
test_class.modifier: private
test_class.original_string: private boolean notifySuccess;
test_class.type: boolean
test_class.var_name: notifySuccess
test_class.declarator: parametersConsumer = new LinkedHashMap<>()
test_class.modifier: private
test_class.original_string: private Map<String, String> parametersConsumer = new LinkedHashMap<>();
test_class.type: Map<String, String>
test_class.var_name: parametersConsumer
test_class.file: dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java
test_class.identifier: AbstractRegistryTest
test_case.body: @Test
      public void destroyTest() throws Exception {
          abstractRegistry.register(testUrl);
          abstractRegistry.subscribe(testUrl, listener);
          Assertions.assertEquals(1, abstractRegistry.getRegistered().size());
          Assertions.assertEquals(1, abstractRegistry.getSubscribed().get(testUrl).size());
          // delete listener and register
          abstractRegistry.destroy();
          Assertions.assertEquals(0, abstractRegistry.getRegistered().size());
          Assertions.assertEquals(0, abstractRegistry.getSubscribed().get(testUrl).size());
      }
test_case.class_method_signature: AbstractRegistryTest.destroyTest()
test_case.full_signature: @Test public void destroyTest()
test_case.identifier: destroyTest
test_case.invocations: register subscribe assertEquals size getRegistered assertEquals size get getSubscribed destroy assertEquals size getRegistered assertEquals size get getSubscribed
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void destroyTest()
focal_class.declarator: URL_SEPARATOR = ' '
focal_class.modifier: private static final
focal_class.original_string: private static final char URL_SEPARATOR = ' ';
focal_class.type: char
focal_class.var_name: URL_SEPARATOR
focal_class.declarator: URL_SPLIT = "\\s+"
focal_class.modifier: private static final
focal_class.original_string: private static final String URL_SPLIT = "\\s+";
focal_class.type: String
focal_class.var_name: URL_SPLIT
focal_class.declarator: MAX_RETRY_TIMES_SAVE_PROPERTIES = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_RETRY_TIMES_SAVE_PROPERTIES = 3;
focal_class.type: int
focal_class.var_name: MAX_RETRY_TIMES_SAVE_PROPERTIES
focal_class.declarator: logger = LoggerFactory.getLogger(getClass())
focal_class.modifier: protected final
focal_class.original_string: protected final Logger logger = LoggerFactory.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: properties = new Properties()
focal_class.modifier: private final
focal_class.original_string: private final Properties properties = new Properties();
focal_class.type: Properties
focal_class.var_name: properties
focal_class.declarator: registryCacheExecutor = Executors.newFixedThreadPool(1, new NamedThreadFactory("DubboSaveRegistryCache", true))
focal_class.modifier: private final
focal_class.original_string: private final ExecutorService registryCacheExecutor = Executors.newFixedThreadPool(1, new NamedThreadFactory("DubboSaveRegistryCache", true));
focal_class.type: ExecutorService
focal_class.var_name: registryCacheExecutor
focal_class.declarator: syncSaveFile
focal_class.modifier: private
focal_class.original_string: private boolean syncSaveFile;
focal_class.type: boolean
focal_class.var_name: syncSaveFile
focal_class.declarator: lastCacheChanged = new AtomicLong()
focal_class.modifier: private final
focal_class.original_string: private final AtomicLong lastCacheChanged = new AtomicLong();
focal_class.type: AtomicLong
focal_class.var_name: lastCacheChanged
focal_class.declarator: savePropertiesRetryTimes = new AtomicInteger()
focal_class.modifier: private final
focal_class.original_string: private final AtomicInteger savePropertiesRetryTimes = new AtomicInteger();
focal_class.type: AtomicInteger
focal_class.var_name: savePropertiesRetryTimes
focal_class.declarator: registered = new ConcurrentHashSet<>()
focal_class.modifier: private final
focal_class.original_string: private final Set<URL> registered = new ConcurrentHashSet<>();
focal_class.type: Set<URL>
focal_class.var_name: registered
focal_class.declarator: subscribed = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<URL, Set<NotifyListener>> subscribed = new ConcurrentHashMap<>();
focal_class.type: ConcurrentMap<URL, Set<NotifyListener>>
focal_class.var_name: subscribed
focal_class.declarator: notified = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<URL, Map<String, List<URL>>> notified = new ConcurrentHashMap<>();
focal_class.type: ConcurrentMap<URL, Map<String, List<URL>>>
focal_class.var_name: notified
focal_class.declarator: registryUrl
focal_class.modifier: private
focal_class.original_string: private URL registryUrl;
focal_class.type: URL
focal_class.var_name: registryUrl
focal_class.declarator: file
focal_class.modifier: private
focal_class.original_string: private File file;
focal_class.type: File
focal_class.var_name: file
focal_class.file: dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/AbstractRegistry.java
focal_class.identifier: AbstractRegistry
focal_class.interfaces: implements Registry
focal_class.class_method_signature: AbstractRegistry.AbstractRegistry(URL url)
focal_class.full_signature: public  AbstractRegistry(URL url)
focal_class.identifier: AbstractRegistry
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.signature:  AbstractRegistry(URL url)
focal_class.class_method_signature: AbstractRegistry.filterEmpty(URL url, List<URL> urls)
focal_class.full_signature: protected static List<URL> filterEmpty(URL url, List<URL> urls)
focal_class.identifier: filterEmpty
focal_class.modifiers: protected static
focal_class.parameters: (URL url, List<URL> urls)
focal_class.return: List<URL>
focal_class.signature: List<URL> filterEmpty(URL url, List<URL> urls)
focal_class.class_method_signature: AbstractRegistry.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: AbstractRegistry.setUrl(URL url)
focal_class.full_signature: protected void setUrl(URL url)
focal_class.identifier: setUrl
focal_class.modifiers: protected
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void setUrl(URL url)
focal_class.class_method_signature: AbstractRegistry.getRegistered()
focal_class.full_signature: public Set<URL> getRegistered()
focal_class.identifier: getRegistered
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<URL>
focal_class.signature: Set<URL> getRegistered()
focal_class.class_method_signature: AbstractRegistry.getSubscribed()
focal_class.full_signature: public Map<URL, Set<NotifyListener>> getSubscribed()
focal_class.identifier: getSubscribed
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<URL, Set<NotifyListener>>
focal_class.signature: Map<URL, Set<NotifyListener>> getSubscribed()
focal_class.class_method_signature: AbstractRegistry.getNotified()
focal_class.full_signature: public Map<URL, Map<String, List<URL>>> getNotified()
focal_class.identifier: getNotified
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<URL, Map<String, List<URL>>>
focal_class.signature: Map<URL, Map<String, List<URL>>> getNotified()
focal_class.class_method_signature: AbstractRegistry.getCacheFile()
focal_class.full_signature: public File getCacheFile()
focal_class.identifier: getCacheFile
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: File
focal_class.signature: File getCacheFile()
focal_class.class_method_signature: AbstractRegistry.getCacheProperties()
focal_class.full_signature: public Properties getCacheProperties()
focal_class.identifier: getCacheProperties
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Properties
focal_class.signature: Properties getCacheProperties()
focal_class.class_method_signature: AbstractRegistry.getLastCacheChanged()
focal_class.full_signature: public AtomicLong getLastCacheChanged()
focal_class.identifier: getLastCacheChanged
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: AtomicLong
focal_class.signature: AtomicLong getLastCacheChanged()
focal_class.class_method_signature: AbstractRegistry.doSaveProperties(long version)
focal_class.full_signature: public void doSaveProperties(long version)
focal_class.identifier: doSaveProperties
focal_class.modifiers: public
focal_class.parameters: (long version)
focal_class.return: void
focal_class.signature: void doSaveProperties(long version)
focal_class.class_method_signature: AbstractRegistry.loadProperties()
focal_class.full_signature: private void loadProperties()
focal_class.identifier: loadProperties
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadProperties()
focal_class.class_method_signature: AbstractRegistry.getCacheUrls(URL url)
focal_class.full_signature: public List<URL> getCacheUrls(URL url)
focal_class.identifier: getCacheUrls
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.return: List<URL>
focal_class.signature: List<URL> getCacheUrls(URL url)
focal_class.class_method_signature: AbstractRegistry.lookup(URL url)
focal_class.full_signature: @Override public List<URL> lookup(URL url)
focal_class.identifier: lookup
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: List<URL>
focal_class.signature: List<URL> lookup(URL url)
focal_class.class_method_signature: AbstractRegistry.register(URL url)
focal_class.full_signature: @Override public void register(URL url)
focal_class.identifier: register
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void register(URL url)
focal_class.class_method_signature: AbstractRegistry.unregister(URL url)
focal_class.full_signature: @Override public void unregister(URL url)
focal_class.identifier: unregister
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void unregister(URL url)
focal_class.class_method_signature: AbstractRegistry.subscribe(URL url, NotifyListener listener)
focal_class.full_signature: @Override public void subscribe(URL url, NotifyListener listener)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void subscribe(URL url, NotifyListener listener)
focal_class.class_method_signature: AbstractRegistry.unsubscribe(URL url, NotifyListener listener)
focal_class.full_signature: @Override public void unsubscribe(URL url, NotifyListener listener)
focal_class.identifier: unsubscribe
focal_class.modifiers: @Override public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void unsubscribe(URL url, NotifyListener listener)
focal_class.class_method_signature: AbstractRegistry.recover()
focal_class.full_signature: protected void recover()
focal_class.identifier: recover
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void recover()
focal_class.class_method_signature: AbstractRegistry.notify(List<URL> urls)
focal_class.full_signature: protected void notify(List<URL> urls)
focal_class.identifier: notify
focal_class.modifiers: protected
focal_class.parameters: (List<URL> urls)
focal_class.return: void
focal_class.signature: void notify(List<URL> urls)
focal_class.class_method_signature: AbstractRegistry.notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.full_signature: protected void notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.identifier: notify
focal_class.modifiers: protected
focal_class.parameters: (URL url, NotifyListener listener, List<URL> urls)
focal_class.return: void
focal_class.signature: void notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.class_method_signature: AbstractRegistry.saveProperties(URL url)
focal_class.full_signature: private void saveProperties(URL url)
focal_class.identifier: saveProperties
focal_class.modifiers: private
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void saveProperties(URL url)
focal_class.class_method_signature: AbstractRegistry.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: AbstractRegistry.acceptable(URL urlToRegistry)
focal_class.full_signature: protected boolean acceptable(URL urlToRegistry)
focal_class.identifier: acceptable
focal_class.modifiers: protected
focal_class.parameters: (URL urlToRegistry)
focal_class.return: boolean
focal_class.signature: boolean acceptable(URL urlToRegistry)
focal_class.class_method_signature: AbstractRegistry.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: @Override
      public void destroy() {
          if (logger.isInfoEnabled()) {
              logger.info("Destroy registry:" + getUrl());
          }
          Set<URL> destroyRegistered = new HashSet<>(getRegistered());
          if (!destroyRegistered.isEmpty()) {
              for (URL url : new HashSet<>(getRegistered())) {
                  if (url.getParameter(DYNAMIC_KEY, true)) {
                      try {
                          unregister(url);
                          if (logger.isInfoEnabled()) {
                              logger.info("Destroy unregister url " + url);
                          }
                      } catch (Throwable t) {
                          logger.warn("Failed to unregister url " + url + " to registry " + getUrl() + " on destroy, cause: " + t.getMessage(), t);
                      }
                  }
              }
          }
          Map<URL, Set<NotifyListener>> destroySubscribed = new HashMap<>(getSubscribed());
          if (!destroySubscribed.isEmpty()) {
              for (Map.Entry<URL, Set<NotifyListener>> entry : destroySubscribed.entrySet()) {
                  URL url = entry.getKey();
                  for (NotifyListener listener : entry.getValue()) {
                      try {
                          unsubscribe(url, listener);
                          if (logger.isInfoEnabled()) {
                              logger.info("Destroy unsubscribe url " + url);
                          }
                      } catch (Throwable t) {
                          logger.warn("Failed to unsubscribe url " + url + " to registry " + getUrl() + " on destroy, cause: " + t.getMessage(), t);
                      }
                  }
              }
          }
          AbstractRegistryFactory.removeDestroyedRegistry(this);
      }
focal_method.class_method_signature: AbstractRegistry.destroy()
focal_method.full_signature: @Override public void destroy()
focal_method.identifier: destroy
focal_method.invocations: isInfoEnabled info getUrl getRegistered isEmpty getRegistered getParameter unregister isInfoEnabled info warn getUrl getMessage getSubscribed isEmpty entrySet getKey getValue unsubscribe isInfoEnabled info warn getUrl getMessage removeDestroyedRegistry
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroy()