com.transferwise.common.leaderselector.TwLeaderSelectorAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-leader-selector-starter Show documentation
Show all versions of tw-leader-selector-starter Show documentation
TransferWise Leader Selector - low noise consistent leader selector based on Curator Framework.
package com.transferwise.common.leaderselector;
import org.apache.curator.framework.CuratorFramework;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@ConditionalOnBean(CuratorFramework.class)
public class TwLeaderSelectorAutoConfiguration {
@Bean
@ConditionalOnMissingBean(LostCountingConnectionStateListener.class)
public LostCountingConnectionStateListener twLsLostCountingConnectionStateListener() {
return new LostCountingConnectionStateListener();
}
@Bean
@ConditionalOnMissingBean(SharedReentrantLockBuilderFactory.class)
public DefaultSharedReentrantLockBuilderFactory twLsSharedReentrantLockBuilderFactory() {
return new DefaultSharedReentrantLockBuilderFactory();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy