Merge "Fixed publishDataChangeEvent in 2phase commit"
[controller.git] / opendaylight / md-sal / sal-common-impl / src / main / java / org / opendaylight / controller / md / sal / common / impl / service / AbstractDataBroker.xtend
index 2c3b018..7c6f52f 100644 (file)
@@ -332,21 +332,23 @@ package class TwoPhaseCommit<P extends Path<P>, D, DCL extends DataChangeListene
     }\r
 \r
     def void publishDataChangeEvent(ImmutableList<ListenerStateCapture<P, D, DCL>> listeners) {\r
     }\r
 \r
     def void publishDataChangeEvent(ImmutableList<ListenerStateCapture<P, D, DCL>> listeners) {\r
-        for (listenerSet : listeners) {\r
-            val updatedConfiguration = dataBroker.readConfigurationData(listenerSet.path);\r
-            val updatedOperational = dataBroker.readOperationalData(listenerSet.path);\r
-\r
-            val changeEvent = new DataChangeEventImpl(transaction, listenerSet.initialConfigurationState,\r
-                listenerSet.initialOperationalState, updatedOperational, updatedConfiguration);\r
-            for (listener : listenerSet.listeners) {\r
-                try {\r
-                    listener.instance.onDataChanged(changeEvent);\r
-\r
-                } catch (Exception e) {\r
-                    e.printStackTrace();\r
-                }\r
-            }\r
-        }\r
+        dataBroker.executor.submit [|\r
+            for (listenerSet : listeners) {
+                val updatedConfiguration = dataBroker.readConfigurationData(listenerSet.path);
+                val updatedOperational = dataBroker.readOperationalData(listenerSet.path);
+
+                val changeEvent = new DataChangeEventImpl(transaction, listenerSet.initialConfigurationState,
+                    listenerSet.initialOperationalState, updatedOperational, updatedConfiguration);
+                for (listener : listenerSet.listeners) {
+                    try {
+                        listener.instance.onDataChanged(changeEvent);
+
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }        \r
+        ]\r
     }\r
 \r
     def rollback(List<DataCommitTransaction<P, D>> transactions, Exception e) {\r
     }\r
 \r
     def rollback(List<DataCommitTransaction<P, D>> transactions, Exception e) {\r

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.