X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=mythtv%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fmythtv%2FApplication.java;h=01d030262d5bb1791e8d2865b4ebde4c42e7b084;hb=06570e39b7e2c63d2f8094baf6658bd269610dcc;hp=d2135639c7df9df72152cdca0c39fb085ab26782;hpb=f18021bca60d22c28fb12d4c4c18f9222a0e492d;p=utils diff --git a/mythtv/src/main/java/org/wamblee/mythtv/Application.java b/mythtv/src/main/java/org/wamblee/mythtv/Application.java index d2135639..01d03026 100644 --- a/mythtv/src/main/java/org/wamblee/mythtv/Application.java +++ b/mythtv/src/main/java/org/wamblee/mythtv/Application.java @@ -12,7 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ package org.wamblee.mythtv; @@ -21,27 +21,42 @@ import javax.servlet.ServletContextListener; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.quartz.SchedulerException; import org.wamblee.general.BeanKernel; /** - *f + * f */ public class Application implements ServletContextListener { private static final Log LOG = LogFactory.getLog(Application.class); - - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) */ public void contextInitialized(ServletContextEvent arg0) { - LOG.info("initializing"); - BeanKernel.getBeanFactory(); + LOG.info("initializing"); + try { + BeanKernel.getBeanFactory().find(MonitorScheduler.class) + .initialize(); + } catch (SchedulerException e) { + LOG.error("Error starting scheduler", e); + } } - - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ public void contextDestroyed(ServletContextEvent arg0) { LOG.info("terminating"); + try { + BeanKernel.getBeanFactory().find(MonitorScheduler.class) + .shutdown(); + } catch (SchedulerException e) { + LOG.error("Error stopping scheduler", e); + } } }