Class LeaderInitiatorFactoryBean
java.lang.Object
org.springframework.integration.zookeeper.config.LeaderInitiatorFactoryBean
- All Implemented Interfaces:
- Aware,- FactoryBean<LeaderInitiator>,- InitializingBean,- ApplicationEventPublisherAware,- Lifecycle,- Phased,- SmartLifecycle
public class LeaderInitiatorFactoryBean
extends Object
implements FactoryBean<LeaderInitiator>, SmartLifecycle, InitializingBean, ApplicationEventPublisherAware
Creates a 
LeaderInitiator.- Since:
- 4.2
- Author:
- Gary Russell, Artem Bilan, Christian Tzolov
- 
Field SummaryFields inherited from interface org.springframework.beans.factory.FactoryBeanOBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidClass<?>intgetPhase()booleanbooleanvoidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetAutoStartup(boolean autoStartup) setCandidate(Candidate candidate) Configure aCandidatefor leader election.setClient(org.apache.curator.framework.CuratorFramework client) voidsetLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher) ALeaderEventPublisheroption for events from theLeaderInitiator.voidsetPhase(int phase) Configure a role forDefaultCandidate.voidstart()voidstop()voidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBeanisSingleton
- 
Constructor Details- 
LeaderInitiatorFactoryBeanpublic LeaderInitiatorFactoryBean()
 
- 
- 
Method Details- 
setClient
- 
setPath
- 
setRoleConfigure a role forDefaultCandidate. Or this orsetCandidate(Candidate)can be configured, but not both.- Parameters:
- role- the role for candidate
- Returns:
- this instance
 
- 
setCandidateConfigure aCandidatefor leader election. Or this orsetRole(String)can be configured, but not both.- Parameters:
- candidate- the- Candidateto use
- Returns:
- this instance
- Since:
- 5.3
 
- 
setLeaderEventPublisherALeaderEventPublisheroption for events from theLeaderInitiator.- Parameters:
- leaderEventPublisher- the- LeaderEventPublisherto use.
- Since:
- 4.3.2
 
- 
setPhasepublic void setPhase(int phase) 
- 
setAutoStartuppublic void setAutoStartup(boolean autoStartup) 
- 
setApplicationEventPublisher- Specified by:
- setApplicationEventPublisherin interface- ApplicationEventPublisherAware
 
- 
isAutoStartuppublic boolean isAutoStartup()- Specified by:
- isAutoStartupin interface- SmartLifecycle
 
- 
startpublic void start()
- 
stoppublic void stop()
- 
stop- Specified by:
- stopin interface- SmartLifecycle
 
- 
isRunningpublic boolean isRunning()
- 
getPhasepublic int getPhase()- Specified by:
- getPhasein interface- Phased
- Specified by:
- getPhasein interface- SmartLifecycle
 
- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- InitializingBean
 
- 
getObject- Specified by:
- getObjectin interface- FactoryBean<LeaderInitiator>
 
- 
getObjectType- Specified by:
- getObjectTypein interface- FactoryBean<LeaderInitiator>
 
 
-