Package overit.geocall.util
Class ExecutorServiceUtils
java.lang.Object
overit.geocall.util.ExecutorServiceUtils
- All Implemented Interfaces:
Serializable
Class used to manage the
ExecutorService instance- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildExecutorService(int nThreads) build anExecutorServicewith the number of threads passed as parametervoidshutdown(ExecutorService executor) Shutdown the instance ofExecutorServicepassed as parameter, if there are running tasks it waits 1 second to terminate them and then force the shutdown
-
Constructor Details
-
ExecutorServiceUtils
public ExecutorServiceUtils()
-
-
Method Details
-
shutdown
Shutdown the instance ofExecutorServicepassed as parameter, if there are running tasks it waits 1 second to terminate them and then force the shutdown- Parameters:
executor- instance to shut down
-
buildExecutorService
build anExecutorServicewith the number of threads passed as parameter- Parameters:
nThreads- number of threads needed- Returns:
- the executor service
-