Example usage for org.springframework.integration.support.leader LockRegistryLeaderInitiator LockRegistryLeaderInitiator

List of usage examples for org.springframework.integration.support.leader LockRegistryLeaderInitiator LockRegistryLeaderInitiator

Introduction

In this page you can find the example usage for org.springframework.integration.support.leader LockRegistryLeaderInitiator LockRegistryLeaderInitiator.

Prototype

public LockRegistryLeaderInitiator(LockRegistry locks) 

Source Link

Document

Create a new leader initiator with the provided lock registry and a default candidate (which just logs the leadership events).

Usage

From source file:org.springframework.cloud.task.configuration.SingleInstanceTaskListener.java

public SingleInstanceTaskListener(LockRegistry lockRegistry, TaskNameResolver taskNameResolver,
        TaskProperties taskProperties, ApplicationEventPublisher applicationEventPublisher) {
    this.lockRegistry = lockRegistry;
    this.taskNameResolver = taskNameResolver;
    this.taskProperties = taskProperties;
    this.lockRegistryLeaderInitiator = new LockRegistryLeaderInitiator(this.lockRegistry);
    this.applicationEventPublisher = applicationEventPublisher;
}