首页>代码>spring boot+spring data jpa+h2实现quartz任务管理系统>/spring-boot-quartz-master/src/main/java/com/stackabuse/config/SchedulerJobFactory.java
package com.stackabuse.config; import org.quartz.spi.TriggerFiredBundle; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.scheduling.quartz.SpringBeanJobFactory; public class SchedulerJobFactory extends SpringBeanJobFactory implements ApplicationContextAware { private AutowireCapableBeanFactory beanFactory; @Override public void setApplicationContext(final ApplicationContext context) { beanFactory = context.getAutowireCapableBeanFactory(); } @Override protected Object createJobInstance(final TriggerFiredBundle bundle) throws Exception { final Object job = super.createJobInstance(bundle); beanFactory.autowireBean(job); return job; } }


是你爸爸啊100 LV3
7月26日
eversec
7月25日
暂无贡献等级
squarl LV10
7月25日
a1677596408 LV23
7月14日
sales666 LV1
7月11日
VINCENT_CHEN94 LV8
7月11日
暂无贡献等级
CrystalQ LV8
7月3日
anopsign LV1
7月3日
ningxiaodong LV5
7月1日