From: markt IllegalStateException
* if it is already associated with a different Container.
Implementation note: Implementations are expected to trigger the + * {@link Container#ADD_VALVE_EVENT} for the associated container if this + * call is successful.
+ * * @param valve Valve to be added * * @exception IllegalArgumentException if this Container refused to @@ -106,6 +110,10 @@ public interface Pipeline { * found and removed, the Valve'ssetContainer(null) method
* will be called if it implements Contained.
*
+ * Implementation note: Implementations are expected to trigger the + * {@link Container#REMOVE_VALVE_EVENT} for the associated container if this + * call is successful.
+ * * @param valve Valve to be removed */ public void removeValve(Valve valve); @@ -124,4 +132,17 @@ public interface Pipeline { public boolean isAsyncSupported(); + /** + * Return the Container with which this Pipeline is associated. + */ + public Container getContainer(); + + + /** + * Set the Container with which this Pipeline is associated. + * + * @param container The new associated container + */ + public void setContainer(Container container); + } diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index ccab2ace5..3a5b0b292 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -36,6 +36,7 @@ import javax.management.ObjectName; import javax.naming.directory.DirContext; import javax.servlet.ServletException; +import org.apache.catalina.CatalinaFactory; import org.apache.catalina.Cluster; import org.apache.catalina.Container; import org.apache.catalina.ContainerEvent; @@ -229,7 +230,8 @@ public abstract class ContainerBase /** * The Pipeline object with which this Container is associated. */ - protected Pipeline pipeline = new StandardPipeline(this); + protected Pipeline pipeline = + CatalinaFactory.getFactory().createPipeline(this); /** @@ -1216,10 +1218,6 @@ public abstract class ContainerBase pipeline.addValve(valve); } - public ObjectName[] getValveObjectNames() { - return ((StandardPipeline)pipeline).getValveObjectNames(); - } - /** * Execute a periodic task, such as reloading, etc. This method will be diff --git a/java/org/apache/catalina/core/StandardHost.java b/java/org/apache/catalina/core/StandardHost.java index 20e6ecb32..a343e6ed1 100644 --- a/java/org/apache/catalina/core/StandardHost.java +++ b/java/org/apache/catalina/core/StandardHost.java @@ -128,11 +128,6 @@ public class StandardHost "org.apache.catalina.valves.ErrorReportValve"; /** - * The object name for the errorReportValve. - */ - private ObjectName errorReportValveObjectName = null; - - /** * The descriptive information string for this implementation. */ private static final String info = @@ -742,19 +737,19 @@ public class StandardHost && (!errorReportValveClass.equals(""))) { try { boolean found = false; - if(errorReportValveObjectName != null) { - ObjectName[] names = - ((StandardPipeline)pipeline).getValveObjectNames(); - for (int i=0; !found && i