Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有工作需要在一天的固定时间执行,如下所示,“05:00、06:10、07:30、08:15、09:05、10:35”
我如何在 Quartz 中为此构建触发器?
我找不到开箱即用的方法。
我看到两种方法可以解决您的问题:
为您的工作设置异常调度的最明显和最简单的方法是组合多个触发器。Quartz 允许为单个 JobDetail 设置尽可能多的触发器。
这是一种更复杂的方式,仅在您必须只使用一个触发器时才适用。您可以实现org.quartz.Trigger接口或任何子接口来设置自己的规则。
org.quartz.Trigger