@Override public void onDataTreeChanged(Collection<DataTreeCandidate> changes) { delegate.onDataTreeChanged(changes); }
@Override public void invokeListener(final AbstractDOMDataTreeChangeListenerRegistration<?> listener, final DataTreeCandidate 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)); } } };
@Override protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations, final YangInstanceIdentifier path, final DataTreeCandidateNode node) { final Collection<DataTreeCandidate> changes = Collections.<DataTreeCandidate>singleton( DataTreeCandidates.newDataTreeCandidate(path, node)); for (AbstractDOMDataTreeChangeListenerRegistration<?> reg : registrations) { reg.getInstance().onDataTreeChanged(changes); } }
private void dataChanged(final DataTreeChanged message) { // Do nothing if notifications are not enabled if (!notificationsEnabled) { LOG.debug("Notifications not enabled for listener {} - dropping change notification", listener); return; } LOG.debug("Sending change notification {} to listener {}", message.getChanges(), listener); try { this.listener.onDataTreeChanged(message.getChanges()); } catch (Exception e) { LOG.error("Error notifying listener {}", this.listener, e); } // TODO: do we really need this? // It seems the sender is never null but it doesn't hurt to check. If the caller passes in // a null sender (ActorRef.noSender()), akka translates that to the deadLetters actor. if (getSender() != null && !getContext().system().deadLetters().equals(getSender())) { getSender().tell(DataTreeChangedReply.getInstance(), getSelf()); } }