Recently I used SchedulingConfigurer to schedule same task for multiple cron expressions. And one more requirement is the cron expression may change on the fly that means I am having the cron trigger in data base. If have a provision to get the scheduled task which are scheduled using ScheduledTaskRegistrar then I will cancel the task and schedule the same task with new cron expression. I see there is a destroy method to cancel the scheduled task but that also shutdowns the executor also. My request is to provide getter method to get the scheduled task and cancel them. Also make the scheduleTasks as public method so that I can call the same method when the cron is changed dynamically , for now in my application I am using the afterProperties method.

Comment From: Nidhi-Tanwar14

Have you considered using an Executor please? It's easily canceled in code.

Comment From: snicoll

Thanks for the suggestion but we You need to hold a reference to the ScheduleTask to manipulate it. getScheduleTasks gives you all the tasks in case you need that.