Sometimes, you need to improve the way that you look at the threads you use—perhaps to improve your logging features or 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 this.
Building managed threads with returning results
Getting ready
Let's first add our Jakarta EE 8 dependency:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>