Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 15:43:52 +0000 (15:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 15:43:52 +0000 (15:43 +0000)
Pull up more getters/setters.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1042681 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/AbstractProtocolHandler.java
java/org/apache/coyote/ajp/AbstractAjpProtocol.java
java/org/apache/coyote/http11/AbstractHttp11Protocol.java

index 0b361bb..c3484c6 100644 (file)
@@ -16,6 +16,7 @@
  */
 package org.apache.coyote;
 
+import java.net.InetAddress;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.concurrent.Executor;
@@ -145,6 +146,19 @@ public abstract class AbstractProtocolHandler implements ProtocolHandler,
     public Adapter getAdapter() { return adapter; }
 
 
+    /**
+     * The maximum number of idle processors that will be retained in the cache
+     * and re-used with a subsequent request. The default is -1, unlimited,
+     * although in that case there will never be more Processor objects than
+     * there are threads in the associated thread pool.
+     */
+    protected int processorCache = -1;
+    public int getProcessorCache() { return this.processorCache; }
+    public void setProcessorCache(int processorCache) {
+        this.processorCache = processorCache;
+    }
+
+
     // ---------------------- Properties that are passed through to the EndPoint
 
     @Override
@@ -190,11 +204,16 @@ public abstract class AbstractProtocolHandler implements ProtocolHandler,
     public void setSoLinger(int soLinger) { endpoint.setSoLinger(soLinger); }
 
 
-    // ------------------------ Properties that are made available as attributes
-    // -------------------------------------(and passed through to the EndPoint)
+    // ---------------------- Properties that are passed through to the EndPoint
+    // ------------------------------------ and are made available as attributes
+
+    public InetAddress getAddress() { return endpoint.getAddress(); }
+    public void setAddress(InetAddress ia) {
+        endpoint.setAddress( ia );
+        setAttribute("address", "" + ia);
+    }
+
 
-    
-    
     // -------------------------------------------------------- Abstract methods
     /**
      * Concrete implementations need to provide access to their logger to be
index 0eb07fd..a5e212e 100644 (file)
@@ -16,7 +16,6 @@
  */
 package org.apache.coyote.ajp;
 
-import java.net.InetAddress;
 import java.net.URLEncoder;
 
 import javax.management.MBeanServer;
@@ -91,17 +90,6 @@ public abstract class AbstractAjpProtocol extends AbstractProtocolHandler {
         return ("ajp-" + encodedAddr + endpoint.getPort());
     }
 
-    /**
-     * Processor cache.
-     */
-    protected int processorCache = -1;
-    public int getProcessorCache() { return this.processorCache; }
-    public void setProcessorCache(int processorCache) { this.processorCache = processorCache; }
-
-
-    public InetAddress getAddress() { return endpoint.getAddress(); }
-    public void setAddress(InetAddress ia) { endpoint.setAddress(ia); }
-
     public int getSoTimeout() { return endpoint.getSoTimeout(); }
     public void setSoTimeout(int soTimeout) { endpoint.setSoTimeout(soTimeout); }
 
index 4f6f91f..3c1c438 100644 (file)
@@ -16,7 +16,6 @@
  */
 package org.apache.coyote.http11;
 
-import java.net.InetAddress;
 import java.net.URLEncoder;
 
 import javax.management.MBeanServer;
@@ -36,12 +35,6 @@ public abstract class AbstractHttp11Protocol extends AbstractProtocolHandler {
     protected SSLImplementation sslImplementation = null;
     
     
-    public InetAddress getAddress() { return endpoint.getAddress(); }
-    public void setAddress(InetAddress ia) {
-        endpoint.setAddress( ia );
-        setAttribute("address", "" + ia);
-    }
-    
     public String getName() {
         String encodedAddr = "";
         if (getAddress() != null) {
@@ -115,12 +108,6 @@ public abstract class AbstractHttp11Protocol extends AbstractProtocolHandler {
         setAttribute("secure", "" + b);
     }
     
-    /**
-     * Processor cache.
-     */
-    private int processorCache;
-    public int getProcessorCache() { return this.processorCache; }
-    public void setProcessorCache(int processorCache) { this.processorCache = processorCache; }
 
     private int socketBuffer = 9000;
     public int getSocketBuffer() { return socketBuffer; }