I\'m quite new to executer services. Liked doing everything myself, but I think it\'s time to trust these services.
I want to hand by Executer
a R
I'd advise taking a look at the com.google.common.util.concurrent package in Guava, specifically the ListenableFuture type and the code related to it.
Once the next release (r10) is out, it'll be easy to create an ExecutorService
that returns ListenableFuture
s using MoreExecutors.listeningDecorator(ExecutorService). You can also currently wrap your Runnable
s/Callable
s in a ListenableFutureTask yourself.
final ListenableFutureTask> task = new ListenableFutureTask