1 19 package org.netbeans.modules.exceptions.web; 20 21 import javax.servlet.ServletContextEvent ; 22 import javax.servlet.ServletContextListener ; 23 24 28 public class ContextListener implements ServletContextListener { 29 30 public ContextListener() { 31 } 32 33 public void contextInitialized(ServletContextEvent sce) { 34 IssuezillaUpdater updater = new IssuezillaUpdater(); 35 updater.start(); 36 sce.getServletContext().setAttribute("updater", updater); 37 } 38 39 public void contextDestroyed(ServletContextEvent sce) { 40 Object o = sce.getServletContext().getAttribute("updater"); 41 if (o instanceof IssuezillaUpdater) { 42 IssuezillaUpdater updater = (IssuezillaUpdater) o; 43 updater.stopUpdating(); 44 } 45 } 46 } 47 | Popular Tags |