I would like to invoke a method that send an email. This method has void return type so I do not need to use the Future interface for handling the result. All the Java ee 7 documentation cover this topic if you use session beans. Is there any way to use the async approach for a normal method invocation?
you could use java.util.concurrent.Future
and java.util.concurrent.CompletableFuture
to call your method asynchronously.
Future<Integer> futureInteger = CompletableFuture.supplyAsync(() -> getInteger(parameter));