diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java b/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java index 6d3ec6c6..a21dd8bd 100644 --- a/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java +++ b/example/src/main/java/com/github/dynamic/threadpool/example/config/ThreadPoolConfig.java @@ -1,9 +1,9 @@ package com.github.dynamic.threadpool.example.config; import com.github.dynamic.threadpool.starter.core.DynamicThreadPool; -import com.github.dynamic.threadpool.starter.toolkit.thread.CustomThreadPoolExecutor; +import com.github.dynamic.threadpool.starter.core.DynamicThreadPoolExecutor; import com.github.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; +import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -23,26 +23,26 @@ import static com.github.dynamic.threadpool.example.constant.GlobalTestConstant. public class ThreadPoolConfig { /** - * {@link DynamicThreadPoolWrap} 完成 Server 端订阅配置功能. + * {@link DynamicThreadPoolWrapper} 完成 Server 端订阅配置功能. * * @return */ @Bean - public DynamicThreadPoolWrap messageCenterConsumeThreadPool() { - return new DynamicThreadPoolWrap(MESSAGE_CONSUME); + public DynamicThreadPoolWrapper messageCenterDynamicThreadPool() { + return new DynamicThreadPoolWrapper(MESSAGE_CONSUME); } /** - * 通过 {@link DynamicThreadPool} 修饰 {@link CustomThreadPoolExecutor} 完成 Server 端订阅配置功能. + * 通过 {@link DynamicThreadPool} 修饰 {@link DynamicThreadPoolExecutor} 完成 Server 端订阅配置功能. *
- * 由动态线程池注解修饰后, IOC 容器中保存的是 {@link CustomThreadPoolExecutor} + * 由动态线程池注解修饰后, IOC 容器中保存的是 {@link DynamicThreadPoolExecutor} * * @return */ @Bean @DynamicThreadPool - public ThreadPoolExecutor customThreadPoolExecutor() { - return ThreadPoolBuilder.builder().threadFactory(MESSAGE_PRODUCE).isCustomPool(true).build(); + public ThreadPoolExecutor dynamicThreadPoolExecutor() { + return ThreadPoolBuilder.builder().threadFactory(MESSAGE_PRODUCE).dynamicPool().build(); } } diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java b/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java index 73243045..eb4918fb 100644 --- a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java +++ b/example/src/main/java/com/github/dynamic/threadpool/example/inittest/AlarmSendMessageTest.java @@ -2,7 +2,7 @@ package com.github.dynamic.threadpool.example.inittest; import cn.hutool.core.thread.ThreadUtil; import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; +import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -28,8 +28,8 @@ public class AlarmSendMessageTest { public void alarmSendMessageTest() { ScheduledExecutorService scheduledThreadPool = Executors.newSingleThreadScheduledExecutor(); scheduledThreadPool.scheduleWithFixedDelay(() -> { - DynamicThreadPoolWrap executorService = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); - ThreadPoolExecutor poolExecutor = executorService.getPool(); + DynamicThreadPoolWrapper poolWrapper = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); + ThreadPoolExecutor poolExecutor = poolWrapper.getPool(); try { poolExecutor.execute(() -> ThreadUtil.sleep(10240124)); } catch (Exception ex) { diff --git a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java b/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java index 85d49c9b..31867c5d 100644 --- a/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java +++ b/example/src/main/java/com/github/dynamic/threadpool/example/inittest/RunStateHandlerTest.java @@ -1,7 +1,7 @@ package com.github.dynamic.threadpool.example.inittest; import com.github.dynamic.threadpool.starter.core.GlobalThreadPoolManage; -import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; +import com.github.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -30,8 +30,8 @@ public class RunStateHandlerTest { ScheduledExecutorService scheduledThreadPool = Executors.newSingleThreadScheduledExecutor(); scheduledThreadPool.scheduleAtFixedRate(() -> { - DynamicThreadPoolWrap executorService = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); - ThreadPoolExecutor pool = executorService.getPool(); + DynamicThreadPoolWrapper poolWrapper = GlobalThreadPoolManage.getExecutorService(MESSAGE_PRODUCE); + ThreadPoolExecutor pool = poolWrapper.getPool(); try { pool.execute(() -> { log.info("Thread pool name :: {}, Executing incoming blocking...", Thread.currentThread().getName());