Reputation: 363
Would you please explain to me the exact mean of the StatefulJob in quartz and it's difference with none StatefulJob?
Upvotes: 8
Views: 12716
Reputation: 3
jobDetail.getJobDataMap().put("type","FULL");
This line is will decide we are using statefull or non-statefull.
Upvotes: 0
Reputation: 188
StatefulJob interface, provides 2 things,
first: only one job will be run any time
second: in (SimpleTriggerBean) you will not worry about your job running duration. it means that the next run will be done after delay time after ending of previous one.
Upvotes: 13
Reputation: 26036
StatefulJob guarantees only one job will be running at one time. For example, if you schedule your job to run every 1 minute, but your job took 5 minutes to complete, then the job will not be run again until the previous job has completed.
This is useful to make sure there is only one job running at any given time.
The next job will be run on the next schedule, not immediately after the previous job completed.
Upvotes: 3