class EverrestInitializedListener implements ServletContextListener {

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        makeFileCollectorDestroyer().stopFileCollector();
        ServletContext servletContext = sce.getServletContext();
        EverrestProcessor processor = (EverrestProcessor)servletContext.getAttribute(EverrestProcessor.class.getName());
        if (processor != null) {
            processor.stop();
        }
        servletContext.removeAttribute(EverrestProcessor.class.getName());
        servletContext.removeAttribute(EverrestConfiguration.class.getName());
        servletContext.removeAttribute(Application.class.getName());
        servletContext.removeAttribute(DependencySupplier.class.getName());
        servletContext.removeAttribute(ResourceBinder.class.getName());
        servletContext.removeAttribute(ApplicationProviderBinder.class.getName());
    }

}