X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FActorContext.java;h=818a8ca8b390ec2fcb33f2cad91ad597fa7ca758;hp=e12a9663d1fca8a969c25166f38986ea19eab51a;hb=641dd738c5c64121b7f7816dcef3b766051d1196;hpb=f0f107f9b889b728be457cf84289b53386d7d301 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java index e12a9663d1..818a8ca8b3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/ActorContext.java @@ -23,6 +23,8 @@ import org.opendaylight.controller.cluster.datastore.messages.FindLocalShard; import org.opendaylight.controller.cluster.datastore.messages.FindPrimary; import org.opendaylight.controller.cluster.datastore.messages.LocalShardFound; import org.opendaylight.controller.cluster.datastore.messages.PrimaryFound; +import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,10 +52,13 @@ public class ActorContext { public static final Duration AWAIT_DURATION = Duration.create(5, TimeUnit.SECONDS); + public static final String MAILBOX = "bounded-mailbox"; + private final ActorSystem actorSystem; private final ActorRef shardManager; private final ClusterWrapper clusterWrapper; private final Configuration configuration; + private volatile SchemaContext schemaContext; public ActorContext(ActorSystem actorSystem, ActorRef shardManager, ClusterWrapper clusterWrapper, @@ -80,6 +85,17 @@ public class ActorContext { return actorSystem.actorSelection(actorPath); } + public void setSchemaContext(SchemaContext schemaContext) { + this.schemaContext = schemaContext; + + if(shardManager != null) { + shardManager.tell(new UpdateSchemaContext(schemaContext), null); + } + } + + public SchemaContext getSchemaContext() { + return schemaContext; + } /** * Finds the primary for a given shard