Pull up the request and response objects since they are common between AJP and HTTP
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 5 Jun 2011 13:16:02 +0000 (13:16 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 5 Jun 2011 13:16:02 +0000 (13:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1132397 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/AbstractProcessor.java
java/org/apache/coyote/ajp/AbstractAjpProcessor.java
java/org/apache/coyote/http11/AbstractHttp11Processor.java

index 7cc47f3..54b136d 100644 (file)
@@ -20,14 +20,43 @@ import java.util.concurrent.Executor;
 
 import org.apache.tomcat.util.net.AbstractEndpoint;
 
+/**
+ * Provides attributes common to all support protocols (currently HTTP and AJP).
+ * TODO: There are more attributes that can be pulled up
+ */
 public abstract class AbstractProcessor implements ActionHook, Processor {
 
+    /**
+     * The endpoint receiving connections that are handled by this processor.
+     */
     protected AbstractEndpoint endpoint;
-    
     protected AbstractEndpoint getEndpoint() {
         return endpoint;
     }
-    
+
+
+    /**
+     * The request associated with this processor.
+     */
+    protected Request request = null;
+    public Request getRequest() {
+        return request;
+    }
+
+
+    /**
+     * The response associated with this processor.
+     */
+    protected Response response = null;
+
+
+    /*
+     * Expose selected endpoint attributes through the processor
+     */
+
+    /**
+     * Obtain the Executor used by the underlying endpoint.
+     */
     @Override
     public Executor getExecutor() {
         return endpoint.getExecutor();
index ea3306b..480ddfb 100644 (file)
@@ -32,7 +32,6 @@ import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.AsyncStateMachine;
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Request;
-import org.apache.coyote.Response;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.buf.ByteChunk;
 import org.apache.tomcat.util.buf.HexUtils;
@@ -66,18 +65,6 @@ public abstract class AbstractAjpProcessor extends AbstractProcessor {
 
 
     /**
-     * Request object.
-     */
-    protected Request request = null;
-
-
-    /**
-     * Response object.
-     */
-    protected Response response = null;
-
-
-    /**
      * AJP packet size.
      */
     protected int packetSize;
@@ -223,15 +210,6 @@ public abstract class AbstractAjpProcessor extends AbstractProcessor {
     // --------------------------------------------------------- Public Methods
 
 
-    /** Get the request associated with this processor.
-    *
-    * @return The request
-    */
-   public Request getRequest() {
-       return request;
-   }
-   
-   
    /**
     * Send an action to the connector.
     *
index b4f96cc..cc02488 100644 (file)
@@ -26,8 +26,6 @@ import org.apache.coyote.ActionCode;
 import org.apache.coyote.Adapter;
 import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.AsyncStateMachine;
-import org.apache.coyote.Request;
-import org.apache.coyote.Response;
 import org.apache.coyote.http11.filters.BufferedInputFilter;
 import org.apache.coyote.http11.filters.ChunkedInputFilter;
 import org.apache.coyote.http11.filters.ChunkedOutputFilter;
@@ -71,18 +69,6 @@ public abstract class AbstractHttp11Processor extends AbstractProcessor {
 
 
     /**
-     * Request object.
-     */
-    protected Request request = null;
-
-
-    /**
-     * Response object.
-     */
-    protected Response response = null;
-
-
-    /**
      * Error flag.
      */
     protected boolean error = false;
@@ -507,15 +493,6 @@ public abstract class AbstractHttp11Processor extends AbstractProcessor {
     }
 
 
-    /** Get the request associated with this processor.
-     *
-     * @return The request
-     */
-    public Request getRequest() {
-        return request;
-    }
-
-
     /**
      * Set the associated adapter.
      *