use of com.alipay.sofa.rpc.server.triple.TripleServer in project sofa-boot by alipay.
the class ServerConfigContainer method startServers.
/**
* 开启所有 ServerConfig 对应的 Server
*/
public void startServers() {
if (boltServerConfig != null) {
boltServerConfig.buildIfAbsent().start();
BoltServer server = (BoltServer) boltServerConfig.getServer();
ThreadPoolExecutor threadPoolExecutor = server.getBizThreadPool();
if (threadPoolExecutor != null) {
boltThreadPoolMonitor.setThreadPoolExecutor(threadPoolExecutor);
boltThreadPoolMonitor.start();
} else {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("the business threadpool can not be get");
}
}
}
if (restServerConfig != null) {
restServerConfig.buildIfAbsent().start();
}
if (h2cServerConfig != null) {
h2cServerConfig.buildIfAbsent().start();
}
if (httpServerConfig != null) {
httpServerConfig.buildIfAbsent().start();
// 加入线程监测?
}
if (tripleServerConfig != null) {
tripleServerConfig.buildIfAbsent().start();
TripleServer tripleServer = (TripleServer) tripleServerConfig.getServer();
ThreadPoolExecutor threadPoolExecutor = tripleServer.getBizThreadPool();
if (threadPoolExecutor != null) {
tripleThreadPoolMonitor.setThreadPoolExecutor(threadPoolExecutor);
tripleThreadPoolMonitor.start();
} else {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("the business threadpool can not be get");
}
}
}
for (Map.Entry<String, ServerConfig> entry : customServerConfigs.entrySet()) {
final ServerConfig serverConfig = entry.getValue();
if (serverConfig != null) {
serverConfig.buildIfAbsent().start();
}
}
startCustomThreadPoolMonitor();
}
use of com.alipay.sofa.rpc.server.triple.TripleServer in project sofa-boot by sofastack.
the class ServerConfigContainer method startServers.
/**
* 开启所有 ServerConfig 对应的 Server
*/
public void startServers() {
if (boltServerConfig != null) {
boltServerConfig.buildIfAbsent().start();
BoltServer server = (BoltServer) boltServerConfig.getServer();
ThreadPoolExecutor threadPoolExecutor = server.getBizThreadPool();
if (threadPoolExecutor != null) {
boltThreadPoolMonitor.setThreadPoolExecutor(threadPoolExecutor);
boltThreadPoolMonitor.start();
} else {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("the business threadpool can not be get");
}
}
}
if (restServerConfig != null) {
restServerConfig.buildIfAbsent().start();
}
if (h2cServerConfig != null) {
h2cServerConfig.buildIfAbsent().start();
}
if (httpServerConfig != null) {
httpServerConfig.buildIfAbsent().start();
// 加入线程监测?
}
if (tripleServerConfig != null) {
tripleServerConfig.buildIfAbsent().start();
TripleServer tripleServer = (TripleServer) tripleServerConfig.getServer();
ThreadPoolExecutor threadPoolExecutor = tripleServer.getBizThreadPool();
if (threadPoolExecutor != null) {
tripleThreadPoolMonitor.setThreadPoolExecutor(threadPoolExecutor);
tripleThreadPoolMonitor.start();
} else {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("the business threadpool can not be get");
}
}
}
for (Map.Entry<String, ServerConfig> entry : customServerConfigs.entrySet()) {
final ServerConfig serverConfig = entry.getValue();
if (serverConfig != null) {
serverConfig.buildIfAbsent().start();
}
}
startCustomThreadPoolMonitor();
}
Aggregations