Correctly report maxThreads
Note 6.0.x will need a different fix as it still uses threadpools
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@815486
13f79535-47bb-0310-9956-
ffa450edef68
}
}
}
- public int getMaxThreads() { return maxThreads; }
+ public int getMaxThreads() {
+ if (running && executor!=null) {
+ if (executor instanceof java.util.concurrent.ThreadPoolExecutor) {
+ return ((java.util.concurrent.ThreadPoolExecutor)executor).getMaximumPoolSize();
+ } else if (executor instanceof ResizableExecutor) {
+ return ((ResizableExecutor)executor).getMaxThreads();
+ } else {
+ return -1;
+ }
+ } else {
+ return maxThreads;
+ }
+ }
/**
* Max keep alive requests
*/
public int getPoolSize();
+ public int getMaxThreads();
+
/**
* {@link java.util.concurrent.ThreadPoolExecutor#getActiveCount()}
* @return {@link java.util.concurrent.ThreadPoolExecutor#getActiveCount()}