Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.fileupload.servlet
Class FileCleanerCleanup

    java.lang.Object
      org.apache.commons.fileupload.servlet.FileCleanerCleanup

All Implemented Interfaces:
  java.util.EventListener, javax.servlet.ServletContextListener

    public class FileCleanerCleanup

extends java.lang.Object
implements javax.servlet.ServletContextListener

A servlet context listener, which ensures that the `FileCleaner's` reaper thread is terminated, when the web application is destroyed.

Field Summary
`static java.lang.String` | `FILE_CLEANING_TRACKER_ATTRIBUTE` Attribute name, which is used for storing an instance of `FileCleaningTracker` in the web application.

Constructor Summary
`FileCleanerCleanup()`

Method Summary
`void` | `contextDestroyed(javax.servlet.ServletContextEvent sce)` Called when the web application is being destroyed.
`void` | `contextInitialized(javax.servlet.ServletContextEvent sce)` Called when the web application is initialized.
`static org.apache.commons.io.FileCleaningTracker` | `getFileCleaningTracker(javax.servlet.ServletContext pServletContext)` Returns the instance of `FileCleaningTracker`, which is associated with the given `ServletContext`.
`static void` | `setFileCleaningTracker(javax.servlet.ServletContext pServletContext, org.apache.commons.io.FileCleaningTracker pTracker)` Sets the instance of `FileCleaningTracker`, which is associated with the given `ServletContext`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FILE_CLEANING_TRACKER_ATTRIBUTE

    public static final java.lang.String FILE_CLEANING_TRACKER_ATTRIBUTE

  Attribute name, which is used for storing an instance of `FileCleaningTracker` in the web application.

Constructor Detail

### FileCleanerCleanup

    public FileCleanerCleanup()

Method Detail

### getFileCleaningTracker

    public static org.apache.commons.io.FileCleaningTracker getFileCleaningTracker(javax.servlet.ServletContext pServletContext)

  Returns the instance of `FileCleaningTracker`, which is associated with the given `ServletContext`.

  Parameters:
    `pServletContext` - The servlet context to query
  Returns:
    The contexts tracker

### setFileCleaningTracker

    public static void setFileCleaningTracker(javax.servlet.ServletContext pServletContext,
                                              org.apache.commons.io.FileCleaningTracker pTracker)

  Sets the instance of `FileCleaningTracker`, which is associated with the given `ServletContext`.

  Parameters:
    `pServletContext` - The servlet context to modify
    `pTracker` - The tracker to set

### contextInitialized

    public void contextInitialized(javax.servlet.ServletContextEvent sce)

  Called when the web application is initialized. Does nothing.

  Specified by:
    `contextInitialized` in interface `javax.servlet.ServletContextListener`
  Parameters:
    `sce` - The servlet context, used for calling `setFileCleaningTracker(ServletContext, FileCleaningTracker)`.

### contextDestroyed

    public void contextDestroyed(javax.servlet.ServletContextEvent sce)

  Called when the web application is being destroyed. Calls `FileCleaningTracker.exitWhenFinished()`.

  Specified by:
    `contextDestroyed` in interface `javax.servlet.ServletContextListener`
  Parameters:
    `sce` - The servlet context, used for calling `getFileCleaningTracker(ServletContext)`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ? 2002-2008 The Apache Software Foundation. All Rights Reserved.