use of org.apache.skywalking.apm.collector.server.ServerException in project incubator-skywalking by apache.
the class GRPCManagerServiceImpl method createOrChooseServer.
private GRPCServer createOrChooseServer(String host, int port, GRPCServer newServer) throws ServerCanNotBeCreatedException {
String id = host + String.valueOf(port);
GRPCServer existServer = servers.get(id);
if (existServer != null) {
if (existServer.isStatusEqual(newServer)) {
return existServer;
} else {
throw new ServerCanNotBeCreatedException("Can't create server with same port but different setting. SSL setting must equal too.");
}
} else {
try {
newServer.initialize();
} catch (ServerException e) {
logger.error(e.getMessage(), e);
}
servers.put(id, newServer);
return newServer;
}
}
use of org.apache.skywalking.apm.collector.server.ServerException in project incubator-skywalking by apache.
the class JettyManagerServiceImpl method createIfAbsent.
@Override
public JettyServer createIfAbsent(String host, int port, String contextPath) {
String id = host + String.valueOf(port);
if (servers.containsKey(id)) {
return servers.get(id);
} else {
JettyServer server = new JettyServer(host, port, contextPath);
try {
server.initialize();
} catch (ServerException e) {
logger.error(e.getMessage(), e);
}
servers.put(id, server);
return server;
}
}
Aggregations