* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.controller.cluster.notifications;
import akka.actor.ActorPath;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.serialization.Serialization;
package org.opendaylight.controller.cluster.notifications;
import akka.actor.ActorPath;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.serialization.Serialization;
import java.util.Map;
import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
/**
* The RoleChangeNotifier is responsible for receiving Raft role and leader state change messages and notifying
* the listeners (within the same node), which are registered with it.
import java.util.Map;
import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
/**
* The RoleChangeNotifier is responsible for receiving Raft role and leader state change messages and notifying
* the listeners (within the same node), which are registered with it.
* The RoleChangeNotifier is instantiated by the Shard and injected into the RaftActor.
*/
public class RoleChangeNotifier extends AbstractUntypedActor implements AutoCloseable {
private final String memberId;
* The RoleChangeNotifier is instantiated by the Shard and injected into the RaftActor.
*/
public class RoleChangeNotifier extends AbstractUntypedActor implements AutoCloseable {
private final String memberId;
private RoleChangeNotification latestRoleChangeNotification = null;
private LeaderStateChanged latestLeaderStateChanged;
private RoleChangeNotification latestRoleChangeNotification = null;
private LeaderStateChanged latestLeaderStateChanged;
for (ActorRef listener: registeredListeners.values()) {
listener.tell(latestLeaderStateChanged, getSelf());
}
for (ActorRef listener: registeredListeners.values()) {
listener.tell(latestLeaderStateChanged, getSelf());
}