Author: markt Date: Thu Feb 4 23:22:24 2010 New Revision: 906727 URL: http://svn.apache.org/viewvc?rev=906727&view=rev Log: Remove the Pipeline interface from ContainerBase Access valves via getPipeline() rather than directly on ContainerBase
Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java tomcat/trunk/java/org/apache/catalina/core/StandardHost.java tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=906727&r1=906726&r2=906727&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Thu Feb 4 23:22:24 2010 @@ -122,7 +122,7 @@ */ public abstract class ContainerBase - implements Container, Lifecycle, Pipeline, MBeanRegistration { + implements Container, Lifecycle, MBeanRegistration { private static final org.apache.juli.logging.Log log= org.apache.juli.logging.LogFactory.getLog( ContainerBase.class ); @@ -1195,13 +1195,12 @@ /** - * Add a new Valve to the end of the pipeline associated with this - * Container. Prior to adding the Valve, the Valve's - * <code>setContainer</code> method must be called, with this Container - * as an argument. The method may throw an - * <code>IllegalArgumentException</code> if this Valve chooses not to - * be associated with this Container, or <code>IllegalStateException</code> - * if it is already associated with a different Container. + * Convenience method, intended for use by the digester to simplify the + * process of adding Valves to containers. See + * {...@link Pipeline#addValve(Valve)} for full details. Components other than + * the digester should use {...@link #getPipeline()#addValve(Valve)} in case a + * future implementation provides an alternative method for the digester to + * use. * * @param valve Valve to be added * @@ -1220,69 +1219,6 @@ public ObjectName[] getValveObjectNames() { return ((StandardPipeline)pipeline).getValveObjectNames(); } - - /** - * <p>Return the Valve instance that has been distinguished as the basic - * Valve for this Pipeline (if any). - */ - public Valve getBasic() { - - return (pipeline.getBasic()); - - } - - - /** - * Return the first valve in the pipeline. - */ - public Valve getFirst() { - - return (pipeline.getFirst()); - - } - - - /** - * Return the set of Valves in the pipeline associated with this - * Container, including the basic Valve (if any). If there are no - * such Valves, a zero-length array is returned. - */ - public Valve[] getValves() { - - return (pipeline.getValves()); - - } - - - /** - * Remove the specified Valve from the pipeline associated with this - * Container, if it is found; otherwise, do nothing. - * - * @param valve Valve to be removed - */ - public synchronized void removeValve(Valve valve) { - - pipeline.removeValve(valve); - } - - - /** - * <p>Set the Valve instance that has been distinguished as the basic - * Valve for this Pipeline (if any). Prior to setting the basic Valve, - * the Valve's <code>setContainer()</code> will be called, if it - * implements <code>Contained</code>, with the owning Container as an - * argument. The method may throw an <code>IllegalArgumentException</code> - * if this Valve chooses not to be associated with this Container, or - * <code>IllegalStateException</code> if it is already associated with - * a different Container.</p> - * - * @param valve Valve to be distinguished as the basic Valve - */ - public void setBasic(Valve valve) { - - pipeline.setBasic(valve); - - } /** @@ -1612,13 +1548,4 @@ } - - @Override - public boolean isAsyncSupported() { - return pipeline.isAsyncSupported(); - } - - - - } Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=906727&r1=906726&r2=906727&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Thu Feb 4 23:22:24 2010 @@ -752,7 +752,7 @@ if(!found) { Valve valve = (Valve) Class.forName(errorReportValveClass) .newInstance(); - addValve(valve); + getPipeline().addValve(valve); errorReportValveObjectName = ((ValveBase)valve).getObjectName() ; } } catch (Throwable t) { Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java?rev=906727&r1=906726&r2=906727&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java (original) +++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanFactory.java Thu Feb 4 23:22:24 2010 @@ -248,7 +248,7 @@ AccessLogValve accessLogger = new AccessLogValve(); ContainerBase containerBase = getParentContainerFromParent(pname); // Add the new instance to its parent component - containerBase.addValve(accessLogger); + containerBase.getPipeline().addValve(accessLogger); ObjectName oname = accessLogger.getObjectName(); return (oname.toString()); @@ -481,7 +481,7 @@ // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); - containerBase.addValve(valve); + containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); @@ -504,7 +504,7 @@ // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); - containerBase.addValve(valve); + containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); @@ -527,7 +527,7 @@ // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); - containerBase.addValve(valve); + containerBase.getPipeline().addValve(valve); ObjectName oname = valve.getObjectName(); return (oname.toString()); @@ -961,7 +961,7 @@ for (int i = 0; i < valves.length; i++) { ObjectName voname = ((ValveBase) valves[i]).getObjectName(); if (voname.equals(oname)) { - container.removeValve(valves[i]); + container.getPipeline().removeValve(valves[i]); } } } Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=906727&r1=906726&r2=906727&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Thu Feb 4 23:22:24 2010 @@ -421,7 +421,7 @@ if (authenticator != null && context instanceof ContainerBase) { Pipeline pipeline = ((ContainerBase) context).getPipeline(); if (pipeline != null) { - ((ContainerBase) context).addValve(authenticator); + ((ContainerBase) context).getPipeline().addValve(authenticator); if (log.isDebugEnabled()) { log.debug(sm.getString( "contextConfig.authenticatorConfigured", --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org