org.zodiac.autoconfigure.bootstrap.discovery.simple.SimpleAppDiscoveryProperties Maven / Gradle / Ivy
package org.zodiac.autoconfigure.bootstrap.discovery.simple;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.zodiac.commons.constants.SystemPropertiesConstants;
import org.zodiac.core.bootstrap.discovery.simple.SimpleAppDiscoveryInfo;
@ConfigurationProperties(prefix = SystemPropertiesConstants.Zodiac.SPRING_BOOTSTRAP_DISCOVERY_SIMPLE_PREFIX)
public class SimpleAppDiscoveryProperties extends SimpleAppDiscoveryInfo implements InitializingBean {
public SimpleAppDiscoveryProperties() {
super();
}
@Override
public void afterPropertiesSet() throws Exception {
init();
}
protected void init() {
this.getRemote().forEach((key, instances) -> {
instances.forEach(instance -> instance.setAppServiceId(key));
});
}
}