ResetBeanPostProcessorCaches.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:HotswapAgent 作者:
public static void resetInitDestroyAnnotationBeanPostProcessorCache(InitDestroyAnnotationBeanPostProcessor bpp) {
    try {
        Field field = InitDestroyAnnotationBeanPostProcessor.class.getDeclaredField("lifecycleMetadataCache");
        field.setAccessible(true);
        Map lifecycleMetadataCache = (Map) field.get(bpp);
        lifecycleMetadataCache.clear();
        LOGGER.trace("Cache cleared: InitDestroyAnnotationBeanPostProcessor.lifecycleMetadataCache");
    } catch (Exception e) {
        throw new IllegalStateException("Unable to clear InitDestroyAnnotationBeanPostProcessor.lifecycleMetadataCache", e);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号