Integrating Quartz Scheduler with vaadin application

Can somebody please provide me an example to intialize quartz scheduler with Vaadin application.The help wopuld be appreciated.

Thanks
Navatha

Hello,

integration of quartz in vaadin is done the same way as in any servlet.

You would add ContextListener class and define it in web.xml
public class ContextListener implements ServletContextListener {

private ServletContext context = null;

public void contextInitialized(ServletContextEvent event) {
    context = event.getServletContext();
}
public void contextDestroyed(ServletContextEvent event) {
}

}

In web.xml

ContextListener

So you can start and stop the scheduler.

Thanks Andre but when we need to initialize the servlet context in a separate class iam not able to see the quartz scheduler class initialized.

Extend the https://vaadin.com/api/com/vaadin/terminal/gwt/server/ApplicationServlet.html class

Then in your web.xml instead of specifying


<servlet>
    <servlet-name>myservlet</servlet-name>
    <servlet-class>
        com.vaadin.terminal.gwt.server.ApplicationServlet
    </servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>MyApplicationClass</param-value>
    </init-param>
  </servlet>

specify the class of your ApplicationServlet and you should have all in one.

André

Thanks Andre i did specify ApplicationServlet in the web.xml and class of the application it looks like it was due to the proprties in my quartz configuration file.