List of usage examples for org.springframework.integration.leader.event DefaultLeaderEventPublisher DefaultLeaderEventPublisher
public DefaultLeaderEventPublisher(ApplicationEventPublisher applicationEventPublisher)
From source file:org.springframework.integration.etcd.leader.LeaderInitiator.java
@Override public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { if (!this.customPublisher) { this.leaderEventPublisher = new DefaultLeaderEventPublisher(applicationEventPublisher); }//from w w w . j ava2 s. c om }
From source file:org.springframework.integration.support.leader.LockRegistryLeaderInitiator.java
/** * Start the registration of the {@link #candidate} for leader election. *///from w w w.j a va 2 s .c o m @Override public void start() { if (this.leaderEventPublisher == null && this.applicationEventPublisher != null) { this.leaderEventPublisher = new DefaultLeaderEventPublisher(this.applicationEventPublisher); } synchronized (this.lifecycleMonitor) { if (!this.running) { this.leaderSelector = new LeaderSelector(buildLeaderPath()); this.future = this.executorService.submit(this.leaderSelector); this.running = true; logger.debug("Started LeaderInitiator"); } } }