X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft-example%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fexample%2FExampleRoleChangeListener.java;h=0d11d7201d7cbd18efa2909128c5ea2b1d3482a9;hb=e2607370f5ac443a5a2f1f00f693f82a0b57161d;hp=1676a41c56d7f9c2cfe81a7fc9e46c6828c8d721;hpb=412db94945c5db5d2da918f5e23bd3abcecc4d10;p=controller.git 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 1676a41c56..0d11d7201d 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 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * 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.example; import akka.actor.ActorRef; @@ -15,31 +23,32 @@ import scala.concurrent.Await; import scala.concurrent.duration.FiniteDuration; /** - * This is a sample implementation of a Role Change Listener which is an actor, which registers itself to the ClusterRoleChangeNotifier - *
+ * This is a sample implementation of a Role Change Listener which is an actor, which registers itself + * to the ClusterRoleChangeNotifier. + * + ** The Role Change listener receives a SetNotifiers message with the notifiers to register itself with. - *
- * It kicks of a scheduler which sents registration messages to the notifiers, till it gets a RegisterRoleChangeListenerReply - * + * + *+ * It kicks of a scheduler which sends registration messages to the notifiers, till it gets a + * RegisterRoleChangeListenerReply. + * + *
* If all the notifiers have been regsitered with, then it cancels the scheduler.
* It starts the scheduler again when it receives a new registration
- *
*/
-public class ExampleRoleChangeListener extends AbstractUntypedActor implements AutoCloseable{
+public class ExampleRoleChangeListener extends AbstractUntypedActor implements AutoCloseable {
// the akka url should be set to the notifiers actor-system and domain.
- private static final String NOTIFIER_AKKA_URL = "akka.tcp://raft-test@127.0.0.1:2550/user/";
+ private static final String NOTIFIER_AKKA_URL = "akka://raft-test@127.0.0.1:2550/user/";
- private Map