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 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
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(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) voidsetAutoStartup(boolean autoStartup) setCandidate(org.springframework.integration.leader.Candidate candidate) Configure aCandidatefor leader election.setClient(org.apache.curator.framework.CuratorFramework client) voidsetLeaderEventPublisher(org.springframework.integration.leader.event.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
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
- 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
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<LeaderInitiator>
-