懒羊羊
2023-10-17 5d91e0a52879bf16511817b3cd20496f07717ab1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cn.stylefeng.guns.modular.zsx.bs.job.quartz;
 
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
/**
 * @author fulin
 * @since 2023/6/14 15:25
 * <p>
 * 此类仅仅作为引入静态调度器的工具类 {@link Scheduler}
 * </p>
 */
@Component
public class SchedulerStatic {
 
    private static Scheduler scheduler;
 
    @Autowired
    public SchedulerStatic(Scheduler scheduler) {
        SchedulerStatic.scheduler = scheduler;
    }
 
    public static Scheduler getScheduler() {
        return scheduler;
    }
}