@EnableAsync
@Configuration
public class GlobalThreadPoolConfig
extends java.lang.Object
implements org.springframework.scheduling.annotation.AsyncConfigurer
| 构造器和说明 |
|---|
GlobalThreadPoolConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.util.concurrent.ExecutorService |
getAsyncExecutor() |
java.util.concurrent.ThreadPoolExecutor |
getAsyncThreadPoolExecutor() |
void |
threadInfo() |
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
threadPoolTaskExecutor() |
@Bean(value="threadPoolExecutor") public java.util.concurrent.ThreadPoolExecutor getAsyncThreadPoolExecutor()
public java.util.concurrent.ExecutorService getAsyncExecutor()
getAsyncExecutor 在接口中 org.springframework.scheduling.annotation.AsyncConfigurer@Bean(name="threadPoolTaskExecutor") public org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPoolTaskExecutor()
@Scheduled(fixedRate=30L,
timeUnit=SECONDS)
public void threadInfo()