Sometimes you need to improve the way you look at the threads you are using; maybe to improve your logging features, maybe to manage their priorities. It would be nice if you could also get the results back from them. This recipe will show you how to do it.
Building managed threads with returning results
Getting ready
Let's first add our Java EE 8 dependency:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>