SpringJobScheduler获取值问题
来源:3-21 定时任务通用组件封装-5
蓝天白云9399400
2021-06-06 11:35:22
相关截图:相关代码:
String registerBeanName = conf.name() + "SpringJobScheduler";
为什么要加 conf.name() 那。
conf.name() 的值为com.bfxy.esjob.task.test.TestJob。
与"SpringJobScheduler"相拼接后,
"com.bfxy.esjob.task.test.TestJobSpringJobScheduler"
后面又是通过如下获取,
SpringJobScheduler springJobScheduler= (SpringJobScheduler) applicationContext.getBean("SpringJobScheduler");
为什么
1回答
阿神
2021-06-10
嗯 可以用全命名拼接 获取 classloader的方式, 也可以使用springbean name的方式,如果没有用到之前的也可以不需要的
相似问题
回答 1
回答 1