test_class.file: dubbo-config/dubbo-config-api/src/test/java/com/alibaba/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("FooService", "group1", "1.0.0");
          cache.get(config);
          MockReferenceConfig configCopy = buildMockReferenceConfig("XxxService", "group1", "1.0.0");
          cache.get(configCopy);
          assertEquals(2, cache.cache.size());
          cache.destroyAll();
          assertTrue(config.isDestroyMethodRun());
          assertTrue(configCopy.isDestroyMethodRun());
          assertEquals(0, cache.cache.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 buildMockReferenceConfig get assertEquals size destroyAll assertTrue isDestroyMethodRun assertTrue isDestroyMethodRun assertEquals size
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 = new KeyGenerator() {
          @Override
          public String generateKey(ReferenceConfig<?> 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 = new KeyGenerator() {
          @Override
          public String generateKey(ReferenceConfig<?> 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: cacheHolder = new ConcurrentHashMap<String, ReferenceConfigCache>()
focal_class.modifier: static final
focal_class.original_string: static final ConcurrentMap<String, ReferenceConfigCache> cacheHolder = new ConcurrentHashMap<String, ReferenceConfigCache>();
focal_class.type: ConcurrentMap<String, ReferenceConfigCache>
focal_class.var_name: cacheHolder
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: cache = new ConcurrentHashMap<String, ReferenceConfig<?>>()
focal_class.original_string: ConcurrentMap<String, ReferenceConfig<?>> cache = new ConcurrentHashMap<String, ReferenceConfig<?>>();
focal_class.type: ConcurrentMap<String, ReferenceConfig<?>>
focal_class.var_name: cache
focal_class.file: dubbo-config/dubbo-config-api/src/main/java/com/alibaba/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(ReferenceConfig<T> referenceConfig)
focal_class.full_signature: @SuppressWarnings("unchecked") public T get(ReferenceConfig<T> referenceConfig)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (ReferenceConfig<T> referenceConfig)
focal_class.return: T
focal_class.signature: T get(ReferenceConfig<T> referenceConfig)
focal_class.class_method_signature: ReferenceConfigCache.destroyKey(String key)
focal_class.full_signature:  void destroyKey(String key)
focal_class.identifier: destroyKey
focal_class.parameters: (String key)
focal_class.return: void
focal_class.signature: void destroyKey(String key)
focal_class.class_method_signature: ReferenceConfigCache.destroy(ReferenceConfig<T> referenceConfig)
focal_class.full_signature: public void destroy(ReferenceConfig<T> referenceConfig)
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: (ReferenceConfig<T> referenceConfig)
focal_class.return: void
focal_class.signature: void destroy(ReferenceConfig<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.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() {
          Set<String> set = new HashSet<String>(cache.keySet());
          for (String key : set) {
              destroyKey(key);
          }
      }
focal_method.class_method_signature: ReferenceConfigCache.destroyAll()
focal_method.full_signature: public void destroyAll()
focal_method.identifier: destroyAll
focal_method.invocations: keySet destroyKey
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroyAll()