I am working in a Java project and I have some doubts about the server side.
I have a class, which will have multiples instances (one instance for each client request). In this class, there are 4 different tasks to do, so I have create a ThreadPool with 4 Threads, but my doubt is if the executor has to be static, because I should call a Listener to kill the threads when the server stop, right ?
ExecutorService executor = Executors.newFixedThreadPool(4);
Thank you.