|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.logging.impl.ServletContextCleaner
public class ServletContextCleaner
This class is capable of receiving notifications about the undeployment of a webapp, and responds by ensuring that commons-logging releases all memory associated with the undeployed webapp.
In general, the WeakHashtable support added in commons-logging release 1.1 ensures that logging classes do not hold references that prevent an undeployed webapp's memory from being garbage-collected even when multiple copies of commons-logging are deployed via multiple classloaders (a situation that earlier versions had problems with). However there are some rare cases where the WeakHashtable approach does not work; in these situations specifying this class as a listener for the web application will ensure that all references held by commons-logging are fully released.
To use this class, configure the webapp deployment descriptor to call this class on webapp undeploy; the contextDestroyed method will tell every accessible LogFactory class that the entry in its map for the current webapp's context classloader should be cleared.
Constructor Summary | |
---|---|
ServletContextCleaner()
|
Method Summary | |
---|---|
void |
contextDestroyed(ServletContextEvent sce)
Invoked when a webapp is undeployed, this tells the LogFactory class to release any logging information related to the current contextClassloader. |
void |
contextInitialized(ServletContextEvent sce)
Invoked when a webapp is deployed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServletContextCleaner()
Method Detail |
---|
public void contextDestroyed(ServletContextEvent sce)
contextDestroyed
in interface ServletContextListener
public void contextInitialized(ServletContextEvent sce)
contextInitialized
in interface ServletContextListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |