All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.transferwise.common.leaderselector.TwLeaderSelectorAutoConfiguration Maven / Gradle / Ivy

Go to download

TransferWise Leader Selector - low noise consistent leader selector based on Curator Framework.

There is a newer version: 1.10.4
Show newest version
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