I am wondering if there is any reason to use an Executor instead of an ExecutorService.
As far as I know there is no implementation of the Executor
interface in the JDK which is not also an ExecutorService
which means you have to shut the service down so that there are no memory leaks. You cannot shut an Executor
down but you can do that with an ExecutorService
.
So, is there any scenario in which you would use something like that:
private final Executor _executor = Executors.newCachedThreadPool();
What is the intention behind the Executor
interface? Examples appreciated.