Java 类org.springframework.boot.context.embedded.AbstractConfigurableEmbeddedServletContainer 实例源码

项目:haven-platform    文件:DataProvider.java   
private String getAddress(String predefinedAddress, AbstractConfigurableEmbeddedServletContainer container) {
    String proto = (container.getSsl() == null)? "http://" : "https://";
    if(StringUtils.hasText(predefinedAddress)) {
        String hostPort = AddressUtils.getHostPort(predefinedAddress);
        return proto + hostPort;
    } else {
        int port = container.getPort();
        // server must have way to fix invalid host if it need
        String host = "localhost";
        return proto + host + ":" + port;
    }
}
项目:haven-platform    文件:DataProvider.java   
@Autowired
public DataProvider(NotifierProps config, AbstractConfigurableEmbeddedServletContainer container) {
    this.collector = new InfoCollector(config.getRootPath());
    this.address = getAddress(config.getAddress(), container);
    this.hostName = OSUtils.getHostName();
}