I was checking the javadoc of the ExecutorService#shutDown() method and it states:
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.
I understand "are executed" as: it waits until previously submitted tasks finish their execution. But it also states:
This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.
which seems to say that it cancels the tasks that have already been submitted.
Could somebody clarify what happens when calling shutdown and some previously submitted tasks have not finished their execution?
EDIT
I use an executor to launch a few tasks, but after that I don't need the executor any longer so I want to let it know that it can release the threads when the tasks are complete.