X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fdom%2Fbroker%2Fimpl%2FNotificationRouterImpl.java;h=1e93202007cbd9a800e485a9ba0343298160c035;hb=1e12c13aaec75493f70dd759208181f45c385102;hp=50af3fbfc1f097662ae4f0a8f1e1084cb87aab96;hpb=c0ed4d565d180c360f7506b2577c4b2d732e173c;p=controller.git 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 50af3fbfc1..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 @@ -11,8 +11,8 @@ 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.AbstractObjectRegistration; -import org.opendaylight.yangtools.concepts.Registration; +import org.opendaylight.yangtools.concepts.AbstractListenerRegistration; +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 (Registration 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 AbstractObjectRegistration { + 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; }