Java Code Examples for org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory#setAddress()

The following examples show how to use org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory#setAddress() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomizationWebServerBean.java    From wind-im with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(ConfigurableServletWebServerFactory server) {
	String adminAddress = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_ADDRESS);
	String adminPort = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_PORT);

	// set admin port
	if (StringUtils.isNumeric(adminPort)) {
		server.setPort(Integer.valueOf(adminPort));
	} else {
		server.setPort(8288);
	}

	// set admin address
	if (StringUtils.isNotEmpty(adminAddress)) {
		try {
			InetAddress address = InetAddress.getByName(adminAddress);
			server.setAddress(address);
		} catch (UnknownHostException e) {
		}
	}
	server.setContextPath("/akaxin");
}
 
Example 2
Source File: CustomizationWebServerBean.java    From openzaly with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(ConfigurableServletWebServerFactory server) {
	String adminAddress = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_ADDRESS);
	String adminPort = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_PORT);

	// set admin port
	if (StringUtils.isNumeric(adminPort)) {
		server.setPort(Integer.valueOf(adminPort));
	} else {
		server.setPort(8288);
	}

	// set admin address
	if (StringUtils.isNotEmpty(adminAddress)) {
		try {
			InetAddress address = InetAddress.getByName(adminAddress);
			server.setAddress(address);
		} catch (UnknownHostException e) {
		}
	}
	server.setContextPath("/akaxin");
}
 
Example 3
Source File: CustomizationWebServerBean.java    From openzaly with Apache License 2.0 6 votes vote down vote up
@Override
public void customize(ConfigurableServletWebServerFactory server) {
	String adminAddress = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_ADDRESS);
	String adminPort = ConfigHelper.getStringConfig(ConfigKey.SITE_ADMIN_PORT);

	// set admin port
	if (StringUtils.isNumeric(adminPort)) {
		server.setPort(Integer.valueOf(adminPort));
	} else {
		server.setPort(8288);
	}

	// set admin address
	if (StringUtils.isNotEmpty(adminAddress)) {
		try {
			InetAddress address = InetAddress.getByName(adminAddress);
			server.setAddress(address);
		} catch (UnknownHostException e) {
		}
	}
	server.setContextPath("/akaxin");
}
 
Example 4
Source File: WebServerFactoryListenCustomizer.java    From Cleanstone with MIT License 4 votes vote down vote up
@Override
public void customize(ConfigurableServletWebServerFactory factory) {
    factory.setPort(webConfig.getServer().getPort());
    factory.setAddress(webConfig.getServer().getAddress());
}