Java Code Examples for org.springframework.cloud.commons.util.InetUtils#findFirstNonLoopbackHostInfo()
The following examples show how to use
org.springframework.cloud.commons.util.InetUtils#findFirstNonLoopbackHostInfo() .
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: ZookeeperDiscoveryProperties.java From spring-cloud-zookeeper with Apache License 2.0 | 4 votes |
public ZookeeperDiscoveryProperties(InetUtils inetUtils) { this.hostInfo = inetUtils.findFirstNonLoopbackHostInfo(); this.instanceHost = this.hostInfo.getHostname(); this.instanceIpAddress = this.hostInfo.getIpAddress(); }
Example 2
Source File: ConsulDiscoveryProperties.java From spring-cloud-consul with Apache License 2.0 | 4 votes |
public ConsulDiscoveryProperties(InetUtils inetUtils) { this(); this.hostInfo = inetUtils.findFirstNonLoopbackHostInfo(); this.ipAddress = this.hostInfo.getIpAddress(); this.hostname = this.hostInfo.getHostname(); }