X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fimpl%2FNotificationBrokerImpl.xtend;h=cf339ee4f474e032ff8aca805f58eb5fe1f97d3b;hp=887ef82ca90c459d6ed4e8d12bc7c52903442919;hb=abf4ba1b0854fdd8b1a15c8c4481cf4b0bc93068;hpb=4e6f0838e508e0dce5dfa62faa29b43e979f5ef8 diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend index 887ef82ca9..cf339ee4f4 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend @@ -24,19 +24,13 @@ import java.util.Collections import org.slf4j.LoggerFactory import java.util.concurrent.Callable -class NotificationBrokerImpl implements NotificationProviderService { +class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable { val Multimap, NotificationListener> listeners; @Property var ExecutorService executor; - @Property - var RuntimeCodeGenerator generator; - - @Property - var NotificationInvokerFactory invokerFactory; - new(ExecutorService executor) { listeners = HashMultimap.create() this.executor = executor; @@ -108,7 +102,7 @@ class NotificationBrokerImpl implements NotificationProviderService { override registerNotificationListener( org.opendaylight.yangtools.yang.binding.NotificationListener listener) { - val invoker = invokerFactory.invokerFor(listener); + val invoker = BindingAwareBrokerImpl.generator.invokerFactory.invokerFor(listener); for (notifyType : invoker.supportedNotifications) { listeners.put(notifyType, invoker.invocationProxy) } @@ -125,6 +119,11 @@ class NotificationBrokerImpl implements NotificationProviderService { listeners.remove(notifyType, reg.invoker.invocationProxy) } } + + override close() { + //FIXME: implement properly. + } + } class GenericNotificationRegistration extends AbstractObjectRegistration> implements ListenerRegistration> { @@ -177,7 +176,9 @@ class NotifyTask implements Callable { override call() { try { + log.info("Delivering notification {} to {}",notification,listener); listener.onNotification(notification); + log.info("Notification delivered {} to {}",notification,listener); } catch (Exception e) { log.error("Unhandled exception thrown by listener: {}", listener, e); }