Prevent spurious log warnings on container stop if a child component has previously...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 5 Aug 2011 16:31:41 +0000 (16:31 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 5 Aug 2011 16:31:41 +0000 (16:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1154298 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/ContainerBase.java
java/org/apache/catalina/core/StandardContext.java
webapps/docs/changelog.xml

index 96fe008..4a736a6 100644 (file)
@@ -1062,7 +1062,8 @@ public abstract class ContainerBase extends LifecycleMBeanBase
         setState(LifecycleState.STOPPING);
 
         // Stop the Valves in our pipeline (including the basic), if any
-        if (pipeline instanceof Lifecycle) {
+        if (pipeline instanceof Lifecycle &&
+                ((Lifecycle) pipeline).getState().isAvailable()) {
             ((Lifecycle) pipeline).stop();
         }
 
@@ -1082,7 +1083,8 @@ public abstract class ContainerBase extends LifecycleMBeanBase
         if ((cluster != null) && (cluster instanceof Lifecycle)) {
             ((Lifecycle) cluster).stop();
         }
-        if ((manager != null) && (manager instanceof Lifecycle)) {
+        if ((manager != null) && (manager instanceof Lifecycle) &&
+                ((Lifecycle) manager).getState().isAvailable() ) {
             ((Lifecycle) manager).stop();
         }
         if ((logger != null) && (logger instanceof Lifecycle)) {
index 41f0617..b2e8cd3 100644 (file)
@@ -5459,7 +5459,8 @@ public class StandardContext extends ContainerBase
                         // Stop ContainerBackgroundProcessor thread
                         threadStop();
             
-                        if (manager != null && manager instanceof Lifecycle) {
+                        if (manager != null && manager instanceof Lifecycle &&
+                                ((Lifecycle) manager).getState().isAvailable()) {
                             try {
                                 ((Lifecycle) manager).stop();
                             } catch (LifecycleException e) {
@@ -5507,7 +5508,8 @@ public class StandardContext extends ContainerBase
             fireLifecycleEvent(Lifecycle.CONFIGURE_STOP_EVENT, null);
 
             // Stop the Valves in our pipeline (including the basic), if any
-            if (pipeline instanceof Lifecycle) {
+            if (pipeline instanceof Lifecycle &&
+                    ((Lifecycle) pipeline).getState().isAvailable()) {
                 ((Lifecycle) pipeline).stop();
             }
 
index 1ced493..2e52495 100644 (file)
         <bug>51614</bug>: Avoid calling store.load() and  session.expire()
         twice in PersistentManager when expiring sessions. (kfujino)
       </fix>
+      <fix>
+        Prevent spurious log warnings on container stop if a child component has
+        previously failed. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">