<font size=2 face="sans-serif">Hello<br>
<br>
I have a customer with the following <br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;@Inject </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Event&lt;Message&gt;
event;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; @Resource</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; ManagedExecutorService
threadPool;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;public void fireAsyncEvent() { </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; System.out.println(&quot;Sending Async-Message
via CDI&quot;); </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; event.fireAsync(new Message(&quot;Hello&quot;)); </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; public
void fireAsyncEvent_2() {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; event.fireAsync(new Message(&quot;Hello&quot;),
NotificationOptions.ofExecutor(threadPool));</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">fireAsyncEvent() eventually results
in an NPE when a JSF class attempts tries to call CDI.current() fireAsyncEvent_2()
works correctly. I was hoping that it would be possible to fix fireAsyncEvent
to remove the dependency on passing in an executor service every time it
is used. <br>
<br>
We currently set an executor service into the weld service registry, and
I was wondering if org.jboss.weld.event.EventImpl fetch the &nbsp;executor
service from the service registry. Either only when fireAsync is called
without any NotificationOptions, or perhaps more aggressively and set the
default executor service if NotificationOptions are provided but do not
explicitly contain an executor service (The javadoc is unclear, but I believe
calling ofExecutor() provides this functionality). <br>
<br>
Before going further with this I wanted to ask for a quick sanity check.
Is this fix plausible? <br>
<br>
Regards<br>
Benjamin<br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>