--- java/org/apache/tomcat/util/net/AprEndpoint.java (revision 821397) +++ java/org/apache/tomcat/util/net/AprEndpoint.java (working copy) @@ -36,7 +36,6 @@ import org.apache.tomcat.jni.SSLSocket; import org.apache.tomcat.jni.Socket; import org.apache.tomcat.jni.Status; -import org.apache.tomcat.util.net.JIoEndpoint.Worker; import org.apache.tomcat.util.res.StringManager; /** @@ -188,7 +187,13 @@ } } } - public int getMaxThreads() { return maxThreads; } + public int getMaxThreads() { + if (executor != null) { + return -1; + } else { + return maxThreads; + } + } /** @@ -539,7 +544,7 @@ * @return the amount of threads that are managed by the pool */ public int getCurrentThreadCount() { - if (executor!=null) { + if (executor != null) { return -1; } else { return curThreads; --- java/org/apache/tomcat/util/net/JIoEndpoint.java (revision 821397) +++ java/org/apache/tomcat/util/net/JIoEndpoint.java (working copy) @@ -160,7 +160,13 @@ } } } - public int getMaxThreads() { return maxThreads; } + public int getMaxThreads() { + if (executor != null) { + return -1; + } else { + return maxThreads; + } + } /** --- java/org/apache/tomcat/util/net/NioEndpoint.java (revision 821397) +++ java/org/apache/tomcat/util/net/NioEndpoint.java (working copy) @@ -57,7 +57,6 @@ import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.IntrospectionUtils; -import org.apache.tomcat.util.net.JIoEndpoint.Worker; import org.apache.tomcat.util.net.SecureNioChannel.ApplicationBufferHandler; import org.apache.tomcat.util.net.jsse.NioX509KeyManager; import org.apache.tomcat.util.res.StringManager; @@ -371,7 +370,17 @@ } } } - public int getMaxThreads() { return maxThreads; } + public int getMaxThreads() { + if (running && getUseExecutor() && executor!=null) { + if (executor instanceof ThreadPoolExecutor) { + return ((ThreadPoolExecutor)executor).getMaximumPoolSize(); + } else { + return -1; + } + } else { + return maxThreads; + } + } /**