import java.util.Collections;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
import org.opendaylight.controller.md.sal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
import org.opendaylight.controller.sal.core.spi.data.AbstractDOMStoreTreeChangePublisher;
private static final Invoker<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> MANAGER_INVOKER =
(listener, notification) -> {
// FIXME: this is inefficient, as we could grab the entire queue for the listener and post it
- final DOMDataTreeChangeListener inst = listener.getInstance();
- if (inst != null) {
- inst.onDataTreeChanged(Collections.singletonList(notification));
- }
+ listener.getInstance().onDataTreeChanged(Collections.singletonList(notification));
};
private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMStoreTreeChangePublisher.class);
this.notificationManager = notificationManager;
}
+ QueuedNotificationManager<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate>
+ getNotificationManager() {
+ return notificationManager;
+ }
+
@Override
protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
final YangInstanceIdentifier path, final DataTreeCandidateNode node) {
return reg;
}
- synchronized void publishChange(@Nonnull final DataTreeCandidate candidate) {
+ synchronized void publishChange(final @NonNull DataTreeCandidate candidate) {
// Runs synchronized with registrationRemoved()
processCandidateTree(candidate);
}