解决冲突

This commit is contained in:
pengjie 2024-03-26 19:06:41 +08:00
parent df00ae4958
commit 7047dd7a74
3 changed files with 330 additions and 332 deletions

View File

@ -810,7 +810,7 @@
<dependency> <dependency>
<groupId>org.example</groupId> <groupId>org.example</groupId>
<artifactId>wflow-server1</artifactId> <artifactId>wflow-server</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar</systemPath> <systemPath>${basedir}/src/main/resources/lib/wflow-server-1.0-SNAPSHOT.jar</systemPath>

View File

@ -1,331 +1,329 @@
//package com.zhgd.xmgl.config; package com.zhgd.xmgl.config;
//
//import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//
//import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
//
///** /**
// * @program: wisdomSite * @program: wisdomSite
// * @description: 线程池配置 * @description: 线程池配置
// * @author: Mr.Peng * @author: Mr.Peng
// * @create: 2021-02-23 10:04 * @create: 2021-02-23 10:04
// **/ **/
//@Configuration @Configuration
//public class AsyncConfig { public class AsyncConfig {
// /** /**
// * Set the ThreadPoolExecutor's core pool size. * Set the ThreadPoolExecutor's core pool size.
// */ */
// private int corePoolSize = 8; private int corePoolSize = 8;
// /** /**
// * Set the ThreadPoolExecutor's maximum pool size. * Set the ThreadPoolExecutor's maximum pool size.
// */ */
// private int maxPoolSize = 16; private int maxPoolSize = 16;
// /** /**
// * Set the capacity for the ThreadPoolExecutor's BlockingQueue. * Set the capacity for the ThreadPoolExecutor's BlockingQueue.
// */ */
// private int queueCapacity = 200; private int queueCapacity = 200;
//
// /** /**
// * 默认情况下在创建了线程池后线程池中的线程数为0当有任务来之后就会创建一个线程去执行任务 * 默认情况下在创建了线程池后线程池中的线程数为0当有任务来之后就会创建一个线程去执行任务
// * 当线程池中的线程数目达到corePoolSize后就会把到达的任务放到缓存队列当中 * 当线程池中的线程数目达到corePoolSize后就会把到达的任务放到缓存队列当中
// * 当队列满了就继续创建线程当线程数量大于等于maxPoolSize后开始使用拒绝策略拒绝 * 当队列满了就继续创建线程当线程数量大于等于maxPoolSize后开始使用拒绝策略拒绝
// */ */
//
// @Primary @Primary
// @Bean("taskExecutor") @Bean("taskExecutor")
// public ThreadPoolTaskExecutor taskExecutor() { public ThreadPoolTaskExecutor taskExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// /** 核心线程数(默认线程数) */ /** 核心线程数(默认线程数) */
// executor.setCorePoolSize(corePoolSize); executor.setCorePoolSize(corePoolSize);
// /** 最大线程数 */ /** 最大线程数 */
// executor.setMaxPoolSize(maxPoolSize); executor.setMaxPoolSize(maxPoolSize);
// executor.setQueueCapacity(queueCapacity); executor.setQueueCapacity(queueCapacity);
// /** 允许线程空闲时间(单位:默认为秒) */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setKeepAliveSeconds(60); executor.setKeepAliveSeconds(60);
// /** 线程池名前缀 */ /** 线程池名前缀 */
// executor.setThreadNamePrefix("taskExecutor-"); executor.setThreadNamePrefix("taskExecutor-");
// // 线程池对拒绝任务的处理策略 // 线程池对拒绝任务的处理策略
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// // 初始化 // 初始化
// executor.initialize(); executor.initialize();
// return executor; return executor;
// } }
//
// /** /**
// * 默认情况下在创建了线程池后线程池中的线程数为0当有任务来之后就会创建一个线程去执行任务 * 默认情况下在创建了线程池后线程池中的线程数为0当有任务来之后就会创建一个线程去执行任务
// * 当线程池中的线程数目达到corePoolSize后就会把到达的任务放到缓存队列当中 * 当线程池中的线程数目达到corePoolSize后就会把到达的任务放到缓存队列当中
// * 当队列满了就继续创建线程当线程数量大于等于maxPoolSize后开始使用拒绝策略拒绝 * 当队列满了就继续创建线程当线程数量大于等于maxPoolSize后开始使用拒绝策略拒绝
// */ */
//
// @Primary @Bean("doubleCarbonExecutor")
// @Bean("doubleCarbonExecutor") public ThreadPoolTaskExecutor doubleCarbonExecutor() {
// public ThreadPoolTaskExecutor doubleCarbonExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 核心线程数(默认线程数) */
// /** 核心线程数(默认线程数) */ executor.setCorePoolSize(corePoolSize);
// executor.setCorePoolSize(corePoolSize); /** 最大线程数 */
// /** 最大线程数 */ executor.setMaxPoolSize(maxPoolSize);
// executor.setMaxPoolSize(maxPoolSize); executor.setQueueCapacity(queueCapacity);
// executor.setQueueCapacity(queueCapacity); /** 允许线程空闲时间(单位:默认为秒) */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setKeepAliveSeconds(60);
// executor.setKeepAliveSeconds(60); /** 线程池名前缀 */
// /** 线程池名前缀 */ executor.setThreadNamePrefix("doubleCarbonExecutor-");
// executor.setThreadNamePrefix("doubleCarbonExecutor-"); // 线程池对拒绝任务的处理策略
// // 线程池对拒绝任务的处理策略 executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); // 初始化
// // 初始化 executor.initialize();
// executor.initialize(); return executor;
// return executor; }
// }
// @Bean("countAttendanceExecutor")
// @Primary public ThreadPoolTaskExecutor attendanceExecutor() {
// @Bean("countAttendanceExecutor") ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// public ThreadPoolTaskExecutor attendanceExecutor() { /** 核心线程数(默认线程数) */
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(corePoolSize);
// /** 核心线程数(默认线程数) */ /** 最大线程数 */
// executor.setCorePoolSize(corePoolSize); executor.setMaxPoolSize(maxPoolSize);
// /** 最大线程数 */ executor.setQueueCapacity(queueCapacity);
// executor.setMaxPoolSize(maxPoolSize); /** 允许线程空闲时间(单位:默认为秒) */
// executor.setQueueCapacity(queueCapacity); executor.setKeepAliveSeconds(60);
// /** 允许线程空闲时间(单位:默认为秒) */ /** 线程池名前缀 */
// executor.setKeepAliveSeconds(60); executor.setThreadNamePrefix("countAttendanceExecutor-");
// /** 线程池名前缀 */ // 线程池对拒绝任务的处理策略
// executor.setThreadNamePrefix("countAttendanceExecutor-"); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// // 线程池对拒绝任务的处理策略 // 初始化
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); executor.initialize();
// // 初始化 return executor;
// executor.initialize(); }
// return executor;
// } @Bean("sendAttendanceExecutor")
// public ThreadPoolTaskExecutor sendAttendanceExecutor() {
// @Primary ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("sendAttendanceExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendAttendanceExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("sendAttendanceExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("sendAttendanceExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("sendWorkerExecutor")
// } public ThreadPoolTaskExecutor sendWorkerExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("sendWorkerExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendWorkerExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("sendWorkerExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("sendWorkerExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("sendExitWorkerExecutor")
// } public ThreadPoolTaskExecutor sendExitWorkerExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("sendExitWorkerExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendExitWorkerExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("sendExitWorkerExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("sendExitWorkerExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("environmentNoiseDataExecutor")
// } public ThreadPoolTaskExecutor sendEnvironmentNoiseDataExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("environmentNoiseDataExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendEnvironmentNoiseDataExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("environmentNoiseDataExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("environmentNoiseDataExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("electricalExecutor")
// } public ThreadPoolTaskExecutor sendElectricalExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("electricalExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendElectricalExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("electricalExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("electricalExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("towerExecutor")
// } public ThreadPoolTaskExecutor sendTowerExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("towerExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendTowerExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("towerExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("towerExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("lifterExecutor")
// } public ThreadPoolTaskExecutor sendLifterExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("lifterExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendLifterExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("lifterExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("lifterExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("devExcavationExecutor")
// } public ThreadPoolTaskExecutor sendDevExcavationEExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("devExcavationExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendDevExcavationEExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("devExcavationExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("devExcavationExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("gantryCraneExecutor")
// } public ThreadPoolTaskExecutor sendGantryCraneExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("gantryCraneExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor sendGantryCraneExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("gantryCraneExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("gantryCraneExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("fileExecutor")
// } public ThreadPoolTaskExecutor fileExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("fileExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor fileExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("fileExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("fileExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Bean("asyncExecutor")
// } public ThreadPoolTaskExecutor asyncExecutor() {
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// @Bean("asyncExecutor") /** 核心线程数(默认线程数) */
// public ThreadPoolTaskExecutor asyncExecutor() { executor.setCorePoolSize(corePoolSize);
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); /** 最大线程数 */
// /** 核心线程数(默认线程数) */ executor.setMaxPoolSize(maxPoolSize);
// executor.setCorePoolSize(corePoolSize); executor.setQueueCapacity(queueCapacity);
// /** 最大线程数 */ /** 允许线程空闲时间(单位:默认为秒) */
// executor.setMaxPoolSize(maxPoolSize); executor.setKeepAliveSeconds(60);
// executor.setQueueCapacity(queueCapacity); /** 线程池名前缀 */
// /** 允许线程空闲时间(单位:默认为秒) */ executor.setThreadNamePrefix("asyncExecutor-");
// executor.setKeepAliveSeconds(60); // 线程池对拒绝任务的处理策略
// /** 线程池名前缀 */ executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// executor.setThreadNamePrefix("asyncExecutor-"); // 初始化
// // 线程池对拒绝任务的处理策略 executor.initialize();
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); return executor;
// // 初始化 }
// executor.initialize();
// return executor; @Primary
// } @Bean("bimExecutor")
// public ThreadPoolTaskExecutor bimExecutor() {
// @Bean("bimExecutor") ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// public ThreadPoolTaskExecutor bimExecutor() { /** 核心线程数(默认线程数) */
// ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(corePoolSize);
// /** 核心线程数(默认线程数) */ /** 最大线程数 */
// executor.setCorePoolSize(corePoolSize); executor.setMaxPoolSize(maxPoolSize);
// /** 最大线程数 */ executor.setQueueCapacity(2000);
// executor.setMaxPoolSize(maxPoolSize); /** 允许线程空闲时间(单位:默认为秒) */
// executor.setQueueCapacity(2000); executor.setKeepAliveSeconds(60);
// /** 允许线程空闲时间(单位:默认为秒) */ /** 线程池名前缀 */
// executor.setKeepAliveSeconds(60); executor.setThreadNamePrefix("bimExecutor-");
// /** 线程池名前缀 */ // 线程池对拒绝任务的处理策略
// executor.setThreadNamePrefix("bimExecutor-"); executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// // 线程池对拒绝任务的处理策略 // 初始化
// executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); executor.initialize();
// // 初始化 return executor;
// executor.initialize(); }
// return executor; }
// }
//}