Class ShutdownManager

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class ShutdownManager
    extends java.lang.Object
    implements java.io.Closeable
    • Constructor Summary

      Constructors 
      Constructor Description
      ShutdownManager()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutor​(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
      executorToShutdown.shutdown() -> timed wait for graceful termination -> executorToShutdown.shutdownNow()
      java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNow​(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName, java.time.Duration timeout)
      executorToShutdown.shutdownNow() -> timed wait for a graceful termination
      java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNowUntimed​(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
      executorToShutdown.shutdownNow() -> unlimited wait for termination
      java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorUntimed​(java.util.concurrent.ExecutorService executorToShutdown, java.lang.String executorName)
      executorToShutdown.shutdown() -> unlimited wait for graceful termination
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShutdownManager

        public ShutdownManager()
    • Method Detail

      • shutdownExecutorNow

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNow​(java.util.concurrent.ExecutorService executorToShutdown,
                                                                                          java.lang.String executorName,
                                                                                          java.time.Duration timeout)
        executorToShutdown.shutdownNow() -> timed wait for a graceful termination
      • shutdownExecutorNowUntimed

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorNowUntimed​(java.util.concurrent.ExecutorService executorToShutdown,
                                                                                                 java.lang.String executorName)
        executorToShutdown.shutdownNow() -> unlimited wait for termination
      • shutdownExecutor

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutor​(java.util.concurrent.ExecutorService executorToShutdown,
                                                                                       java.lang.String executorName,
                                                                                       java.time.Duration timeout)
        executorToShutdown.shutdown() -> timed wait for graceful termination -> executorToShutdown.shutdownNow()
      • shutdownExecutorUntimed

        public java.util.concurrent.CompletableFuture<java.lang.Void> shutdownExecutorUntimed​(java.util.concurrent.ExecutorService executorToShutdown,
                                                                                              java.lang.String executorName)
        executorToShutdown.shutdown() -> unlimited wait for graceful termination
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable