X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft-example%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fexample%2FExampleRoleChangeListener.java;h=d3bf544ef94d60365b1ae6cfb4046b5168110755;hp=0d11d7201d7cbd18efa2909128c5ea2b1d3482a9;hb=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51;hpb=1984e660ade65e692708722d21cbbbf76701151c diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java index 0d11d7201d..d3bf544ef9 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java @@ -57,7 +57,7 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } @Override - protected void handleReceive(Object message) throws Exception { + protected void handleReceive(Object message) { if (message instanceof RegisterListener) { // called by the scheduler at intervals to register any unregistered notifiers sendRegistrationRequests(); @@ -88,13 +88,11 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } private void populateRegistry(String memberName) { - for (String shard: SHARDS_TO_MONITOR) { - String notifier = new StringBuilder().append(NOTIFIER_AKKA_URL).append(memberName) + String notifier = new StringBuilder().append(NOTIFIER_AKKA_URL).append(memberName) .append("/").append(memberName).append("-notifier").toString(); - if (!notifierRegistrationStatus.containsKey(notifier)) { - notifierRegistrationStatus.put(notifier, false); - } + if (!notifierRegistrationStatus.containsKey(notifier)) { + notifierRegistrationStatus.put(notifier, false); } if (!registrationSchedule.isCancelled()) { @@ -143,7 +141,7 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A @Override - public void close() throws Exception { + public void close() { registrationSchedule.cancel(); } }