// Timer configuration
private String payload = "This is the payload passed to the timer event";
ScheduleExpression schedule = new ScheduleExpression().second(30).minute("").hour("").dayOfMonth("").dayOfWeek("").month("").year("");
private Timer timer = timerService.createCalendarTimer(schedule, new TimerConfig(payload, true));
...
timer.cancel(); // -> doesn't work!
Collection<Timer> timers = timerService.getTimers();
System.out.println("Timers configured: " + timers); // still reports the timer
// Callback configuration
@SuppressWarnings("unused")
@Timeout
private void configurationScheduledTimeout(final Timer t) {
String info = (String) t.getInfo();
System.out.println("configurationScheduledTimeout called at: " + new java.util.Date() + "info: " + info);
}
Cancel from within configurationScheduledTimeout also didn't work.