When registering proxy listener, make sure we do not lose
onInitialData() events.
Change-Id: I2529d64d10f477ad52e90dec15d88c6228a47af0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d33f2a4667e423fcbff25454f28412a5b3d01a42)
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.google.common.util.concurrent.Uninterruptibles;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import com.google.common.util.concurrent.Uninterruptibles;
+import java.util.Collection;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.slf4j.Logger;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.slf4j.Logger;
LOG.debug("Registering tree listener: {} for tree: {} shard: {}, path inside shard: {}",
delegate,shardLookup, shardName, insideShard);
LOG.debug("Registering tree listener: {} for tree: {} shard: {}, path inside shard: {}",
delegate,shardLookup, shardName, insideShard);
+ // wrap this in the ClusteredDOMDataTreeChangeLister interface
+ // since we always want clustered registration
final DataTreeChangeListenerProxy<DOMDataTreeChangeListener> listenerRegistrationProxy =
final DataTreeChangeListenerProxy<DOMDataTreeChangeListener> listenerRegistrationProxy =
- new DataTreeChangeListenerProxy<>(actorUtils,
- // wrap this in the ClusteredDOMDataTreeChangeLister interface
- // since we always want clustered registration
- (ClusteredDOMDataTreeChangeListener) delegate::onDataTreeChanged, insideShard);
+ new DataTreeChangeListenerProxy<>(actorUtils, new ClusteredDOMDataTreeChangeListener() {
+ @Override
+ public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {
+ delegate.onDataTreeChanged(changes);
+ }
+
+ @Override
+ public void onInitialData() {
+ delegate.onInitialData();
+ }
+ }, insideShard);
listenerRegistrationProxy.init(shardName);
return (ListenerRegistration<L>) listenerRegistrationProxy;
listenerRegistrationProxy.init(shardName);
return (ListenerRegistration<L>) listenerRegistrationProxy;