Any relation between Quartz API and Joda Time API?

前端 未结 4 1093
傲寒
傲寒 2021-02-15 09:34

Is it possible to create a date in JodaTime and then make Quartz schedule the job using the JodaTime object? Can we give a Period jodaPeriod to Quartz API in order to run a task

4条回答
  •  半阙折子戏
    2021-02-15 10:07

    Quartz provides a pretty comprehensive API that you could extend anyway you wanted.
    The hook you would need to create would be against the Trigger interface, I've created one before but not using Joda time.

    From the sounds of your question if you want to create a job that runs for a particular period of the day you could also just try using the CronTrigger. For example to run every minute between 9am and 11am you could do

    * 9-10 * * *
    

    Obviously Joda makes it much easier to configure but your sysadmins respect you more for cron...

提交回复
热议问题