Hi, for example when scheduling a runnable like this
...it would be nice to access the TriggerContext internally stored in the non-public class ReschedulingRunnable such that its methods lastScheduledExecutionTime(), lastActualExecutionTime() and lastCompletionTime() can be called.Code:@Autowired ThreadPoolTaskScheduler scheduler; [...] final CronTrigger trigger = new CronTrigger("0/5 * * * * ?"); ScheduledFuture<?> future = scheduler.schedule(new Runnable() { @Override public void run() { System.out.println("I'm triggered by cron!"); System.out.println("nextExecutionTime: " + trigger.nextExecutionTime(new SimpleTriggerContext())); } }, trigger);
But that seems to be impossible! True? Why? Will it be possible in a future spring version? Are there other ways to do this?
EDIT: See https://jira.springsource.org/browse/SPR-8500
Cheers!
B.


Reply With Quote
