Class ExecutorUtils

java.lang.Object
org.gbif.utils.concurrent.ExecutorUtils

public class ExecutorUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Shuts down an executor and waits up to 1 hour for the already submitted jobs to finish.
    static void
    stop(ExecutorService exec, int timeout, TimeUnit unit)
    Shuts down an executor and waits for the job to finish until the given timeout is reached before forcing an immediate shutdown.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • stop

      public static void stop(ExecutorService exec)
      Shuts down an executor and waits up to 1 hour for the already submitted jobs to finish.
      Parameters:
      exec -
    • stop

      public static void stop(ExecutorService exec, int timeout, TimeUnit unit)
      Shuts down an executor and waits for the job to finish until the given timeout is reached before forcing an immediate shutdown.
      Parameters:
      exec -
      timeout -
      unit -