CompletableFuture/parallelStream in JavaEE app server
<p>Given the new Java8 we are getting really nice features for asynchronous tasks, e.g. CompletableFuture and .paralellStream(). If you run this in Java SE as I've understood it you will utilize the ForkJoinPool, but what happens if I run the following examples in e.g. Wildfly or TomcatEE?</p>

<pre><code>//Here I start a comp.Future without giving an Executor
test = CompletableFuture.supplyAsync(() -&gt; timeConsumingMethod());
//Here I start a parallel stream 
mList.paralell().filter(...).collect(Collectors.toList())
</code></pre>

<p>What happens and where will I borrow my resources from if</p>

<ol>
<li>The examples are ran in a @Stateful bean</li>
<li>The examples are ran in a @Stateless bean</li>
<li>The examples are ran in a CDI bean</li>
</ol>