This works, but is this the best and/or only approach? If I give the class either @VaadinSessionScope or @UIScope, the scheduler won’t schedule.
public static void setVaadinSession(VaadinSession session) {
vaadinSession = session;
}
@Scheduled(cron = "0 * * * * ?")
public void eachMinute() {
if (vaadinSession != null) {
vaadinSession.lock();
try {
userTimezone = (String) vaadinSession.getAttribute(USER_TIMEZONE);
} finally {
vaadinSession.unlock();
}
}
}