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
+ * Provides functionality and attributes common to all supported protocols
+ * (currently HTTP and AJP).
*/
public abstract class AbstractProcessor implements ActionHook, Processor {
+ protected AbstractEndpoint endpoint;
+ protected Request request = null;
+ protected Response response = null;
+
+
+ public AbstractProcessor(AbstractEndpoint endpoint) {
+ this.endpoint = endpoint;
+ }
+
/**
* 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
*/
// ------------------------------------------------------------ Constructor
public AbstractAjpProcessor(int packetSize, AbstractEndpoint endpoint) {
+
+ super(endpoint);
+
this.packetSize = packetSize;
- this.endpoint = endpoint;
request = new Request();
request.setInputBuffer(new SocketInputBuffer());
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.FastHttpDateFormat;
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.res.StringManager;
protected AsyncStateMachine asyncStateMachine = new AsyncStateMachine(this);
+ public AbstractHttp11Processor(AbstractEndpoint endpoint) {
+ super(endpoint);
+ }
+
+
/**
* Set compression level.
*/
public Http11AprProcessor(int headerBufferSize, AprEndpoint endpoint,
int maxTrailerSize) {
- this.endpoint = endpoint;
+ super(endpoint);
request = new Request();
inputBuffer = new InternalAprInputBuffer(request, headerBufferSize);
public Http11NioProcessor(int maxHttpHeaderSize, NioEndpoint endpoint,
int maxTrailerSize) {
- this.endpoint = endpoint;
+ super(endpoint);
request = new Request();
inputBuffer = new InternalNioInputBuffer(request, maxHttpHeaderSize);
public Http11Processor(int headerBufferSize, JIoEndpoint endpoint,
int maxTrailerSize) {
- this.endpoint = endpoint;
+ super(endpoint);
request = new Request();
inputBuffer = new InternalInputBuffer(request, headerBufferSize);