allow skip bind telnet port or http port. fix #284

This commit is contained in:
hengyunabc 2018-11-07 17:31:50 +08:00
parent 34a4a8a829
commit 326cd2fe9a

View File

@ -85,10 +85,18 @@ public class ArthasBootstrap {
List<CommandResolver> resolvers = new ArrayList<CommandResolver>();
resolvers.add(builtinCommands);
// TODO: discover user provided command resolver
shellServer.registerTermServer(new TelnetTermServer(
configure.getIp(), configure.getTelnetPort(), options.getConnectionTimeout()));
shellServer.registerTermServer(new HttpTermServer(
configure.getIp(), configure.getHttpPort(), options.getConnectionTimeout()));
if (configure.getTelnetPort() > 0) {
shellServer.registerTermServer(new TelnetTermServer(configure.getIp(), configure.getTelnetPort(),
options.getConnectionTimeout()));
} else {
logger.info("telnet port is {}, skip bind telnet server.", configure.getTelnetPort());
}
if (configure.getHttpPort() > 0) {
shellServer.registerTermServer(new HttpTermServer(configure.getIp(), configure.getHttpPort(),
options.getConnectionTimeout()));
} else {
logger.info("http port is {}, skip bind http server.", configure.getHttpPort());
}
for (CommandResolver resolver : resolvers) {
shellServer.registerCommandResolver(resolver);