Quartz 1.8到2.x迁移

时间:2022-12-02 02:14:58

The following Code is written Quartz 1.8:

以下代码是Quartz 1.8编写的:

SimpleTrigger safeHashChainStateTrigger = new SimpleTrigger(
    SafeHashChainState.class.getName() + "Trigger",
    StampingServerInfo.QUARTZSERVICEGROUP, 
    new Date(TriggerUtils.getNextGivenSecondDate(null, 10).getTime()),
    null, SimpleTrigger.REPEAT_INDEFINITELY, 
    providerObj.checkIntProperties("stamping.restart.quartz.safeHashChainState.Timeout", 30, 5) * 1000);

I would like to migrate to Quartz 2.x, but the method getNextGivenSecondDate does not appear to exist any longer. How do I work around that?

我想迁移到Quartz 2.x,但方法getNextGivenSecondDate似乎不再存在。我该如何解决这个问题?

1 个解决方案

#1


2  

From the migration guide you could read this:

从迁移指南中,您可以阅读:

"Methods on TriggerUtils related to construction of Date instances have been moved to DateBuilder and can be made easy use of via static imports. Dates can then easily and cleanly be constructed and used in-line with the new trigger builder DSL."

“关于构造Date实例的TriggerUtils上的方法已经被移动到DateBuilder,并且可以通过静态导入轻松使用。日期可以轻松,干净地构建并与新的触发器构建器DSL一起使用。”

The nextGivenMinuteDate is in this link nextGivenMinuteDate.

nextGivenMinuteDate在此链接nextGivenMinuteDate中。

Hope this helps.

希望这可以帮助。

#1


2  

From the migration guide you could read this:

从迁移指南中,您可以阅读:

"Methods on TriggerUtils related to construction of Date instances have been moved to DateBuilder and can be made easy use of via static imports. Dates can then easily and cleanly be constructed and used in-line with the new trigger builder DSL."

“关于构造Date实例的TriggerUtils上的方法已经被移动到DateBuilder,并且可以通过静态导入轻松使用。日期可以轻松,干净地构建并与新的触发器构建器DSL一起使用。”

The nextGivenMinuteDate is in this link nextGivenMinuteDate.

nextGivenMinuteDate在此链接nextGivenMinuteDate中。

Hope this helps.

希望这可以帮助。