开发者

Exclude time blocks on particular day [Quartz Schedular]

I am using Quart Scheduler. I want to trigger to in such a fashion so as it excludes timing from xx:xx:xx to yy:yy:yy on day spec开发者_如何学运维ified (monday, friday. sunday). I know how to exclude particular day. but don't know how not to trigger on given time block on given day?

Can anybody know anything about it?


Please make use of Calendar and HolidayCalendar available in Quartz to achieve this. The Cron expression in Cron-Trigger can also be written smartly to achieve this as well.


Looking at http://www.quartz-scheduler.org/docs/examples/Example3.html, it seems that one can create different job set to do the same task. For each job one can attach a schedule.

If you dont want to run a particular task on say sunday between 1pm and 10pm, but want it to run on sunday the remainder of the day, then you can create two jobs [set to do the same task]. For one give the schedule with time restrictions 00:00 to 13:00. And for the second give time restriction of 22:00 to 23:59.

I hope I understood your problem correctly ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜