Example usage for org.springframework.integration.leader Candidate getRole

List of usage examples for org.springframework.integration.leader Candidate getRole

Introduction

In this page you can find the example usage for org.springframework.integration.leader Candidate getRole.

Prototype

String getRole();

Source Link

Document

Gets the role.

Usage

From source file:org.springframework.integration.etcd.leader.LeaderInitiator.java

/**
 * Construct a {@link LeaderInitiator}.//from   w w  w .j  a  va 2s.  c  om
 * @param client {@link EtcdClient} instance
 * @param candidate leadership election candidate
 * @param namespace Etcd namespace
 */
public LeaderInitiator(EtcdClient client, Candidate candidate, String namespace) {
    Assert.notNull(client, "'etcdClient' must not be null");
    Assert.notNull(candidate, "'candidate' must not be null");
    this.client = client;
    this.candidate = candidate;
    this.context = new EtcdContext();
    this.baseEtcdPath = (namespace == null ? DEFAULT_NAMESPACE : namespace) + "/" + candidate.getRole();
}