@Configuration
@EnableConfigurationProperties(value={LeadershipProperties.class,ZookeeperLeadershipProperties.class})
@AutoConfigureAfter(value=org.springframework.cloud.zookeeper.ZookeeperAutoConfiguration.class)
public class GenieLeadershipAutoConfiguration
extends java.lang.Object
| Constructor and Description |
|---|
GenieLeadershipAutoConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.integration.zookeeper.config.LeaderInitiatorFactoryBean |
leaderInitiatorFactory(org.apache.curator.framework.CuratorFramework client,
ZookeeperLeadershipProperties zookeeperLeadershipProperties)
The leadership initialization factory bean which will create a LeaderInitiator to kick off the leader election
process within this node for the cluster if Zookeeper is configured.
|
LeadershipTasksCoordinator |
leadershipTasksCoordinator(org.springframework.scheduling.TaskScheduler taskScheduler,
java.util.Collection<LeadershipTask> tasks)
Create the LeadershipTasksCoordination bean used to start and stop all leadership related tasks based on
whether leadership is granted or revoked.
|
LocalLeader |
localLeader(GenieEventBus genieEventBus,
LeadershipProperties leadershipProperties)
If Zookeeper isn't available and this node is forced to be the leader create the local leader
bean which will fire appropriate events.
|
@Bean @ConditionalOnBean(value=LeadershipTask.class) public LeadershipTasksCoordinator leadershipTasksCoordinator(org.springframework.scheduling.TaskScheduler taskScheduler, java.util.Collection<LeadershipTask> tasks)
taskScheduler - The task scheduler to use for scheduling leadership taskstasks - The leadership tasks to schedule@Bean
@ConditionalOnBean(value=org.apache.curator.framework.CuratorFramework.class)
public org.springframework.integration.zookeeper.config.LeaderInitiatorFactoryBean leaderInitiatorFactory(org.apache.curator.framework.CuratorFramework client,
ZookeeperLeadershipProperties zookeeperLeadershipProperties)
client - The curator framework client to usezookeeperLeadershipProperties - The Zookeeper properties to use@Bean @ConditionalOnMissingBean(value=org.apache.curator.framework.CuratorFramework.class) public LocalLeader localLeader(GenieEventBus genieEventBus, LeadershipProperties leadershipProperties)
genieEventBus - The genie event bus implementation to useleadershipProperties - Properties related to static leadership configuration for the Genie cluster