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=52aa8d029066b3093a90300f6bb078886b2b3d7b;hp=b10c06f0c53e359ec2cabe3028b7243339c6f53b;hb=ce2938e5616a170ca2fb2f5b478b3b2ceff832a1;hpb=9212fed678702583f4a555641208cf1c7b45b829 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 b10c06f0c5..52aa8d0290 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 @@ -20,7 +20,8 @@ import org.opendaylight.yangtools.concepts.AbstractObjectRegistration import org.opendaylight.yangtools.concepts.ListenerRegistration import org.opendaylight.yangtools.concepts.Registration import org.opendaylight.yangtools.yang.binding.Notification -import org.slf4j.LoggerFactory import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder +import org.slf4j.LoggerFactory +import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder import com.google.common.collect.Multimaps class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable { @@ -30,12 +31,12 @@ class NotificationBrokerImpl implements NotificationProviderService, AutoCloseab var ExecutorService executor; new() { - listeners = HashMultimap.create() + listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create()) } @Deprecated new(ExecutorService executor) { - listeners = HashMultimap.create() + listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create()) this.executor = executor; } @@ -174,14 +175,24 @@ class NotifyTask implements Callable { private static val log = LoggerFactory.getLogger(NotifyTask); + @SuppressWarnings("rawtypes") val NotificationListener listener; val Notification notification; override call() { + //Only logging the complete notification in debug mode try { - log.info("Delivering notification {} to {}",notification,listener); + if(log.isDebugEnabled){ + log.debug("Delivering notification {} to {}",notification,listener); + } else { + log.trace("Delivering notification {} to {}",notification.class.name,listener); + } listener.onNotification(notification); - log.info("Notification delivered {} to {}",notification,listener); + if(log.isDebugEnabled){ + log.debug("Notification delivered {} to {}",notification,listener); + } else { + log.trace("Notification delivered {} to {}",notification.class.name,listener); + } } catch (Exception e) { log.error("Unhandled exception thrown by listener: {}", listener, e); }