|
|
@ -100,11 +100,19 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool
|
|
|
|
* @param bindableCoreProperties
|
|
|
|
* @param bindableCoreProperties
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void refreshWebExecutor(BootstrapCoreProperties bindableCoreProperties) {
|
|
|
|
private void refreshWebExecutor(BootstrapCoreProperties bindableCoreProperties) {
|
|
|
|
WebThreadPoolHandlerChoose webThreadPoolHandlerChoose = ApplicationContextHolder.getBean(WebThreadPoolHandlerChoose.class);
|
|
|
|
boolean isNullFlag = bindableCoreProperties.getJetty() == null
|
|
|
|
WebThreadPoolService webThreadPoolService = webThreadPoolHandlerChoose.choose();
|
|
|
|
|| bindableCoreProperties.getUndertow() == null
|
|
|
|
|
|
|
|
|| bindableCoreProperties.getTomcat() == null;
|
|
|
|
|
|
|
|
if (isNullFlag) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
PoolParameterInfo nowParameter = buildWebPoolParameter(bindableCoreProperties);
|
|
|
|
PoolParameterInfo nowParameter = buildWebPoolParameter(bindableCoreProperties);
|
|
|
|
if (nowParameter != null) {
|
|
|
|
if (nowParameter != null) {
|
|
|
|
|
|
|
|
WebThreadPoolHandlerChoose webThreadPoolHandlerChoose = ApplicationContextHolder.getBean(WebThreadPoolHandlerChoose.class);
|
|
|
|
|
|
|
|
WebThreadPoolService webThreadPoolService = webThreadPoolHandlerChoose.choose();
|
|
|
|
|
|
|
|
|
|
|
|
PoolParameter beforeParameter = webThreadPoolService.getWebThreadPoolParameter();
|
|
|
|
PoolParameter beforeParameter = webThreadPoolService.getWebThreadPoolParameter();
|
|
|
|
if (!Objects.equals(beforeParameter.getCoreSize(), nowParameter.getCoreSize())
|
|
|
|
if (!Objects.equals(beforeParameter.getCoreSize(), nowParameter.getCoreSize())
|
|
|
|
|| !Objects.equals(beforeParameter.getMaxSize(), nowParameter.getMaxSize())
|
|
|
|
|| !Objects.equals(beforeParameter.getMaxSize(), nowParameter.getMaxSize())
|
|
|
@ -112,6 +120,9 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool
|
|
|
|
webThreadPoolService.updateWebThreadPool(nowParameter);
|
|
|
|
webThreadPoolService.updateWebThreadPool(nowParameter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
log.error("Failed to modify web thread pool.", ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|