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.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
public class NotificationRouterImpl implements NotificationRouter {
private static Logger log = LoggerFactory.getLogger(NotificationRouterImpl.class);
- private final Multimap<QName, Registration<NotificationListener>> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.<QName, Registration<NotificationListener>>create());
+ private final Multimap<QName, ListenerRegistration> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.<QName, ListenerRegistration>create());
// private Registration<NotificationListener> defaultListener;
private void sendNotification(CompositeNode notification) {
final QName type = notification.getNodeType();
- final Collection<Registration<NotificationListener>> toNotify = listeners.get(type);
+ final Collection<ListenerRegistration> toNotify = listeners.get(type);
log.trace("Publishing notification " + type);
if ((toNotify == null) || toNotify.isEmpty()) {
return;
}
- for (Registration<NotificationListener> listener : toNotify) {
+ for (ListenerRegistration listener : toNotify) {
try {
// FIXME: ensure that notification is immutable
listener.getInstance().onNotification(notification);
return ret;
}
- private class ListenerRegistration extends AbstractObjectRegistration<NotificationListener> {
+ private class ListenerRegistration extends AbstractListenerRegistration<NotificationListener> {
final QName type;