Class LeaderElectionImpl
- java.lang.Object
-
- org.kie.hacep.core.infra.election.LeaderElectionImpl
-
- All Implemented Interfaces:
LeaderElection
public class LeaderElectionImpl extends Object implements LeaderElection
from from org.apache.camel.component.kubernetes.cluster.lock Monitors current status and participate to leader election when no active leaders are present. It communicates changes in leadership and cluster members to the given event handler.
-
-
Constructor Summary
Constructors Constructor Description LeaderElectionImpl(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, KubernetesLockConfiguration lockConfiguration, org.kie.hacep.core.infra.election.State initialState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCallbacks(List<org.kie.hacep.core.infra.election.LeadershipCallback> callbacks)booleanlookupNewLeaderInfo()Set<String>pullClusterMembers()voidrefreshStatus()voidstart()voidstop()
-
-
-
Constructor Detail
-
LeaderElectionImpl
public LeaderElectionImpl(io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, KubernetesLockConfiguration lockConfiguration, org.kie.hacep.core.infra.election.State initialState)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceLeaderElection
-
stop
public void stop()
- Specified by:
stopin interfaceLeaderElection
-
addCallbacks
public void addCallbacks(List<org.kie.hacep.core.infra.election.LeadershipCallback> callbacks)
- Specified by:
addCallbacksin interfaceLeaderElection
-
refreshStatus
public void refreshStatus()
-
lookupNewLeaderInfo
public boolean lookupNewLeaderInfo()
-
-