CronTrigger is often more useful than SimpleTrigger, if you need a job-firing schedule that recurs based on calendar-like notions, rather than on the exactly specified intervals of SimpleTrigger.
CronTrigger通常比SimpleTrigger用处更大,比如当你需要指定安排表基于日历的,而不是基于精确指定的SimpleTrigger
An example of a complete cron-expression is the string "0 0 12 ? * WED" - which means "every Wednesday at 12:00:00 pm".
Individual sub-expressions can contain ranges and/or lists. For example, the day of week field in the previous (which reads "WED") example could be replaced with "MON-FRI", "MON,WED,FRI", or even "MON-WED,SAT".
Wild-cards (the '' character) can be used to say "every" possible value of this field. Therefore the '' character in the "Month" field of the previous example simply means "every month". A '*' in the Day-Of-Week field would therefore obviously mean "every day of the week".
本文探讨了CronTrigger相较于SimpleTrigger的优势,特别是在需要基于日历规律而非精确间隔重复任务的情况下。通过实例展示了Cron表达式的灵活性及其如何定义复杂的定时任务。
9838

被折叠的 条评论
为什么被折叠?



