class ReferenceConfigCache {

    public void destroy(String key, Class<?> type) {
        ReferenceConfigBase<?> rc = referredReferences.remove(key);
        if (rc == null) {
            return;
        }

        ApplicationModel.getConfigManager().removeConfig(rc);
        rc.destroy();

        Map<String, Object> proxiesOftype = proxies.get(type);
        if (CollectionUtils.isNotEmptyMap(proxiesOftype)) {
            proxiesOftype.remove(key);
            if (proxiesOftype.isEmpty()) {
                proxies.remove(type);
            }
        }
    }

    private  ReferenceConfigCache(String name, KeyGenerator generator);

}