Class SubmitterExecutorAdapter

  • All Implemented Interfaces:
    java.util.concurrent.Executor, SubmitterExecutor

    public class SubmitterExecutorAdapter
    extends AbstractSubmitterExecutor
    A simple wrapper class for Executor implementations to provide SubmitterExecutor capabilities.

    In addition this implementation returns ListenableFuture future implementations, making it an easy way to convert your favorite executor to use ListenableFutures.

    Since:
    4.8.0 (since 1.0.0 as org.threadly.concurrent.ExecutorWrapper)
    • Constructor Detail

      • SubmitterExecutorAdapter

        public SubmitterExecutorAdapter​(java.util.concurrent.Executor executor)
        Constructors a new wrapper instance with the provided executor to defer calls to.
        Parameters:
        executor - Executor instance.
    • Method Detail

      • adaptExecutor

        public static SubmitterExecutor adaptExecutor​(java.util.concurrent.Executor executor)
        Ensures the provided Executor is of type SubmitterExecutor, adapting it with this class if necessary to provide the interface.
        Parameters:
        executor - Executor to test type or wrap if necessary
        Returns:
        An implementation of SubmitterExecutor