java - 在 Spring Boot 应用程序中更新底层依赖 bean 时刷新 bean
问题描述
我有一个配置如下:
@Configuration
public class REConfiguration {
private final DBRuleLoader dbRuleLoader;
public REConfiguration(
DBRuleLoader dbRuleLoader) {
this.dbRuleLoader = dbRuleLoader;
}
@RefreshScope
@Bean
public REMgr ruleEngine() {
return REmgrFactory.getREMgr(this.dbRuleLoader);
}
}
实际上,我在@RefreshScope
这里添加了,因为我希望对底层DBRuleLoader
bean的任何更新REMgr
都进行刷新。我不确定它是否真的有效。
解决方案
推荐阅读
- react-native - 反应原生地理定位服务不适用于 iOS
- java - 如何配置 Jackson 以首先序列化基类?
- spring-boot - PagingAndSortingRepository 第一个页面加载很慢
- python - 用于 Solaris 操作系统的 Geckodriver
- python - 如何区分产品页面和普通页面
- pentaho - 将数千行转置为 Pentaho 中的列
- java - Webview 加载 url,然后加载此图像
- c - 我怎么知道该文件已打开并在使用 C 代码进行一些编写操作后保存?
- jquery - 在角度 8 中重新初始化数据表实例后分页不起作用
- asp.net-mvc - 指定的文件不存在:“~/Scripts/telerik.grid.js”