X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fnotifications%2FRoleChangeNotifier.java;h=95f1372a054bcc603ac73263fad299ab85798e7b;hb=40723a37cc98de6c7dc396ca2558f7ef51e7337a;hp=598dfb1fe827fe8b03234003dc5d0bdf7c750223;hpb=0fd35528060658937b465714f599c6838e0525f1;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java index 598dfb1fe8..95f1372a05 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/RoleChangeNotifier.java @@ -19,7 +19,8 @@ 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 { @@ -45,7 +46,7 @@ public class RoleChangeNotifier extends AbstractUntypedActor implements AutoClos } @Override - protected void handleReceive(Object message) throws Exception { + protected void handleReceive(Object message) { if (message instanceof RegisterRoleChangeListener) { // register listeners for this shard @@ -63,7 +64,7 @@ public class RoleChangeNotifier extends AbstractUntypedActor implements AutoClos getSender().tell(new RegisterRoleChangeListenerReply(), getSelf()); - if(latestLeaderStateChanged != null) { + if (latestLeaderStateChanged != null) { getSender().tell(latestLeaderStateChanged, getSelf()); } @@ -92,6 +93,8 @@ public class RoleChangeNotifier extends AbstractUntypedActor implements AutoClos for (ActorRef listener: registeredListeners.values()) { listener.tell(latestLeaderStateChanged, getSelf()); } + } else { + unknownMessage(message); } }