Implements the leader election api. The implementation supports kubernetes and jgroup binding.
- cb - The toolarium common build
We use SemVer for versioning. For the versions available, see the [tags on this repository].
// initialize
ILeaderElector leaderElector = LeaderElectionFactory.getInstance().getLeaderElection(
new LeaderElectionInformation("namespace", "name", "test"), new LeaderElectionConfiguration(10 /* duration of 10 seconds */));
if (leaderElector.isLeader()) {
// get in lead
} else {
// not in lead
}