Package org.springframework.web.context

# Class ContextCleanupListener

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

All Implemented Interfaces:
  `ServletContextListener`, `EventListener`

public class ContextCleanupListener extends Object implements ServletContextListener
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`

## Constructor Summary

Constructors
Constructor
Description
`ContextCleanupListener()`

## Method Summary

Modifier and Type
Method
Description
`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`

## Constructor Details

### ContextCleanupListener

public ContextCleanupListener()

## Method Details

### contextInitialized

public void contextInitialized(ServletContextEvent event)

Specified by:
  `contextInitialized` in interface `ServletContextListener`

### contextDestroyed

public void contextDestroyed(ServletContextEvent event)

Specified by:
  `contextDestroyed` in interface `ServletContextListener`