#535 修复Tomcat 不能正常关闭的问题,增加线程池shutdown相关的操作

This commit is contained in:
gtyang
2018-04-16 10:17:23 +08:00
committed by Binary Wang
parent a0240e7847
commit 558f4e7880
2 changed files with 39 additions and 0 deletions

View File

@@ -75,6 +75,29 @@ public class WxMpMessageRouter {
this.exceptionHandler = new LogExceptionHandler();
}
/**
* <pre>
* 使用自定义的 {@link ExecutorService}
* </pre>
*/
public WxMpMessageRouter(WxMpService wxMpService, ExecutorService executorService) {
this.wxMpService = wxMpService;
this.executorService = executorService;
this.messageDuplicateChecker = new WxMessageInMemoryDuplicateChecker();
this.sessionManager = new StandardSessionManager();
this.exceptionHandler = new LogExceptionHandler();
}
/**
* <pre>
* 如果使用默认的 {@link ExecutorService},则系统退出前,应该调用该方法。
* </pre>
*/
public void shutDownExecutorService() {
this.executorService.shutdown();
}
/**
* <pre>
* 设置自定义的 {@link ExecutorService}