The <task:scheduled>
configuration style is a convenient shortcut on to underlying Spring factory beans that generate schedulers and schedules. As a convenience, it's useful, but is much less flexible than using the underlying scheduler factories directly.
Having said that, the schedulers themselves would need to expose the "next fire time" information via their API, and that's implementation-dependent. For example, I don't see a way to get this information from the standard ScheduledExecutorService
implementations.
Quartz, however, does expose this, via the getNextFireTime()
method on the Trigger
class.
If you're willing to abandon <task:scheduled>
and use the Quartz-Spring integration directly, then you can get access to the Trigger
(or TriggerBean
) and get what you want that way.