INNER CODE UNIT · Java
retryPolicy
spring-cloud/spring-cloud-zookeeper · spring-cloud-zookeeper-core/src/main/java/org/springframework/cloud/zookeeper/CuratorFactory.java:83
public static RetryPolicy retryPolicy(ZookeeperProperties properties) {
return new ExponentialBackoffRetry(properties.getBaseSleepTimeMs(), properties.getMaxRetries(),
properties.getMaxSleepMs());
}
public static void registerCurator(BootstrapRegistry registery, UriComponents location, boolean optional) {
registerCurator(registery, location, optional, bootstrapContext -> true);
}
public static void registerCurator(BootstrapRegistry registery, UriComponents location, boolean optional,
Predicate<BootstrapContext> predicate) {
registery.registerIfAbsent(ZookeeperProperties.class, context -> {
if (!predicate.test(context)) {
return null;
}
return loadProperties(context.get(Binder.class), location);
});