Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to suspend job in quartz scheduler?

Hi i am creating an application that executes the method of a class based on a cron expression. For that i am using spring quartz in which i have to configure all these stuffs in my spring-file it works fine and jobs are executing based on the cron expression, But now i want to suspend the next execution of particular job in java class based on the choice of a user from UI. Then is there any way to do this ??

can i get the details of all running job it the context ? if so then i can filter the jobs and try to suspend that job for next execution.

like image 765
Hemant Metalia Avatar asked Dec 04 '22 06:12

Hemant Metalia


1 Answers

Inject your SchedulerFactoryBean. Use it's getScheduler method to obtain a quartz Scheduler and use rescheduleJob or other methods from quartz API to perform your task.

like image 122
Anthony Accioly Avatar answered Dec 05 '22 20:12

Anthony Accioly