任务Bean扫描规则调整,过滤冗余不必要扫描,避免系统组件提前初始化;

3.2.0-release
xuxueli 4 weeks ago
parent 8eff07d7ab
commit 34a28a49a2

@ -2555,8 +2555,10 @@ public void execute() {
- 9、【修复】合并PR-3747修复异常情况下资源泄漏风险 - 9、【修复】合并PR-3747修复异常情况下资源泄漏风险
- 10、【优化】调度中心系统日志调整支持启动时指定 -DLOG_HOME 参数自定义日志位置;同时优化日志格式提升易读性; - 10、【优化】调度中心系统日志调整支持启动时指定 -DLOG_HOME 参数自定义日志位置;同时优化日志格式提升易读性;
- 11、【新增】GLUE模式(Python) 扩展,可选 "GLUE(Python3)" 或 "GLUE(Python2)" 两种模式,分别支持 python3/2 多版本; - 11、【新增】GLUE模式(Python) 扩展,可选 "GLUE(Python3)" 或 "GLUE(Python2)" 两种模式,分别支持 python3/2 多版本;
- 12、【优化】任务Bean扫描规则调整过滤冗余不必要扫描避免系统组件提前初始化
- 3、【规划中】登录安全升级密码加密处理算法从Md5改为Sha256 -
- 13、【ING】底层组件移除单例写法汇总factory统一管理
- 14、【ING】登录安全升级密码加密处理算法从Md5改为Sha256
``` ```
// 1、用户表password字段需要调整长度执行如下命令 // 1、用户表password字段需要调整长度执行如下命令
ALTER TABLE xxl_conf_user ALTER TABLE xxl_conf_user
@ -2565,9 +2567,8 @@ ALTER TABLE xxl_conf_user
// 2、存量用户密码需要修改可执行如下命令将密码初始化 “123456”也可以自行通过 “SHA256Tool.sha256” 工具生成其他初始化密码; // 2、存量用户密码需要修改可执行如下命令将密码初始化 “123456”也可以自行通过 “SHA256Tool.sha256” 工具生成其他初始化密码;
UPDATE xxl_conf_user t SET t.password = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92' WHERE t.username = {用户名}; UPDATE xxl_conf_user t SET t.password = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92' WHERE t.username = {用户名};
``` ```
- 2、【规划中】登录认证重构规范登录态以及权限认证逻辑提升系统安全 - 2、【规划中】登录认证重构规范登录态以及权限认证逻辑提升系统安全登陆态Token生成逻辑优化混淆登陆时间属性降低token泄漏风险
- 1、【规划中】登陆态Token生成逻辑优化混淆登陆时间属性降低token泄漏风险
- 2、【规划中】组件扫描改为BeanPostProcessor方式避免小概率情况下提前初始化底层组件移除单例写法汇总factory统一管理
### TODO LIST ### TODO LIST

@ -27,6 +27,8 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
private static final Logger logger = LoggerFactory.getLogger(XxlJobSpringExecutor.class); private static final Logger logger = LoggerFactory.getLogger(XxlJobSpringExecutor.class);
// ---------------------- start / stop ----------------------
// start // start
@Override @Override
public void afterSingletonsInstantiated() { public void afterSingletonsInstantiated() {
@ -82,9 +84,14 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
return; return;
} }
// init job handler from method // init job handler from method
String[] beanDefinitionNames = applicationContext.getBeanNamesForType(Object.class, false, true); String[] beanDefinitionNames = applicationContext.getBeanNamesForType(Object.class, false, false); // allowEagerInit=false, avoid early initialization
for (String beanDefinitionName : beanDefinitionNames) { for (String beanDefinitionName : beanDefinitionNames) {
// filter system bean
if (isSystemBean(beanDefinitionName)) {
continue;
}
// get bean // get bean
Object bean = null; Object bean = null;
Lazy onBean = applicationContext.findAnnotationOnBean(beanDefinitionName, Lazy.class); Lazy onBean = applicationContext.findAnnotationOnBean(beanDefinitionName, Lazy.class);
@ -123,6 +130,13 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
} }
} }
// check if system bean, not job bean
private boolean isSystemBean(String beanClassName) {
return beanClassName.startsWith("org.springframework")
|| beanClassName.startsWith("spring.");
}
// ---------------------- applicationContext ---------------------- // ---------------------- applicationContext ----------------------
private static ApplicationContext applicationContext; private static ApplicationContext applicationContext;

Loading…
Cancel
Save