Interface ExecutorServiceFactory<C>

Type Parameters:
C - The type of configuration to use for constructing a ExecutorService.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExecutorServiceFactory<C>
A Functional Interface towards a BiFunction which ingests both a Configuration and a BlockingQueue of Runnable, and outputs an ExecutorService. Provides a means to allow configuration of the used ExecutorService in, for example, the
invalid reference
org.axonframework.commandhandling.distributed.DistributedCommandBus
, but maintaining the option for the framework to provide a BlockingQueue which is tailored towards message prioritization when building the executor.

Before 5.0.0 this class was specific for the Axon Server configuration, but it has been generalized to allow other configurations to provide their own ExecutorService implementations as well.

Since:
5.0.0
Author:
Steven van Beelen
  • Method Details

    • createExecutorService

      @Nonnull ExecutorService createExecutorService(@Nonnull C configuration, @Nonnull BlockingQueue<Runnable> queue)
      Creates an ExecutorService based on the given configuration and queue.
      Parameters:
      configuration - The Configuration to use for the ExecutorService.
      queue - The BlockingQueue to use for the ExecutorService.
      Returns:
      An ExecutorServicebased on the given configuration and queue.