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.

    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.
        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.
        executor - Executor to test type or wrap if necessary
        An implementation of SubmitterExecutor