@Override
 public void contextDestroyed(final ServletContextEvent servletContextEvent) {
   super.contextDestroyed(servletContextEvent);
   if (servletContextListeners != null) {
     Iterator<ServletContextListener> it = servletContextListeners.iterator();
     while (it.hasNext()) {
       ServletContextListener listener = it.next();
       logger.finer("Destroy ServletContextListener: " + listener.getClass().getName());
       listener.contextDestroyed(servletContextEvent);
     }
   }
   logger.finer("Destroyed ServletContextListener");
 }
 @Override
 public void contextInitialized(final ServletContextEvent servletContextEvent) {
   BootstrapUtil.restoreSystemProperties();
   if (servletContextListeners == null) {
     servletContextListeners = ServiceLoader.load(ServletContextListener.class);
   }
   if (servletContextListeners != null) {
     Iterator<ServletContextListener> it = servletContextListeners.iterator();
     while (it.hasNext()) {
       ServletContextListener listener = it.next();
       logger.finer("Initialize ServletContextListener: " + listener.getClass().getName());
       listener.contextInitialized(servletContextEvent);
     }
   }
   super.contextInitialized(servletContextEvent);
   logger.finer("Initialized ServletContextListener");
 }
  @Override
  protected void fireUndeployEvent() {
    if (_servletContextListeners != null) {
      ServletContextEvent servletContextEvent = new ServletContextEvent(servletContext);

      for (ServletContextListener servletContextListener : _servletContextListeners) {

        try {
          servletContextListener.contextDestroyed(servletContextEvent);
        } catch (Throwable t) {
          String className = ClassUtil.getClassName(servletContextListener.getClass());

          _log.error(
              className
                  + " is unable to process a context "
                  + "destroyed event for "
                  + servletContext.getServletContextName(),
              t);
        }
      }
    }

    super.fireUndeployEvent();
  }