From 0910ba6797af5f086a277387d0d9277e94a6b458 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 5 Jun 2011 13:16:02 +0000 Subject: [PATCH] Pull up the request and response objects since they are common between AJP and HTTP git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1132397 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/AbstractProcessor.java | 33 ++++++++++++++++++++-- .../apache/coyote/ajp/AbstractAjpProcessor.java | 22 --------------- .../coyote/http11/AbstractHttp11Processor.java | 23 --------------- 3 files changed, 31 insertions(+), 47 deletions(-) diff --git a/java/org/apache/coyote/AbstractProcessor.java b/java/org/apache/coyote/AbstractProcessor.java index 7cc47f341..54b136d7f 100644 --- a/java/org/apache/coyote/AbstractProcessor.java +++ b/java/org/apache/coyote/AbstractProcessor.java @@ -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(); diff --git a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java index ea3306bc8..480ddfbae 100644 --- a/java/org/apache/coyote/ajp/AbstractAjpProcessor.java +++ b/java/org/apache/coyote/ajp/AbstractAjpProcessor.java @@ -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. * diff --git a/java/org/apache/coyote/http11/AbstractHttp11Processor.java b/java/org/apache/coyote/http11/AbstractHttp11Processor.java index b4f96cc5d..cc02488d8 100644 --- a/java/org/apache/coyote/http11/AbstractHttp11Processor.java +++ b/java/org/apache/coyote/http11/AbstractHttp11Processor.java @@ -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. * -- 2.11.0