Class LeaderInitiatorFactoryBean

java.lang.Object
org.springframework.integration.zookeeper.config.LeaderInitiatorFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.FactoryBean<LeaderInitiator>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class LeaderInitiatorFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<LeaderInitiator>, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware
Creates a LeaderInitiator.
Since:
4.2
  • Constructor Details

  • Method Details

    • setClient

      public LeaderInitiatorFactoryBean setClient​(org.apache.curator.framework.CuratorFramework client)
    • setPath

      public LeaderInitiatorFactoryBean setPath​(java.lang.String path)
    • setRole

      public LeaderInitiatorFactoryBean setRole​(java.lang.String role)
      Configure a role for DefaultCandidate. Or this or setCandidate(Candidate) can be configured, but not both.
      Parameters:
      role - the role for candidate
      Returns:
      this instance
    • setCandidate

      public LeaderInitiatorFactoryBean setCandidate​(org.springframework.integration.leader.Candidate candidate)
      Configure a Candidate for leader election. Or this or setRole(String) can be configured, but not both.
      Parameters:
      candidate - the Candidate to use
      Returns:
      this instance
      Since:
      5.3
    • setLeaderEventPublisher

      public void setLeaderEventPublisher​(org.springframework.integration.leader.event.LeaderEventPublisher leaderEventPublisher)
      A LeaderEventPublisher option for events from the LeaderInitiator.
      Parameters:
      leaderEventPublisher - the LeaderEventPublisher to use.
      Since:
      4.3.2
    • setPhase

      public void setPhase​(int phase)
    • setAutoStartup

      public void setAutoStartup​(boolean autoStartup)
    • setApplicationEventPublisher

      public void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • stop

      public void stop​(java.lang.Runnable callback)
      Specified by:
      stop in interface org.springframework.context.SmartLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • getObject

      public LeaderInitiator getObject()
      Specified by:
      getObject in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>
    • getObjectType

      public java.lang.Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>