|
|
@ -123,12 +123,21 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh
|
|
|
|
* @param parameter
|
|
|
|
* @param parameter
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void changePoolInfo(ThreadPoolExecutor executor, PoolParameter parameter) {
|
|
|
|
public void changePoolInfo(ThreadPoolExecutor executor, PoolParameter parameter) {
|
|
|
|
if (parameter.getCoreSize() != null) {
|
|
|
|
if (parameter.getCoreSize() != null && parameter.getMaxSize() != null) {
|
|
|
|
executor.setCorePoolSize(parameter.getCoreSize());
|
|
|
|
if (parameter.getMaxSize() < executor.getMaximumPoolSize()) {
|
|
|
|
}
|
|
|
|
executor.setCorePoolSize(parameter.getCoreSize());
|
|
|
|
|
|
|
|
executor.setMaximumPoolSize(parameter.getMaxSize());
|
|
|
|
if (parameter.getMaxSize() != null) {
|
|
|
|
} else {
|
|
|
|
executor.setMaximumPoolSize(parameter.getMaxSize());
|
|
|
|
executor.setMaximumPoolSize(parameter.getMaxSize());
|
|
|
|
|
|
|
|
executor.setCorePoolSize(parameter.getCoreSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (parameter.getMaxSize() != null) {
|
|
|
|
|
|
|
|
executor.setMaximumPoolSize(parameter.getMaxSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parameter.getCoreSize() != null) {
|
|
|
|
|
|
|
|
executor.setCorePoolSize(parameter.getCoreSize());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (parameter.getCapacity() != null
|
|
|
|
if (parameter.getCapacity() != null
|
|
|
|