Ejemplo n.º 1
0
 @Override
 public void contextDestroyed(final ServletContextEvent servletContextEvent) {
   synchronized (servletContextListeners) {
     for (int i = servletContextListeners.size() - 1; i >= 0; --i) {
       final ServletContextListener listener =
           (ServletContextListener) servletContextListeners.get(i);
       listener.contextDestroyed(servletContextEvent);
     }
   }
 }
 @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");
 }
Ejemplo n.º 3
0
  public void contextDestroyed(ServletContextEvent sce) {
    if (ctx == null) {
      logger.warn("cannot find applicationContext");

      return;
    }

    Collection<ServletContextListener> servletContextListeners =
        ctx.getBeansOfType(ServletContextListener.class).values();

    for (ServletContextListener servletContextListener : servletContextListeners) {
      servletContextListener.contextDestroyed(sce);
    }
  }
  @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();
  }
 public void destroy() {
   delegate.destroy();
   listener.contextDestroyed(new ServletContextEvent(config.getServletContext()));
   config = null;
 }