INNER CODE UNIT · Java
loadProperties
spring-cloud/spring-cloud-zookeeper · spring-cloud-zookeeper-core/src/main/java/org/springframework/cloud/zookeeper/CuratorFactory.java:129
static ZookeeperProperties loadProperties(Binder binder, UriComponents location) {
ZookeeperProperties properties = binder.bind(ZookeeperProperties.PREFIX, Bindable.of(ZookeeperProperties.class))
.orElse(new ZookeeperProperties());
if (location != null && StringUtils.hasText(location.getHost())) {
if (location.getPort() < 0) {
throw new IllegalArgumentException(
"zookeeper port must be greater than or equal to zero: " + location.getPort());
}
properties.setConnectString(location.getHost() + ":" + location.getPort());
}
return properties;
}
private static CuratorFramework curatorFramework(BootstrapContext context, ZookeeperProperties properties,
boolean optional) {