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%2FDataTreeCohortRegistrationProxy.java;h=8012a2dcb70817ff604516dbeca499cee984b643;hp=45b0f76484931ba093b4156f4cec107ec1434840;hb=HEAD;hpb=f83b2d36fdd7e953ba72492ffb684cd112aa04a6 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java index 45b0f76484..4e3c6cb8d7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortRegistrationProxy.java @@ -14,11 +14,10 @@ import akka.dispatch.OnComplete; import akka.pattern.Patterns; import akka.util.Timeout; import java.util.concurrent.TimeUnit; -import javax.annotation.concurrent.GuardedBy; +import org.checkerframework.checker.lock.qual.GuardedBy; import org.opendaylight.controller.cluster.datastore.exceptions.LocalShardNotFoundException; import org.opendaylight.controller.cluster.datastore.utils.ActorUtils; import org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort; -import org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohortRegistration; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.yangtools.concepts.AbstractObjectRegistration; import org.slf4j.Logger; @@ -26,11 +25,10 @@ import org.slf4j.LoggerFactory; import scala.concurrent.Future; import scala.concurrent.duration.FiniteDuration; -public class DataTreeCohortRegistrationProxy extends AbstractObjectRegistration - implements DOMDataTreeCommitCohortRegistration { - +public class DataTreeCohortRegistrationProxy extends AbstractObjectRegistration { private static final Logger LOG = LoggerFactory.getLogger(DataTreeCohortRegistrationProxy.class); private static final Timeout TIMEOUT = new Timeout(new FiniteDuration(5, TimeUnit.SECONDS)); + private final DOMDataTreeIdentifier subtree; private final ActorRef actor; private final ActorUtils actorUtils; @@ -42,8 +40,8 @@ public class DataTreeCohortRegistrationProxy super(cohort); this.subtree = requireNonNull(subtree); this.actorUtils = requireNonNull(actorUtils); - this.actor = actorUtils.getActorSystem().actorOf(DataTreeCohortActor.props(getInstance(), - subtree.getRootIdentifier()).withDispatcher(actorUtils.getNotificationDispatcherPath())); + actor = actorUtils.getActorSystem().actorOf(DataTreeCohortActor.props(getInstance(), + subtree.path()).withDispatcher(actorUtils.getNotificationDispatcherPath())); } public void init(final String shardName) { @@ -72,7 +70,7 @@ public class DataTreeCohortRegistrationProxy cohortRegistry = shard; Future future = Patterns.ask(shard, new DataTreeCohortActorRegistry.RegisterCohort(subtree, actor), TIMEOUT); - future.onComplete(new OnComplete() { + future.onComplete(new OnComplete<>() { @Override public void onComplete(final Throwable failure, final Object val) {