Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed bug when publisher's thread was blocked until all notifications were delivered.
[controller.git]
/
opendaylight
/
md-sal
/
sal-binding-broker
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
binding
/
impl
/
NotificationBrokerImpl.xtend
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 d997af59126833190b26696e752dfcc7061fe352..a7dcf80e8dbd5366ca366b0d2c50fce573a598bf 100644
(file)
--- 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
@@
-23,8
+23,10
@@
import org.opendaylight.yangtools.yang.binding.Notification
import org.slf4j.LoggerFactory
\r
import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder
\r
import com.google.common.collect.Multimaps
\r
import org.opendaylight.yangtools.concepts.util.ListenerRegistry
\r
import org.slf4j.LoggerFactory
\r
import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder
\r
import com.google.common.collect.Multimaps
\r
import org.opendaylight.yangtools.concepts.util.ListenerRegistry
\r
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService.NotificationInterestListener
\r
-
\r
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService.NotificationInterestListener
\r
import java.util.Set
+import com.google.common.collect.ImmutableSet
+import java.util.concurrent.Future
+
class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable {
\r
\r
val ListenerRegistry<NotificationInterestListener> interestListeners = ListenerRegistry.create;
\r
class NotificationBrokerImpl implements NotificationProviderService, AutoCloseable {
\r
\r
val ListenerRegistry<NotificationInterestListener> interestListeners = ListenerRegistry.create;
\r
@@
-100,7
+102,15
@@
class NotificationBrokerImpl implements NotificationProviderService, AutoCloseab
listenerToNotify = listenerToNotify + listeners.get(type as Class<? extends Notification>)
\r
}
\r
val tasks = listenerToNotify.map[new NotifyTask(it, notification)].toSet;
\r
listenerToNotify = listenerToNotify + listeners.get(type as Class<? extends Notification>)
\r
}
\r
val tasks = listenerToNotify.map[new NotifyTask(it, notification)].toSet;
\r
- executor.invokeAll(tasks);
\r
+ submitAll(executor,tasks);
\r
+ }
\r
+
\r
+ def submitAll(ExecutorService service, Set<NotifyTask> tasks) {
+ val ret = ImmutableSet.<Future<Object>>builder();
\r
+ for(task : tasks) {
\r
+ ret.add(service.submit(task));
\r
+ }
\r
+ return ret.build();
}
\r
\r
override <T extends Notification> registerNotificationListener(Class<T> notificationType,
\r
}
\r
\r
override <T extends Notification> registerNotificationListener(Class<T> notificationType,
\r