If the class implements both interfaces then call addApplicationLifecycleListener...
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 27 Apr 2010 09:01:37 +0000 (09:01 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 27 Apr 2010 09:01:37 +0000 (09:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@938363 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/ApplicationContext.java

index 4d7518d..5a86c48 100644 (file)
@@ -1266,13 +1266,9 @@ public class ApplicationContext
             match = true;
         }
         
-        if (t instanceof HttpSessionListener) {
-            context.addApplicationLifecycleListener(t);
-            match = true;
-        }
-        
-        if (t instanceof ServletContextListener) {
-            // TODO SERVLET3 - also need to check caller? spec isn't clear
+        if (t instanceof HttpSessionListener
+                || t instanceof ServletContextListener) {
+            // TODO SERVLET3 - if ServletContextListener then also need to check caller? spec isn't clear
             context.addApplicationLifecycleListener(t);
             match = true;
         }