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 Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.FactoryBean
isSingleton
-
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
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
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
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-
start
public void start() -
stop
public void stop() -
stop
- Specified by:
stopin interfaceSmartLifecycle
-
isRunning
public boolean isRunning() -
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<LeaderInitiator>
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<LeaderInitiator>
-