public class LeaderInitiatorFactoryBean extends Object implements FactoryBean<LeaderInitiator>, SmartLifecycle, InitializingBean, ApplicationEventPublisherAware
LeaderInitiator
.OBJECT_TYPE_ATTRIBUTE
DEFAULT_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, wait
isSingleton
public 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 ApplicationEventPublisherAware
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
getPhase
in interface SmartLifecycle
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public LeaderInitiator getObject()
getObject
in interface FactoryBean<LeaderInitiator>
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<LeaderInitiator>