@Override public void contextDestroyed(ServletContextEvent event) { cleanupAttributes(event.getServletContext()); }
@Test public void testApplicationScope() { WebApplicationContext ac = initApplicationContext(WebApplicationContext.SCOPE_APPLICATION); assertNull(ac.getServletContext().getAttribute(NAME)); DerivedTestBean bean = ac.getBean(NAME, DerivedTestBean.class); assertSame(bean, ac.getServletContext().getAttribute(NAME)); assertSame(bean, ac.getBean(NAME)); new ContextCleanupListener().contextDestroyed(new ServletContextEvent(ac.getServletContext())); assertTrue(bean.wasDestroyed()); }
private void registerSpringContextLoaderListener(ServletContext servletContext, WebApplicationContext rootContext) { servletContext.addListener(new ContextLoaderListener(rootContext)); servletContext.addListener(new ContextCleanupListener()); servletContext.addListener(new RequestContextListener()); } }
/** * Close the root web application context. */ @Override public void contextDestroyed(ServletContextEvent event) { closeWebApplicationContext(event.getServletContext()); ContextCleanupListener.cleanupAttributes(event.getServletContext()); }
@Override public void contextDestroyed(ServletContextEvent event) { cleanupAttributes(event.getServletContext()); }
/** * Close the root web application context. */ @Override public void contextDestroyed(ServletContextEvent event) { closeWebApplicationContext(event.getServletContext()); ContextCleanupListener.cleanupAttributes(event.getServletContext()); }
@Override public void contextDestroyed(ServletContextEvent event) { cleanupAttributes(event.getServletContext()); }
@Override public void contextDestroyed(ServletContextEvent event) { cleanupAttributes(event.getServletContext()); }
/** * Close the root web application context. */ @Override public void contextDestroyed(ServletContextEvent event) { closeWebApplicationContext(event.getServletContext()); ContextCleanupListener.cleanupAttributes(event.getServletContext()); }
/** * Close the root web application context. */ @Override public void contextDestroyed(ServletContextEvent event) { closeWebApplicationContext(event.getServletContext()); ContextCleanupListener.cleanupAttributes(event.getServletContext()); }