Search in sources :

Example 1 with LeadershipEventListener

use of org.onosproject.cluster.LeadershipEventListener in project onos by opennetworkinglab.

the class SimpleLeadershipManager method runForLeadership.

@Override
public Leadership runForLeadership(String path) {
    elections.put(path, true);
    Leadership leadership = new Leadership(path, new Leader(localNodeId, 0, 0), Arrays.asList(localNodeId));
    for (LeadershipEventListener listener : listeners) {
        listener.event(new LeadershipEvent(Type.LEADER_AND_CANDIDATES_CHANGED, leadership));
    }
    return leadership;
}
Also used : LeadershipEvent(org.onosproject.cluster.LeadershipEvent) Leadership(org.onosproject.cluster.Leadership) Leader(org.onosproject.cluster.Leader) LeadershipEventListener(org.onosproject.cluster.LeadershipEventListener)

Aggregations

Leader (org.onosproject.cluster.Leader)1 Leadership (org.onosproject.cluster.Leadership)1 LeadershipEvent (org.onosproject.cluster.LeadershipEvent)1 LeadershipEventListener (org.onosproject.cluster.LeadershipEventListener)1