tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1137335 - in /tomcat/trunk/java/org/apache/coyote/ajp: AbstractAjpProcessor.java AjpAprProcessor.java AjpNioProcessor.java AjpProcessor.java
Date Sun, 19 Jun 2011 10:53:01 GMT
Author: markt
Date: Sun Jun 19 10:53:00 2011
New Revision: 1137335

URL: http://svn.apache.org/viewvc?rev=1137335&view=rev
Log:
Start to pull up common code from constructors

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1137335&r1=1137334&r2=1137335&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Sun Jun 19 10:53:00
2011
@@ -34,6 +34,7 @@ import org.apache.coyote.AsyncStateMachi
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
+import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -41,6 +42,7 @@ import org.apache.tomcat.util.buf.HexUti
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.HttpMessages;
 import org.apache.tomcat.util.http.MimeHeaders;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -219,6 +221,24 @@ public abstract class AbstractAjpProcess
     protected long byteCount = 0;
     
     
+    // ------------------------------------------------------------ Constructor
+    
+    public AbstractAjpProcessor(int packetSize, AbstractEndpoint endpoint) {
+        this.packetSize = packetSize;
+        this.endpoint = endpoint;
+
+        request = new Request();
+        request.setInputBuffer(new SocketInputBuffer());
+        
+        response = new Response();
+        request.setResponse(response);
+
+        requestHeaderMessage = new AjpMessage(packetSize);
+        responseHeaderMessage = new AjpMessage(packetSize);
+        bodyMessage = new AjpMessage(packetSize);
+    }
+
+    
     // ------------------------------------------------------------- Properties
 
 

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1137335&r1=1137334&r2=1137335&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Sun Jun 19 10:53:00 2011
@@ -23,7 +23,6 @@ import java.nio.ByteBuffer;
 
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.OutputBuffer;
-import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
@@ -69,20 +68,10 @@ public class AjpAprProcessor extends Abs
 
     public AjpAprProcessor(int packetSize, AprEndpoint endpoint) {
 
-        this.endpoint = endpoint;
+        super(packetSize, endpoint);
 
-        request = new Request();
-        request.setInputBuffer(new SocketInputBuffer());
-
-        response = new Response();
         response.setHook(this);
         response.setOutputBuffer(new SocketOutputBuffer());
-        request.setResponse(response);
-
-        this.packetSize = packetSize;
-        requestHeaderMessage = new AjpMessage(packetSize);
-        responseHeaderMessage = new AjpMessage(packetSize);
-        bodyMessage = new AjpMessage(packetSize);
 
         // Set the get body message buffer
         AjpMessage getBodyMessage = new AjpMessage(16);

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java?rev=1137335&r1=1137334&r2=1137335&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProcessor.java Sun Jun 19 10:53:00 2011
@@ -25,7 +25,6 @@ import java.nio.channels.Selector;
 
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.OutputBuffer;
-import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
@@ -62,23 +61,13 @@ public class AjpNioProcessor extends Abs
 
     public AjpNioProcessor(int packetSize, NioEndpoint endpoint) {
 
-        this.endpoint = endpoint;
+        super(packetSize, endpoint);
 
-        request = new Request();
-        request.setInputBuffer(new SocketInputBuffer());
-
-        response = new Response();
         response.setHook(this);
         response.setOutputBuffer(new SocketOutputBuffer());
-        request.setResponse(response);
 
         pool = endpoint.getSelectorPool();
 
-        this.packetSize = packetSize;
-        requestHeaderMessage = new AjpMessage(packetSize);
-        responseHeaderMessage = new AjpMessage(packetSize);
-        bodyMessage = new AjpMessage(packetSize);
-
         // Set the get body message buffer
         AjpMessage getBodyMessage = new AjpMessage(16);
         getBodyMessage.reset();

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=1137335&r1=1137334&r2=1137335&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Sun Jun 19 10:53:00 2011
@@ -25,7 +25,6 @@ import java.net.Socket;
 
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.OutputBuffer;
-import org.apache.coyote.Request;
 import org.apache.coyote.RequestInfo;
 import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
@@ -68,20 +67,10 @@ public class AjpProcessor extends Abstra
 
     public AjpProcessor(int packetSize, JIoEndpoint endpoint) {
 
-        this.endpoint = endpoint;
+        super(packetSize, endpoint);
 
-        request = new Request();
-        request.setInputBuffer(new SocketInputBuffer());
-
-        response = new Response();
         response.setHook(this);
         response.setOutputBuffer(new SocketOutputBuffer());
-        request.setResponse(response);
-
-        this.packetSize = packetSize;
-        requestHeaderMessage = new AjpMessage(packetSize);
-        responseHeaderMessage = new AjpMessage(packetSize);
-        bodyMessage = new AjpMessage(packetSize);
 
         // Set the get body message buffer
         AjpMessage getBodyMessage = new AjpMessage(16);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message