INNER CODE UNIT · Java

registerCurator

spring-cloud/spring-cloud-zookeeper · spring-cloud-zookeeper-core/src/main/java/org/springframework/cloud/zookeeper/CuratorFactory.java:88

	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);
		});

		registery.registerIfAbsent(RetryPolicy.class, context -> {
			if (!predicate.test(context)) {
				return null;
			}
			return retryPolicy(context.get(ZookeeperProperties.class));

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…