I have n number of jobs (stateful:@DisallowConcurrentExecution) say j1, j2... jn scheduled with quartz scheduler which are scheduled to run at different times in the day.
I want to make sure that no two jobs (say j1, j2) should run concurrently, instead if j1 is executing, j2 (next scheduled job by scheduler) shd wait for j1 to finish (its kind of a locking mechanism which i want to achieve without disturbing the schedule of jobs) and as soon as j1 finish, j2 should start execution.
one point to note here is that the next job to be scheduled is purely dynamic and solely depends upon the schedule mentioned in the CronExpression. Hence using JobChainingJobListener to schedule the next firing job is not suitable.
If possible, could you please provide me the sample code for the above worked thread. Please note that, the jobs to be run are dynamically changing (depends upon the Cron Expression in the trigger), so there is no fixed series of jobs like : j1 < j2 < j3. it could be j3< j2 < j1 or J2 < j1 < j3 anything (depending upon their time of fire).