From: markt Date: Sat, 6 Mar 2010 09:26:33 +0000 (+0000) Subject: Fix some inconsistencies identified during lifecycle refactoring for valves X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ea6874c3364c14129c2111ffc9715b3473a04d4c;p=tomcat7.0 Fix some inconsistencies identified during lifecycle refactoring for valves - don't start a basic valve when adding it to the pipeline if the pipeline is not started - if pipeline is started when adding a basic valve, register the basic valve git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@919722 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardPipeline.java b/java/org/apache/catalina/core/StandardPipeline.java index 2584db10d..bfe71126c 100644 --- a/java/org/apache/catalina/core/StandardPipeline.java +++ b/java/org/apache/catalina/core/StandardPipeline.java @@ -326,13 +326,15 @@ public class StandardPipeline extends LifecycleBase if (valve instanceof Contained) { ((Contained) valve).setContainer(this.container); } - if (valve instanceof Lifecycle) { + if (getState().isAvailable() && valve instanceof Lifecycle) { try { ((Lifecycle) valve).start(); } catch (LifecycleException e) { log.error("StandardPipeline.setBasic: start", e); return; } + // Register the newly added valve + registerValve(valve); } // Update the pipeline