org.springframework.web.context
Class ContextCleanupListener

java.lang.Object
  extended by org.springframework.web.context.ContextCleanupListener

public class ContextCleanupListener
extends java.lang.Object

Web application listener that cleans up remaining disposable attributes in the ServletContext, i.e. attributes which implement DisposableBean and haven't been removed before. This is typically used for destroying objects in "application" scope, for which the lifecycle implies destruction at the very end of the web application's shutdown phase.

Since:
3.0
Author:
Juergen Hoeller
See Also:
ServletContextScope, ContextLoaderListener

Field Summary
private static Log logger
           
 
Constructor Summary
ContextCleanupListener()
           
 
Method Summary
(package private) static void cleanupAttributes(ServletContext sc)
          Find all ServletContext attributes which implement DisposableBean and destroy them, removing all affected ServletContext attributes eventually.
 void contextDestroyed(ServletContextEvent event)
           
 void contextInitialized(ServletContextEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Log logger
Constructor Detail

ContextCleanupListener

public ContextCleanupListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)

contextDestroyed

public void contextDestroyed(ServletContextEvent event)

cleanupAttributes

static void cleanupAttributes(ServletContext sc)
Find all ServletContext attributes which implement DisposableBean and destroy them, removing all affected ServletContext attributes eventually.

Parameters:
sc - the ServletContext to check