class LeaderInitiator implements SmartLifecycle {

	private static final Logger LOGGER = LoggerFactory.getLogger(LeaderInitiator.class);

	private final LeaderProperties leaderProperties;

	private final LeadershipController leadershipController;

	private final LeaderRecordWatcher leaderRecordWatcher;

	private final PodReadinessWatcher hostPodWatcher;

	private ScheduledExecutorService scheduledExecutorService;

	private boolean isRunning;

	public LeaderInitiator(LeaderProperties leaderProperties, LeadershipController leadershipController,
			LeaderRecordWatcher leaderRecordWatcher, PodReadinessWatcher hostPodWatcher) {
		this.leaderProperties = leaderProperties;
		this.leadershipController = leadershipController;
		this.leaderRecordWatcher = leaderRecordWatcher;
		this.hostPodWatcher = hostPodWatcher;
	}

	@Override
	public boolean isAutoStartup() {
		return this.leaderProperties.isAutoStartup();
	}

	@Override
	public void start() {
		if (!isRunning()) {
			LOGGER.debug("Leader initiator starting");
			this.leaderRecordWatcher.start();
			this.hostPodWatcher.start();
			this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();
			this.scheduledExecutorService.scheduleAtFixedRate(this.leadershipController::update,
					this.leaderProperties.getUpdatePeriod().toMillis(),
					this.leaderProperties.getUpdatePeriod().toMillis(), TimeUnit.MILLISECONDS);
			this.isRunning = true;
		}
	}

	@Override
	public void stop() {<FILL_FUNCTION_BODY>}

	@Override
	public void stop(Runnable callback) {
		stop();
		callback.run();
	}

	@Override
	public boolean isRunning() {
		return this.isRunning;
	}

	@Override
	public int getPhase() {
		return 0;
	}

}

		if (isRunning()) {
			LOGGER.debug("Leader initiator stopping");
			this.scheduledExecutorService.shutdown();
			this.scheduledExecutorService = null;
			this.hostPodWatcher.stop();
			this.leaderRecordWatcher.stop();
			this.leadershipController.revoke();
			this.isRunning = false;
		}
	
<no_super_class>