gpt4 book ai didi

java - 停止单个quartz调度器

转载 作者:行者123 更新时间:2023-12-01 05:06:41 24 4
gpt4 key购买 nike

我有 5 个不同的quartz 调度程序,它们实现 5 个不同的作业。如果我停止一个调度程序,则其余调度程序也会停止。为什么?

最佳答案

我很确定您实际上创建了对同一个调度程序的引用,您需要为每个调度程序提供不同的“SchedulerName”。目前看来,每次创建新的调度程序时,它都会默认使用 SchedulerName。

The "job executor" is actually not the SchedulerFactoryBean. It is the Scheduler bean(to be precise calling its start method invokes the aggregated QuartzScheduler.start method which fires the Trigger-s), provided by the SchedulerFactoryBean. As a matter of fact this Scheduler is stored(and looked-up) under the schedulerName(which if not explicitly set has the same default value for every configured SchedulerFactoryBean) in the SchedulerRepository singleton(SchedulerRepository.getInstance()). That's how unless you set a different schedulerName for your SchedulerFactoryBean-s, you will always get the same scheduler by each and every SchedulerFactoryBean-s

http://forum.springsource.org/showthread.php?40945-Multiple-Quartz-SchedulerFactoryBean-instances

我知道这是指 Spring Beans,但我仍然认为这同样适用于这里。

关于java - 停止单个quartz调度器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12561435/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com