Class ExecutorServiceUtils

java.lang.Object
overit.geocall.util.ExecutorServiceUtils
All Implemented Interfaces:
Serializable

@Service public class ExecutorServiceUtils extends Object implements Serializable
Class used to manage the ExecutorService instance
See Also:
  • Constructor Details

    • ExecutorServiceUtils

      public ExecutorServiceUtils()
  • Method Details

    • shutdown

      public void shutdown(ExecutorService executor)
      Shutdown the instance of ExecutorService passed 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

      public ExecutorService buildExecutorService(int nThreads)
      build an ExecutorService with the number of threads passed as parameter
      Parameters:
      nThreads - number of threads needed
      Returns:
      the executor service