public class ThreadTaskExecutor extends Object implements org.springframework.beans.factory.InitializingBean
异步处理线程管理类
| 限定符和类型 | 字段和说明 |
|---|---|
private int |
corePoolSize
初始线程数
|
private boolean |
daemon
是否后台线程
|
private int |
keepAliveSeconds
线程存储时间,单位:s
|
private static org.apache.log4j.Logger |
logger |
private int |
maxPoolSize
最大线程数
|
private org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
threadPool
Spring线程池
|
| 构造器和说明 |
|---|
ThreadTaskExecutor() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
int |
getCorePoolSize() |
int |
getKeepAliveSeconds() |
int |
getMaxPoolSize() |
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor |
getThreadPool()
获取线程池对象
|
boolean |
isDaemon() |
void |
setCorePoolSize(int corePoolSize) |
void |
setDaemon(boolean daemon) |
void |
setKeepAliveSeconds(int keepAliveSeconds) |
void |
setMaxPoolSize(int maxPoolSize) |
void |
setThreadPool(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPool) |
private static final org.apache.log4j.Logger logger
private org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPool
private int corePoolSize
private int maxPoolSize
private boolean daemon
private int keepAliveSeconds
public void afterPropertiesSet()
throws Exception
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanExceptionpublic org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor getThreadPool()
public void setThreadPool(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor threadPool)
public int getCorePoolSize()
public void setCorePoolSize(int corePoolSize)
public int getMaxPoolSize()
public void setMaxPoolSize(int maxPoolSize)
public boolean isDaemon()
public void setDaemon(boolean daemon)
public int getKeepAliveSeconds()
public void setKeepAliveSeconds(int keepAliveSeconds)
Copyright © 2020. All rights reserved.