public class LeaderInitiatorFactoryBean extends Object implements FactoryBean<LeaderInitiator>, SmartLifecycle, InitializingBean, ApplicationEventPublisherAware
LeaderInitiator.OBJECT_TYPE_ATTRIBUTEDEFAULT_PHASE| Constructor and Description |
|---|
LeaderInitiatorFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
LeaderInitiator |
getObject() |
Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(boolean autoStartup) |
LeaderInitiatorFactoryBean |
setCandidate(Candidate candidate)
Configure a
Candidate for leader election. |
LeaderInitiatorFactoryBean |
setClient(org.apache.curator.framework.CuratorFramework client) |
void |
setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)
A
LeaderEventPublisher option for events from the LeaderInitiator. |
LeaderInitiatorFactoryBean |
setPath(String path) |
void |
setPhase(int phase) |
LeaderInitiatorFactoryBean |
setRole(String role)
Configure a role for
DefaultCandidate. |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisSingletonpublic LeaderInitiatorFactoryBean setClient(org.apache.curator.framework.CuratorFramework client)
public LeaderInitiatorFactoryBean setPath(String path)
public LeaderInitiatorFactoryBean setRole(String role)
DefaultCandidate.
Or this or setCandidate(Candidate) can be configured, but not both.role - the role for candidatepublic LeaderInitiatorFactoryBean setCandidate(Candidate candidate)
Candidate for leader election.
Or this or setRole(String) can be configured, but not both.candidate - the Candidate to usepublic void setLeaderEventPublisher(LeaderEventPublisher leaderEventPublisher)
LeaderEventPublisher option for events from the LeaderInitiator.leaderEventPublisher - the LeaderEventPublisher to use.public void setPhase(int phase)
public void setAutoStartup(boolean autoStartup)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAwarepublic boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void stop(Runnable callback)
stop in interface SmartLifecyclepublic int getPhase()
getPhase in interface PhasedgetPhase in interface SmartLifecyclepublic void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanpublic LeaderInitiator getObject()
getObject in interface FactoryBean<LeaderInitiator>public Class<?> getObjectType()
getObjectType in interface FactoryBean<LeaderInitiator>