I have a couple of tasks scheduled within Spring's task scheduler:
<task:scheduled-tasks>
<task:scheduled ref="task1" method="run"
cron="0 0 */0 * * *" />
<task:scheduled ref="task2" method="run"
cron="0 0 */30 * * *" />
</task:scheduled-tasks>
<task:scheduler id="scheduler" pool-size="10" />
How can I access a list of scheduled tasks and retrieve meta-information (e.g the next execution time) from within the application context?
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler)context.getBean("scheduler");
//... how to continue from here?
context.getBean("scheduler")
anymore, butcontext.getBean("taskScheduler")
, at least in Spring Boot 2.6.3. – Caterpillar