X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2Fimpl%2FNotificationRouterImpl.java;h=1e93202007cbd9a800e485a9ba0343298160c035;hp=7fba31114f6d53a2c491f91511109a32b6c8efec;hb=c222e37f2a0f0f3f6266242fbea2d3b018f4e6e3;hpb=2a4c88aa665a45c5394642cb3604603bebf8c0da diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java index 7fba31114f..1e93202007 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java @@ -12,7 +12,7 @@ import java.util.Collection; import org.opendaylight.controller.sal.core.api.notify.NotificationListener; import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter; import org.opendaylight.yangtools.concepts.AbstractListenerRegistration; -import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.slf4j.Logger; @@ -25,12 +25,12 @@ import com.google.common.collect.Multimaps; public class NotificationRouterImpl implements NotificationRouter { private static Logger log = LoggerFactory.getLogger(NotificationRouterImpl.class); - private final Multimap listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create()); + private final Multimap listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create()); // private Registration defaultListener; private void sendNotification(CompositeNode notification) { final QName type = notification.getNodeType(); - final Collection toNotify = listeners.get(type); + final Collection toNotify = listeners.get(type); log.trace("Publishing notification " + type); if ((toNotify == null) || toNotify.isEmpty()) { @@ -38,7 +38,7 @@ public class NotificationRouterImpl implements NotificationRouter { return; } - for (ListenerRegistration listener : toNotify) { + for (MyListenerRegistration listener : toNotify) { try { // FIXME: ensure that notification is immutable listener.getInstance().onNotification(notification); @@ -54,17 +54,17 @@ public class NotificationRouterImpl implements NotificationRouter { } @Override - public Registration addNotificationListener(QName notification, NotificationListener listener) { - ListenerRegistration ret = new ListenerRegistration(notification, listener); + public ListenerRegistration addNotificationListener(QName notification, NotificationListener listener) { + MyListenerRegistration ret = new MyListenerRegistration(notification, listener); listeners.put(notification, ret); return ret; } - private class ListenerRegistration extends AbstractListenerRegistration { + private class MyListenerRegistration extends AbstractListenerRegistration { final QName type; - public ListenerRegistration(QName type, NotificationListener instance) { + public MyListenerRegistration(QName type, NotificationListener instance) { super(instance); this.type = type; }