I want to use Quartz Framework in my application. There are two jobs in the scheduler. Now I want to check if job1 is running. How can I check? I have tried to Google it but failed to find the solution.
I am following the first of example from Quartz distribution.
We can unschedule a Job by calling the unschedule() method of the Scheduler class and passing the TriggerKey . If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.
@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.
You can use scheduler.getCurrentlyExecutingJobs()
to get a list of all jobs which are currently running.
Please note scheduler.getCurrentlyExecutingJobs()
just check for the current scheduler instance,not the whole cluster。
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With