Class CloseableExecutor

  • All Implemented Interfaces:

    public class CloseableExecutor
    extends Object
    implements AutoCloseable
    AutoCloseable wrapper around an executor.

    This shuts down the wrapped executor when it is closed.

    • Method Detail

      • of

        public static CloseableExecutor of​(ExecutorService executor)
        Returns a closeable executor that wraps a passed in executor.

        The passed in executor is shut down when the returned CloseableExecutor is closed.

        executor - the executor to wrap
        a CloseableExecutor