唐耀东
2021-12-09 eeeddf0836a5a5aa03a3342d34318c7202313e93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.ruoyi.framework.config.properties;
 
import com.ruoyi.common.enums.ThreadPoolRejectedPolicy;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * 线程池 配置属性
 *
 * @author Lion Li
 */
@Data
@Component
@ConfigurationProperties(prefix = "thread-pool")
public class ThreadPoolProperties {
 
    /**
     * 是否开启线程池
     */
    private boolean enabled;
 
    /**
     * 核心线程池大小
     */
    private int corePoolSize;
 
    /**
     * 最大可创建的线程数
     */
    private int maxPoolSize;
 
    /**
     * 队列最大长度
     */
    private int queueCapacity;
 
    /**
     * 线程池维护线程所允许的空闲时间
     */
    private int keepAliveSeconds;
 
    /**
     * 线程池对拒绝任务(无线程可用)的处理策略
     */
    private ThreadPoolRejectedPolicy rejectedExecutionHandler;
 
}