Author: kfujino Date: Fri Apr 4 02:27:14 2014 New Revision: 1584505 URL: http://svn.apache.org/r1584505 Log: Simplify the code of o.a.c.ha.tcp.SimpleTcpCluster. In order to add or remove cluster valve to Container, use pipeline instead of IntrospectionUtils.
Modified: tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java?rev=1584505&r1=1584504&r2=1584505&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java (original) +++ tomcat/trunk/java/org/apache/catalina/ha/tcp/SimpleTcpCluster.java Fri Apr 4 02:27:14 2014 @@ -56,7 +56,6 @@ import org.apache.catalina.tribes.group. import org.apache.catalina.util.LifecycleMBeanBase; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.IntrospectionUtils; import org.apache.tomcat.util.res.StringManager; /** @@ -571,10 +570,8 @@ public class SimpleTcpCluster extends Li /** * register all cluster valve to host or engine - * @throws Exception - * @throws ClassNotFoundException */ - protected void registerClusterValve() throws Exception { + protected void registerClusterValve() { if(container != null ) { for (Iterator<Valve> iter = valves.iterator(); iter.hasNext();) { ClusterValve valve = (ClusterValve) iter.next(); @@ -582,10 +579,7 @@ public class SimpleTcpCluster extends Li log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { - IntrospectionUtils.callMethodN(getContainer(), "addValve", - new Object[] { valve }, - new Class[] { org.apache.catalina.Valve.class }); - + container.getPipeline().addValve(valve); valve.setCluster(this); } } @@ -594,19 +588,15 @@ public class SimpleTcpCluster extends Li /** * unregister all cluster valve to host or engine - * @throws Exception - * @throws ClassNotFoundException */ - protected void unregisterClusterValve() throws Exception { + protected void unregisterClusterValve() { for (Iterator<Valve> iter = valves.iterator(); iter.hasNext();) { ClusterValve valve = (ClusterValve) iter.next(); if (log.isDebugEnabled()) log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { - IntrospectionUtils.callMethodN(getContainer(), "removeValve", - new Object[] { valve }, - new Class[] { org.apache.catalina.Valve.class }); + container.getPipeline().removeValve(valve); valve.setCluster(this); } } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1584505&r1=1584504&r2=1584505&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Fri Apr 4 02:27:14 2014 @@ -115,6 +115,11 @@ <code>org.apache.catalina.ha.session.BackupManager</code> and <code>org.apache.catalina.ha.session.DeltaManager</code>. (kfujino) </scode> + <scode> + Simplify the code of <code>o.a.c.ha.tcp.SimpleTcpCluster</code>. In + order to add or remove cluster valve to Container, use pipeline instead + of <code>IntrospectionUtils</code>. (kfujino) + </scode> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org