版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dcruoyu/article/details/79479905


public class IncrCrawlJob implements Job {

    /** logger */


  • 该时间段应该执行几个任务还是会执行几个任务,即使上一个任务执行完毕后已经超过该时间段


@DisallowConcurrentExecution is an annotation that can be added to the Job class that tells Quartz not to execute multiple instances of a given job definition (that refers to the given job class) concurrently.
Notice the wording there, as it was chosen very carefully. In the example from the previous section, if “SalesReportJob” has this annotation, than only one instance of “SalesReportForJoe” can execute at a given time, but it can execute concurrently with an instance of “SalesReportForMike”. The constraint is based upon an instance definition (JobDetail), not on instances of the job class. However, it was decided (during the design of Quartz) to have the annotation carried on the class itself, because it does often make a difference to how the class is coded.