openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1797231 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java webbeans-tck/testng-dev.xml
Date Thu, 01 Jun 2017 15:10:50 GMT
Author: rmannibucau
Date: Thu Jun  1 15:10:49 2017
New Revision: 1797231

URL: http://svn.apache.org/viewvc?rev=1797231&view=rev
Log:
making back async event async

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
    openwebbeans/trunk/webbeans-tck/testng-dev.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=1797231&r1=1797230&r2=1797231&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
Thu Jun  1 15:10:49 2017
@@ -40,6 +40,7 @@ import java.util.concurrent.ConcurrentHa
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.ForkJoinPool;
 import java.util.stream.Stream;
 
 import javax.enterprise.context.RequestScoped;
@@ -799,15 +800,17 @@ public final class NotificationManager
                                            NotificationOptions notificationOptions)
     {
         CompletableFuture<?> future = new CompletableFuture<>();
-        try
-        {
-            runAsync(event, metadata, observer);
-            future.complete(null);
-        }
-        catch (final WebBeansException wbe)
-        {
-            future.completeExceptionally(wbe.getCause());
-        }
+        CompletableFuture.runAsync(() -> {
+            try
+            {
+                runAsync(event, metadata, observer);
+                future.complete(null);
+            }
+            catch (final WebBeansException wbe)
+            {
+                future.completeExceptionally(wbe.getCause());
+            }
+        }, notificationOptions.getExecutor() == null ? ForkJoinPool.commonPool() : notificationOptions.getExecutor());
         return future;
     }
 

Modified: openwebbeans/trunk/webbeans-tck/testng-dev.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/testng-dev.xml?rev=1797231&r1=1797230&r2=1797231&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/testng-dev.xml (original)
+++ openwebbeans/trunk/webbeans-tck/testng-dev.xml Thu Jun  1 15:10:49 2017
@@ -18,7 +18,7 @@
 <suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue">
   <test name="JSR-346 TCK">
     <classes>
-          <class name="org.jboss.cdi.tck.tests.lookup.dynamic.DynamicLookupTest" />
+          <class name="org.jboss.cdi.tck.tests.event.observer.async.handlingExceptions.MultipleExceptionsInObserversNotificationTest"
/>
       <!--
       <class name="org.jboss.cdi.tck.tests.event.parameterized.ParameterizedEventTest"
/>
       <class name="org.jboss.cdi.tck.tests.event.fires.FireEventTest" />



Mime
View raw message