Author: markt Date: Wed Dec 8 13:37:11 2010 New Revision: 1043410 URL: http://svn.apache.org/viewvc?rev=1043410&view=rev Log: Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360 Align the init() methods (JSSE still to go)
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java tomcat/trunk/java/org/apache/coyote/ajp/Constants.java tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Wed Dec 8 13:37:11 2010 @@ -66,9 +66,11 @@ public class AjpAprProtocol extends Abst public AjpAprProtocol() { endpoint = new AprEndpoint(); cHandler = new AjpConnectionHandler(this); + ((AprEndpoint) endpoint).setHandler(cHandler); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); + setUseSendfile(Constants.DEFAULT_USE_SENDFILE); } @@ -89,8 +91,6 @@ public class AjpAprProtocol extends Abst @Override public void init() throws Exception { endpoint.setName(getName()); - ((AprEndpoint)endpoint).setHandler(cHandler); - ((AprEndpoint)endpoint).setUseSendfile(false); try { endpoint.init(); Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java Wed Dec 8 13:37:11 2010 @@ -67,6 +67,7 @@ public class AjpProtocol extends Abstrac public AjpProtocol() { endpoint = new JIoEndpoint(); cHandler = new AjpConnectionHandler(this); + ((JIoEndpoint) endpoint).setHandler(cHandler); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); @@ -90,7 +91,6 @@ public class AjpProtocol extends Abstrac @Override public void init() throws Exception { endpoint.setName(getName()); - ((JIoEndpoint)endpoint).setHandler(cHandler); try { endpoint.init(); Modified: tomcat/trunk/java/org/apache/coyote/ajp/Constants.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/Constants.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/ajp/Constants.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/Constants.java Wed Dec 8 13:37:11 2010 @@ -42,6 +42,7 @@ public final class Constants { public static final int DEFAULT_CONNECTION_TIMEOUT = -1; public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000; public static final boolean DEFAULT_TCP_NO_DELAY = true; + public static final boolean DEFAULT_USE_SENDFILE = false; // Prefix codes for message types from server to container public static final byte JK_AJP13_FORWARD_REQUEST = 2; Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Wed Dec 8 13:37:11 2010 @@ -72,6 +72,7 @@ public class Http11AprProtocol extends A public Http11AprProtocol() { endpoint = new AprEndpoint(); cHandler = new Http11ConnectionHandler(this); + ((AprEndpoint) endpoint).setHandler(cHandler); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); @@ -83,7 +84,6 @@ public class Http11AprProtocol extends A @Override public void init() throws Exception { endpoint.setName(getName()); - ((AprEndpoint)endpoint).setHandler(cHandler); try { endpoint.init(); @@ -123,7 +123,7 @@ public class Http11AprProtocol extends A log.info(sm.getString("http11protocol.start", getName())); } - private Http11ConnectionHandler cHandler; + private final Http11ConnectionHandler cHandler; public boolean getUseSendfile() { return ((AprEndpoint)endpoint).getUseSendfile(); } public void setUseSendfile(boolean useSendfile) { ((AprEndpoint)endpoint).setUseSendfile(useSendfile); } Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Wed Dec 8 13:37:11 2010 @@ -68,7 +68,8 @@ public class Http11NioProtocol extends A public Http11NioProtocol() { endpoint=new NioEndpoint(); - cHandler = new Http11ConnectionHandler( this ); + cHandler = new Http11ConnectionHandler(this); + ((NioEndpoint) endpoint).setHandler(cHandler); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); @@ -86,7 +87,6 @@ public class Http11NioProtocol extends A @Override public void init() throws Exception { endpoint.setName(getName()); - ((NioEndpoint)endpoint).setHandler(cHandler); try { endpoint.init(); Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1043410&r1=1043409&r2=1043410&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Wed Dec 8 13:37:11 2010 @@ -72,6 +72,7 @@ public class Http11Protocol extends Abst public Http11Protocol() { endpoint = new JIoEndpoint(); cHandler = new Http11ConnectionHandler(this); + ((JIoEndpoint) endpoint).setHandler(cHandler); setSoLinger(Constants.DEFAULT_CONNECTION_LINGER); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY); @@ -91,8 +92,7 @@ public class Http11Protocol extends Abst @Override public void init() throws Exception { - ((JIoEndpoint)endpoint).setName(getName()); - ((JIoEndpoint)endpoint).setHandler(cHandler); + endpoint.setName(getName()); // Verify the validity of the configured socket factory try { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org