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
LeaderInitiator
.Constructor and Description |
---|
LeaderInitiatorFactoryBean() |
LeaderInitiatorFactoryBean(org.apache.curator.framework.CuratorFramework client,
String path,
String role)
Deprecated.
since 4.2.5 in favor of appropriate setters
to avoid
BeanCurrentlyInCreationException
during AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
LeaderInitiator |
getObject() |
Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
boolean |
isSingleton() |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setAutoStartup(boolean autoStartup) |
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) |
void |
start() |
void |
stop() |
void |
stop(Runnable callback) |
public LeaderInitiatorFactoryBean()
@Deprecated public LeaderInitiatorFactoryBean(org.apache.curator.framework.CuratorFramework client, String path, String role)
BeanCurrentlyInCreationException
during AbstractAutowireCapableBeanFactory.getSingletonFactoryBeanForTypeCheck()
client
- the CuratorFramework
.path
- the path in zookeeper.role
- the role of the leader.public LeaderInitiatorFactoryBean setClient(org.apache.curator.framework.CuratorFramework client)
public LeaderInitiatorFactoryBean setPath(String path)
public LeaderInitiatorFactoryBean setRole(String role)
public 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(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface org.springframework.context.ApplicationEventPublisherAware
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public void stop(Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public LeaderInitiator getObject() throws Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>
Exception
public Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<LeaderInitiator>