Lets assume I\'m planning to use one executorservice in my entire application, to which I\'m sending new runnable\'s or callable\'s to execute/submit, and I ommit to shutdown ri
You can do one work around. Create the executor as daemon. Then it will automatically end when your application exits. You don't have to explicitly call the shutdown
.
ExecutorService es = Executors.newSingleThreadExecutor( new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
}
});