Class ThreadPoolConfig

java.lang.Object
cn.sinozg.applet.common.config.ThreadPoolConfig
All Implemented Interfaces:
org.springframework.scheduling.annotation.AsyncConfigurer

@EnableAsync @Configuration public class ThreadPoolConfig extends Object implements org.springframework.scheduling.annotation.AsyncConfigurer
线程池配置 包装注解@Async 支持异步获取信息
  • Constructor Details

    • ThreadPoolConfig

      public ThreadPoolConfig()
  • Method Details

    • getAsyncExecutor

      public Executor getAsyncExecutor()
      配置注解@Async的
      Specified by:
      getAsyncExecutor in interface org.springframework.scheduling.annotation.AsyncConfigurer
      Returns:
      线程池
    • getAsyncUncaughtExceptionHandler

      public org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler()
      Specified by:
      getAsyncUncaughtExceptionHandler in interface org.springframework.scheduling.annotation.AsyncConfigurer
    • scheduledExecutorService

      @Bean(name="scheduledExecutorService") protected ScheduledExecutorService scheduledExecutorService()
      执行周期性或定时任务
      Returns:
      线程池