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%2FAbstractDataListenerSupport.java;h=5a09b87da19f1e5b360761b1e64d05f00d793737;hp=ac7a9337d9ff0a28507d07f75d199a1f1ed82b4c;hb=e78622411319748472b5d9edab14eb6dc92cf6b1;hpb=ec870dee9bacb971f11bc747b69e84ac37f5d746 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractDataListenerSupport.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractDataListenerSupport.java index ac7a9337d9..5a09b87da1 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractDataListenerSupport.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractDataListenerSupport.java @@ -16,15 +16,18 @@ import java.util.concurrent.ConcurrentHashMap; import org.opendaylight.controller.cluster.datastore.actors.DataTreeNotificationListenerRegistrationActor; import org.opendaylight.controller.cluster.datastore.messages.EnableNotification; import org.opendaylight.controller.cluster.datastore.messages.ListenerRegistrationMessage; +import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -abstract class AbstractDataListenerSupport> extends LeaderLocalDelegateFactory { +abstract class AbstractDataListenerSupport + extends LeaderLocalDelegateFactory { private final Logger log = LoggerFactory.getLogger(getClass()); - private final Collection delayedListenerRegistrations = ConcurrentHashMap.newKeySet(); - private final Collection delayedListenerOnAllRegistrations = ConcurrentHashMap.newKeySet(); + private final Collection> delayedListenerRegistrations = + ConcurrentHashMap.newKeySet(); + private final Collection> delayedListenerOnAllRegistrations = + ConcurrentHashMap.newKeySet(); private final Collection leaderOnlyListenerActors = ConcurrentHashMap.newKeySet(); private final Collection allListenerActors = ConcurrentHashMap.newKeySet(); @@ -40,22 +43,22 @@ abstract class AbstractDataListenerSupport reg : delayedListenerOnAllRegistrations) { + reg.doRegistration(this); } delayedListenerOnAllRegistrations.clear(); } if (isLeader) { - for (D reg : delayedListenerRegistrations) { - reg.createDelegate(this); + for (DelayedListenerRegistration reg : delayedListenerRegistrations) { + reg.doRegistration(this); } delayedListenerRegistrations.clear(); @@ -64,7 +67,8 @@ abstract class AbstractDataListenerSupport delayedRegList; + DelayedListenerRegistration delayedReg = + new DelayedListenerRegistration<>(message, registrationActor); + Collection> delayedRegList; if (message.isRegisterOnAllInstances()) { delayedRegList = delayedListenerOnAllRegistrations; } else { @@ -89,14 +94,14 @@ abstract class AbstractDataListenerSupport