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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LeaderInitiatorFactoryBean() -
Method Summary
Modifier and Type Method Description voidafterPropertiesSet()LeaderInitiatorgetObject()java.lang.Class<?>getObjectType()intgetPhase()booleanisAutoStartup()booleanisRunning()voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)voidsetAutoStartup(boolean autoStartup)LeaderInitiatorFactoryBeansetCandidate(org.springframework.integration.leader.Candidate candidate)Configure aCandidatefor leader election.LeaderInitiatorFactoryBeansetClient(org.apache.curator.framework.CuratorFramework client)voidsetLeaderEventPublisher(org.springframework.integration.leader.event.LeaderEventPublisher leaderEventPublisher)ALeaderEventPublisheroption for events from theLeaderInitiator.LeaderInitiatorFactoryBeansetPath(java.lang.String path)voidsetPhase(int phase)LeaderInitiatorFactoryBeansetRole(java.lang.String role)Configure a role forDefaultCandidate.voidstart()voidstop()voidstop(java.lang.Runnable callback)
-
Constructor Details
-
LeaderInitiatorFactoryBean
public LeaderInitiatorFactoryBean()
-
-
Method Details
-
setClient
-
setPath
-
setRole
Configure a role forDefaultCandidate. Or this orsetCandidate(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 aCandidatefor leader election. Or this orsetRole(String)can be configured, but not both.- Parameters:
candidate- theCandidateto use- Returns:
- this instance
- Since:
- 5.3
-
setLeaderEventPublisher
public void setLeaderEventPublisher(org.springframework.integration.leader.event.LeaderEventPublisher leaderEventPublisher)ALeaderEventPublisheroption for events from theLeaderInitiator.- Parameters:
leaderEventPublisher- theLeaderEventPublisherto 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:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop(java.lang.Runnable callback)- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getObject
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<LeaderInitiator>
-
getObjectType
public java.lang.Class<?> getObjectType()- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<LeaderInitiator>
-