It appears that the WebappClassLoader[1], while declaring that it implements 
Lifecycle[2], actually ignores LifecycleListeners[3]. I have observed that 
registering a Lifecycle listener with a WebappClassLoader seems to have no 
effect. When the classloader is stopped, the listener was not called. The 
source[4] hosted out on java2s.com seems to confirm that listeners are ignored.

Why are listeners ignored?
If they are going to be ignored, could this at least be documented? Also, 
perhaps addLifecycleListener[5] should throw an exception to indicate it is not 
supported.

[1] - 
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/loader/WebappClassLoader.html
[2] - 
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/Lifecycle.html
[3] - 
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/LifecycleListener.html
[4] - 
http://www.java2s.com/Open-Source/Java-Document/Sevlet-Container/tomcat-catalina/org/apache/catalina/loader/WebappClassLoader.java.htm
[5] - 
http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/loader/WebappClassLoader.html#addLifecycleListener(org.apache.catalina.LifecycleListener)

Brett Okken | MMF Archive | Software Architect | 816.201.6112 | www.cerner.com 
| bok...@cerner.com


----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be unlawful. If you are not the 
addressee, please promptly delete this message and notify the sender of the 
delivery error by e-mail or you may call Cerner's corporate offices in Kansas 
City, Missouri, U.S.A at (+1) (816)221-1024.

Reply via email to