test_class.file: dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/utils/ReferenceConfigCacheTest.java
test_class.identifier: ReferenceConfigCacheTest
test_case.body: @Test
      public void testDestroyAll() throws Exception {
          ReferenceConfigCache cache = ReferenceConfigCache.getCache();
          MockReferenceConfig config = buildMockReferenceConfig("org.apache.dubbo.config.utils.service.FooService", "group1", "1.0.0");
          cache.get(config);
          XxxMockReferenceConfig configCopy = buildXxxMockReferenceConfig("org.apache.dubbo.config.utils.service.XxxService", "group1", "1.0.0");
          cache.get(configCopy);
          assertEquals(2, cache.getReferredReferences().size());
          cache.destroyAll();
          assertTrue(config.isDestroyMethodRun());
          assertTrue(configCopy.isDestroyMethodRun());
          assertEquals(0, cache.getReferredReferences().size());
      }
test_case.class_method_signature: ReferenceConfigCacheTest.testDestroyAll()
test_case.full_signature: @Test public void testDestroyAll()
test_case.identifier: testDestroyAll
test_case.invocations: getCache buildMockReferenceConfig get buildXxxMockReferenceConfig get assertEquals size getReferredReferences destroyAll assertTrue isDestroyMethodRun assertTrue isDestroyMethodRun assertEquals size getReferredReferences
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDestroyAll()
focal_class.declarator: DEFAULT_NAME = "_DEFAULT_"
focal_class.modifier: public static final
focal_class.original_string: public static final String DEFAULT_NAME = "_DEFAULT_";
focal_class.type: String
focal_class.var_name: DEFAULT_NAME
focal_class.declarator: DEFAULT_KEY_GENERATOR = referenceConfig -> {
          String iName = referenceConfig.getInterface();
          if (StringUtils.isBlank(iName)) {
              Class<?> clazz = referenceConfig.getInterfaceClass();
              iName = clazz.getName();
          }
          if (StringUtils.isBlank(iName)) {
              throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
          }
  
          StringBuilder ret = new StringBuilder();
          if (!StringUtils.isBlank(referenceConfig.getGroup())) {
              ret.append(referenceConfig.getGroup()).append("/");
          }
          ret.append(iName);
          if (!StringUtils.isBlank(referenceConfig.getVersion())) {
              ret.append(":").append(referenceConfig.getVersion());
          }
          return ret.toString();
      }
focal_class.modifier: public static final
focal_class.original_string: public static final KeyGenerator DEFAULT_KEY_GENERATOR = referenceConfig -> {
          String iName = referenceConfig.getInterface();
          if (StringUtils.isBlank(iName)) {
              Class<?> clazz = referenceConfig.getInterfaceClass();
              iName = clazz.getName();
          }
          if (StringUtils.isBlank(iName)) {
              throw new IllegalArgumentException("No interface info in ReferenceConfig" + referenceConfig);
          }
  
          StringBuilder ret = new StringBuilder();
          if (!StringUtils.isBlank(referenceConfig.getGroup())) {
              ret.append(referenceConfig.getGroup()).append("/");
          }
          ret.append(iName);
          if (!StringUtils.isBlank(referenceConfig.getVersion())) {
              ret.append(":").append(referenceConfig.getVersion());
          }
          return ret.toString();
      };
focal_class.type: KeyGenerator
focal_class.var_name: DEFAULT_KEY_GENERATOR
focal_class.declarator: CACHE_HOLDER = new ConcurrentHashMap<String, ReferenceConfigCache>()
focal_class.modifier: static final
focal_class.original_string: static final ConcurrentMap<String, ReferenceConfigCache> CACHE_HOLDER = new ConcurrentHashMap<String, ReferenceConfigCache>();
focal_class.type: ConcurrentMap<String, ReferenceConfigCache>
focal_class.var_name: CACHE_HOLDER
focal_class.declarator: name
focal_class.modifier: private final
focal_class.original_string: private final String name;
focal_class.type: String
focal_class.var_name: name
focal_class.declarator: generator
focal_class.modifier: private final
focal_class.original_string: private final KeyGenerator generator;
focal_class.type: KeyGenerator
focal_class.var_name: generator
focal_class.declarator: referredReferences = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<String, ReferenceConfigBase<?>> referredReferences = new ConcurrentHashMap<>();
focal_class.type: ConcurrentMap<String, ReferenceConfigBase<?>>
focal_class.var_name: referredReferences
focal_class.declarator: proxies = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<Class<?>, ConcurrentMap<String, Object>> proxies = new ConcurrentHashMap<>();
focal_class.type: ConcurrentMap<Class<?>, ConcurrentMap<String, Object>>
focal_class.var_name: proxies
focal_class.file: dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/utils/ReferenceConfigCache.java
focal_class.identifier: ReferenceConfigCache
focal_class.class_method_signature: ReferenceConfigCache.ReferenceConfigCache(String name, KeyGenerator generator)
focal_class.full_signature: private  ReferenceConfigCache(String name, KeyGenerator generator)
focal_class.identifier: ReferenceConfigCache
focal_class.modifiers: private
focal_class.parameters: (String name, KeyGenerator generator)
focal_class.signature:  ReferenceConfigCache(String name, KeyGenerator generator)
focal_class.class_method_signature: ReferenceConfigCache.getCache()
focal_class.full_signature: public static ReferenceConfigCache getCache()
focal_class.identifier: getCache
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: ReferenceConfigCache
focal_class.signature: ReferenceConfigCache getCache()
focal_class.class_method_signature: ReferenceConfigCache.getCache(String name)
focal_class.full_signature: public static ReferenceConfigCache getCache(String name)
focal_class.identifier: getCache
focal_class.modifiers: public static
focal_class.parameters: (String name)
focal_class.return: ReferenceConfigCache
focal_class.signature: ReferenceConfigCache getCache(String name)
focal_class.class_method_signature: ReferenceConfigCache.getCache(String name, KeyGenerator keyGenerator)
focal_class.full_signature: public static ReferenceConfigCache getCache(String name, KeyGenerator keyGenerator)
focal_class.identifier: getCache
focal_class.modifiers: public static
focal_class.parameters: (String name, KeyGenerator keyGenerator)
focal_class.return: ReferenceConfigCache
focal_class.signature: ReferenceConfigCache getCache(String name, KeyGenerator keyGenerator)
focal_class.class_method_signature: ReferenceConfigCache.get(ReferenceConfigBase<T> referenceConfig)
focal_class.full_signature: @SuppressWarnings("unchecked") public T get(ReferenceConfigBase<T> referenceConfig)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (ReferenceConfigBase<T> referenceConfig)
focal_class.return: T
focal_class.signature: T get(ReferenceConfigBase<T> referenceConfig)
focal_class.class_method_signature: ReferenceConfigCache.get(String key, Class<T> type)
focal_class.full_signature: @SuppressWarnings("unchecked") public T get(String key, Class<T> type)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (String key, Class<T> type)
focal_class.return: T
focal_class.signature: T get(String key, Class<T> type)
focal_class.class_method_signature: ReferenceConfigCache.get(String key)
focal_class.full_signature: @SuppressWarnings("unchecked") public T get(String key)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (String key)
focal_class.return: T
focal_class.signature: T get(String key)
focal_class.class_method_signature: ReferenceConfigCache.getAll(Class<T> type)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<T> getAll(Class<T> type)
focal_class.identifier: getAll
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Class<T> type)
focal_class.return: List<T>
focal_class.signature: List<T> getAll(Class<T> type)
focal_class.class_method_signature: ReferenceConfigCache.get(Class<T> type)
focal_class.full_signature: @SuppressWarnings("unchecked") public T get(Class<T> type)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (Class<T> type)
focal_class.return: T
focal_class.signature: T get(Class<T> type)
focal_class.class_method_signature: ReferenceConfigCache.destroy(String key, Class<?> type)
focal_class.full_signature: public void destroy(String key, Class<?> type)
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: (String key, Class<?> type)
focal_class.return: void
focal_class.signature: void destroy(String key, Class<?> type)
focal_class.class_method_signature: ReferenceConfigCache.destroy(Class<?> type)
focal_class.full_signature: public void destroy(Class<?> type)
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: (Class<?> type)
focal_class.return: void
focal_class.signature: void destroy(Class<?> type)
focal_class.class_method_signature: ReferenceConfigCache.destroy(ReferenceConfigBase<T> referenceConfig)
focal_class.full_signature: public void destroy(ReferenceConfigBase<T> referenceConfig)
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: (ReferenceConfigBase<T> referenceConfig)
focal_class.return: void
focal_class.signature: void destroy(ReferenceConfigBase<T> referenceConfig)
focal_class.class_method_signature: ReferenceConfigCache.destroyAll()
focal_class.full_signature: public void destroyAll()
focal_class.identifier: destroyAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroyAll()
focal_class.class_method_signature: ReferenceConfigCache.getReferredReferences()
focal_class.full_signature: public ConcurrentMap<String, ReferenceConfigBase<?>> getReferredReferences()
focal_class.identifier: getReferredReferences
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ConcurrentMap<String, ReferenceConfigBase<?>>
focal_class.signature: ConcurrentMap<String, ReferenceConfigBase<?>> getReferredReferences()
focal_class.class_method_signature: ReferenceConfigCache.getProxies()
focal_class.full_signature: public ConcurrentMap<Class<?>, ConcurrentMap<String, Object>> getProxies()
focal_class.identifier: getProxies
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ConcurrentMap<Class<?>, ConcurrentMap<String, Object>>
focal_class.signature: ConcurrentMap<Class<?>, ConcurrentMap<String, Object>> getProxies()
focal_class.class_method_signature: ReferenceConfigCache.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: public void destroyAll() {
          if (CollectionUtils.isEmptyMap(referredReferences)) {
              return;
          }
  
          referredReferences.forEach((_k, referenceConfig) -> {
              referenceConfig.destroy();
              ApplicationModel.getConfigManager().removeConfig(referenceConfig);
          });
  
          proxies.forEach((_type, proxiesOfType) -> {
              proxiesOfType.forEach((_k, v) -> {
                  Destroyable proxy = (Destroyable) v;
                  proxy.$destroy();
              });
          });
  
          referredReferences.clear();
          proxies.clear();
      }
focal_method.class_method_signature: ReferenceConfigCache.destroyAll()
focal_method.full_signature: public void destroyAll()
focal_method.identifier: destroyAll
focal_method.invocations: isEmptyMap forEach destroy removeConfig getConfigManager forEach forEach destroy clear clear
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroyAll()