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%2FShard.java;h=8365328669587b5e083c8e53ca819eb63857cd40;hp=f59e05ae9935f50f58a9481a46f2e8bfc2820baf;hb=d5f8fb508de526b8f95c871a056bd7d18353508f;hpb=40322f77dfe223779916dbe047b500a87fa080e3 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java index f59e05ae99..8365328669 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java @@ -31,6 +31,7 @@ import java.util.concurrent.Executors; * A Shard represents a portion of the logical data tree *

* Our Shard uses InMemoryDataStore as it's internal representation and delegates all requests it + * */ public class Shard extends UntypedProcessor { @@ -47,15 +48,18 @@ public class Shard extends UntypedProcessor { } else if(message instanceof RegisterChangeListener){ registerChangeListener((RegisterChangeListener) message); } else if(message instanceof UpdateSchemaContext){ - store.onGlobalContextUpdated(((UpdateSchemaContext) message).getSchemaContext()); + updateSchemaContext((UpdateSchemaContext) message); } } + private void updateSchemaContext(UpdateSchemaContext message) { + store.onGlobalContextUpdated(message.getSchemaContext()); + } + private void registerChangeListener(RegisterChangeListener registerChangeListener) { org.opendaylight.yangtools.concepts.ListenerRegistration>> registration = store.registerChangeListener(registerChangeListener.getPath(), registerChangeListener.getListener(), registerChangeListener.getScope()); - // TODO: Construct a ListenerRegistration actor with the actual registration returned when registering a listener with the datastore - ActorRef listenerRegistration = getContext().actorOf(ListenerRegistration.props(null)); + ActorRef listenerRegistration = getContext().actorOf(ListenerRegistration.props(registration)); getSender().tell(new RegisterChangeListenerReply(listenerRegistration.path()), getSelf()); }