Suppose I have an Executor executor;
somewhere in my application. Is it sufficient to just say setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
as usual and let "the system" deal with it, or do I have to register a listener and call executor.shutdown();
manually before the application exits?
If this is a stand-alone application and you don't care that any running threads just exit then you really shouldn't have to worry about it.
If your class is running in a VM that's also running other things (for example a servlet container like Tomcat) you need to explicitly shut down the executor or the threads may continue to run (Tomcat will yell at you and tell you that there's threads it couldn't kill and that you're leaking memory).