* 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;
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);
+ }
}
}