Changed multimaps to synchronized multimaps
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / impl / NotificationBrokerImpl.xtend
index b0939a043f68c72f7f994fa538a005d4942f08ea..52aa8d029066b3093a90300f6bb078886b2b3d7b 100644 (file)
@@ -21,8 +21,8 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration
 import org.opendaylight.yangtools.concepts.Registration\r
 import org.opendaylight.yangtools.yang.binding.Notification\r
 import org.slf4j.LoggerFactory\r
-import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder\r
-\r
+import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder\rimport com.google.common.collect.Multimaps
+
 class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable {\r
 \r
     val Multimap<Class<? extends Notification>, NotificationListener<?>> listeners;\r
@@ -31,12 +31,12 @@ class NotificationBrokerImpl implements NotificationProviderService, AutoCloseab
     var ExecutorService executor;\r
 \r
     new() {\r
-        listeners = HashMultimap.create()\r
+        listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create())\r
     }\r
 \r
     @Deprecated\r
     new(ExecutorService executor) {\r
-        listeners = HashMultimap.create()\r
+        listeners = Multimaps.synchronizedSetMultimap(HashMultimap.create())\r
         this.executor = executor;\r
     }\r
 \r
@@ -175,6 +175,7 @@ class NotifyTask implements Callable<Object> {
 \r
     private static val log = LoggerFactory.getLogger(NotifyTask);\r
 \r
+    @SuppressWarnings("rawtypes")\r
     val NotificationListener listener;\r
     val Notification notification;\r
 \r
@@ -184,13 +185,13 @@ class NotifyTask implements Callable<Object> {
             if(log.isDebugEnabled){\r
                 log.debug("Delivering notification {} to {}",notification,listener);\r
             } else {\r
-                log.info("Delivering notification {} to {}",notification.class.name,listener);\r
+                log.trace("Delivering notification {} to {}",notification.class.name,listener);\r
             }\r
             listener.onNotification(notification);\r
             if(log.isDebugEnabled){\r
                 log.debug("Notification delivered {} to {}",notification,listener);\r
             } else {\r
-                log.info("Notification delivered {} to {}",notification.class.name,listener);\r
+                log.trace("Notification delivered {} to {}",notification.class.name,listener);\r
             }\r
         } catch (Exception e) {\r
             log.error("Unhandled exception thrown by listener: {}", listener, e);\r