I had a scheduler class as follows :
public class JobScheduler implements ServletContextListener {
private static scheduler = getSchedulerInstance();
private static Scheduler getSchedulerInstance() {
if(scheduler == null) {
scheduler = StdSchedulerFactory.getDefaultScheduler();
}
}
....
@Override
public void contextInitialized(ServletContextEvent arg0) {
initializeJobs();
}
@Override
public void contextDestroyed(ServletContextEvent arg0) {
scheduler.shutdown();
}
And web.xml will have the snippet as follows:
<listener>
<listener-class>com.company.JobScheduler</listener-class>
</listener>
This was for a regular Tomcat application. When server started, the scheduler would come alive. How would I achieve that with Vaadin & Springboot? Any example will be most appreciated. Thanks.