Store schemaContext in ActorContext so that all proxy objects can have access to it
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardManager.java
index 4e2369d3758596bd1217670f8f3ec5a2438db36d..f55774f09104f5fcf3d0623583dab81fb74ab9d8 100644 (file)
@@ -12,7 +12,6 @@ import akka.actor.ActorPath;
 import akka.actor.ActorRef;
 import akka.actor.Address;
 import akka.actor.Props;
-import akka.actor.UntypedActor;
 import akka.event.Logging;
 import akka.event.LoggingAdapter;
 import akka.japi.Creator;
@@ -48,7 +47,7 @@ import java.util.Map;
  * <li> When a local shard replica comes alive
  * </p>
  */
-public class ShardManager extends UntypedActor {
+public class ShardManager extends AbstractUntypedActor {
 
   // Stores a mapping between a shard name and the address of the current primary
   private final Map<String, Address> shardNameToPrimaryAddress = new HashMap<>();
@@ -69,7 +68,7 @@ public class ShardManager extends UntypedActor {
    *             configuration or operational
    */
   private ShardManager(String type){
-    ActorRef actor = getContext().actorOf(Shard.props(Shard.DEFAULT_NAME + "-" + type));
+    ActorRef actor = getContext().actorOf(Shard.props("shard-" + Shard.DEFAULT_NAME + "-" + type), "shard-" + Shard.DEFAULT_NAME + "-" + type);
     defaultShardPath = actor.path();
   }
 
@@ -84,7 +83,7 @@ public class ShardManager extends UntypedActor {
   }
 
   @Override
-  public void onReceive(Object message) throws Exception {
+  public void handleReceive(Object message) throws Exception {
     if (message instanceof FindPrimary) {
       FindPrimary msg = ((FindPrimary) message);
       String shardName = msg.getShardName();
@@ -94,7 +93,7 @@ public class ShardManager extends UntypedActor {
         getSender().tell(new PrimaryNotFound(shardName), getSelf());
       }
     } else if(message instanceof UpdateSchemaContext){
-        // FIXME : Notify all local shards of a context change
+        // FIXME : Notify all local shards of a schemaContext change
         getContext().system().actorSelection(defaultShardPath).forward(message, getContext());
     }
   }