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%2FShardDataTreeChangeListenerPublisherActorProxy.java;h=ceaeeccaad8b700a9c262f25cdc7d1f50f590f60;hp=7196f839e4ca876e7ae67ec519f54b6751d603db;hb=refs%2Fchanges%2F08%2F55108%2F5;hpb=e7512222d7d9e3149feb6a90eeb726e9391887fa diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeChangeListenerPublisherActorProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeChangeListenerPublisherActorProxy.java index 7196f839e4..ceaeeccaad 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeChangeListenerPublisherActorProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeChangeListenerPublisherActorProxy.java @@ -8,10 +8,15 @@ package org.opendaylight.controller.cluster.datastore; import akka.actor.ActorContext; +import akka.actor.ActorRef; +import akka.actor.Props; +import com.google.common.base.Optional; +import java.util.function.Consumer; import javax.annotation.concurrent.NotThreadSafe; import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate; /** * Implementation of ShardDataTreeChangeListenerPublisher that offloads the generation and publication @@ -23,30 +28,20 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; class ShardDataTreeChangeListenerPublisherActorProxy extends AbstractShardDataTreeNotificationPublisherActorProxy implements ShardDataTreeChangeListenerPublisher { - private final ShardDataTreeChangeListenerPublisher delegatePublisher = - new DefaultShardDataTreeChangeListenerPublisher(); - - ShardDataTreeChangeListenerPublisherActorProxy(ActorContext actorContext, String actorName) { - super(actorContext, actorName); - } - - private ShardDataTreeChangeListenerPublisherActorProxy(ShardDataTreeChangeListenerPublisherActorProxy other) { - super(other); - } - - @Override - public ListenerRegistration registerTreeChangeListener( - YangInstanceIdentifier treeId, L listener) { - return delegatePublisher.registerTreeChangeListener(treeId, listener); + ShardDataTreeChangeListenerPublisherActorProxy(ActorContext actorContext, String actorName, String logContext) { + super(actorContext, actorName, logContext); } @Override - public ShardDataTreeChangeListenerPublisher newInstance() { - return new ShardDataTreeChangeListenerPublisherActorProxy(this); + public void registerTreeChangeListener(YangInstanceIdentifier treeId, + DOMDataTreeChangeListener listener, Optional currentState, + Consumer> onRegistration) { + notifierActor().tell(new ShardDataTreeChangePublisherActor.RegisterListener(treeId, listener, currentState, + onRegistration), ActorRef.noSender()); } @Override - protected ShardDataTreeNotificationPublisher getDelegatePublisher() { - return delegatePublisher; + protected Props props() { + return ShardDataTreeChangePublisherActor.props(actorName(), logContext()); } }