Interface Graceful

    • Method Detail

      • shutdown

        java.util.concurrent.CompletableFuture<java.lang.Void> shutdown()
        Shutdown the component. When this method returns, the component should not accept any new load.
        Returns:
        A future that is completed once all load on the component is completed
      • isShutdown

        boolean isShutdown()
        Returns:
        True if shutdown() has been called.
      • shutdown

        static java.util.concurrent.CompletableFuture<java.lang.Void> shutdown​(Container component)
        Utility method to shutdown all Gracefuls within a container.
        Parameters:
        component - The container in which to look for Gracefuls
        Returns:
        A CompletableFuture that is complete once all returns from shutdown() of the contained Gracefuls are complete.
      • shutdown

        static java.util.concurrent.CompletableFuture<java.lang.Void> shutdown​(Graceful.ThrowingRunnable runnable)
        Utility method to execute a Graceful.ThrowingRunnable in a new daemon thread and be notified of the result in a CompletableFuture.
        Parameters:
        runnable - the ThrowingRunnable to run.
        Returns:
        the CompletableFuture to be notified when the runnable either completes or fails.