-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathConfigProperties.java
138 lines (108 loc) · 3.18 KB
/
ConfigProperties.java
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package site.yuyanjia.template.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 配置资源
*
* @author seer
* @date 2018/7/24 14:38
*/
@ConfigurationProperties(value = ConfigProperties.PREFIX)
public class ConfigProperties {
public static final String PREFIX = "yuyanjia";
private Tomcat tomcat;
public Tomcat getTomcat() {
return tomcat;
}
public void setTomcat(Tomcat tomcat) {
this.tomcat = tomcat;
}
/**
* Tomcat配置文件
*
* @author seer
* @date 2018/7/24 14:45
*/
public static class Tomcat {
/**
* 连接超时,单位ms
*/
private Integer connectionTimeout = 20000;
/**
* 接收连接线程数量,参考cpu核数
*/
private Integer acceptorThreadCount = 2;
/**
* 最小监听线程
*/
private Integer minSpareThreads = 5;
/**
* 最大监听线程
* 同时相应客户请求最大值
*/
private Integer maxSpareThreads = 200;
/**
* 最大排队数
*/
private Integer acceptCount = 200;
/**
* 最大连接数
*/
private Integer maxConnections = 800;
/**
* 最大线程数
*/
private Integer maxThreads = 500;
/**
* 运行模式
*/
private String protocol = "org.apache.coyote.http11.Http11NioProtocol";
public Integer getConnectionTimeout() {
return connectionTimeout;
}
public void setConnectionTimeout(Integer connectionTimeout) {
this.connectionTimeout = connectionTimeout;
}
public Integer getAcceptorThreadCount() {
return acceptorThreadCount;
}
public void setAcceptorThreadCount(Integer acceptorThreadCount) {
this.acceptorThreadCount = acceptorThreadCount;
}
public Integer getMinSpareThreads() {
return minSpareThreads;
}
public void setMinSpareThreads(Integer minSpareThreads) {
this.minSpareThreads = minSpareThreads;
}
public Integer getMaxSpareThreads() {
return maxSpareThreads;
}
public void setMaxSpareThreads(Integer maxSpareThreads) {
this.maxSpareThreads = maxSpareThreads;
}
public Integer getAcceptCount() {
return acceptCount;
}
public void setAcceptCount(Integer acceptCount) {
this.acceptCount = acceptCount;
}
public Integer getMaxConnections() {
return maxConnections;
}
public void setMaxConnections(Integer maxConnections) {
this.maxConnections = maxConnections;
}
public Integer getMaxThreads() {
return maxThreads;
}
public void setMaxThreads(Integer maxThreads) {
this.maxThreads = maxThreads;
}
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}
}