public class LeaderInitiatorFactoryBean extends java.lang.Object implements org.springframework.beans.factory.FactoryBean<LeaderInitiator>, org.springframework.context.SmartLifecycle, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware
LeaderInitiator.| Constructor and Description |
|---|
LeaderInitiatorFactoryBean(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
java.lang.String role)
Construct the instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
LeaderInitiator |
getObject() |
java.lang.Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
boolean |
isSingleton() |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(boolean autoStartup) |
void |
setPhase(int phase) |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public LeaderInitiatorFactoryBean(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
java.lang.String role)
client - the CuratorFramework.path - the path in zookeeper.role - the role of the leader.public void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic int getPhase()
getPhase in interface org.springframework.context.Phasedpublic void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup in interface org.springframework.context.SmartLifecyclepublic void setAutoStartup(boolean autoStartup)
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwarepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic LeaderInitiator getObject() throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>java.lang.Exceptionpublic java.lang.Class<?> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>