|
|
|
@ -123,13 +123,22 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh
|
|
|
|
|
* @param parameter
|
|
|
|
|
*/
|
|
|
|
|
public void changePoolInfo(ThreadPoolExecutor executor, PoolParameter parameter) {
|
|
|
|
|
if (parameter.getCoreSize() != null) {
|
|
|
|
|
if (parameter.getCoreSize() != null&¶meter.getMaxSize() !=null) {
|
|
|
|
|
if (parameter.getMaxSize() < executor.getMaximumPoolSize()) {
|
|
|
|
|
executor.setCorePoolSize(parameter.getCoreSize());
|
|
|
|
|
executor.setMaximumPoolSize(parameter.getMaxSize());
|
|
|
|
|
} else {
|
|
|
|
|
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
|
|
|
|
|
&& Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.type, parameter.getQueueType())) {
|
|
|
|
|