@@ -0,0 +1,2079 @@
+package org.axonframework.axonserver.connector.util;%0A%0Aimport org.axonframework.axonserver.connector.AxonServerConfiguration;%0Aimport org.axonframework.common.AxonThreadFactory;%0A%0Aimport java.util.concurrent.BlockingQueue;%0Aimport java.util.concurrent.ExecutorService;%0Aimport java.util.concurrent.ThreadPoolExecutor;%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.function.BiFunction;%0A%0A/**%0A * A Functional Interface towards a %7B@link BiFunction%7D which ingests both an %7B@link AxonServerConfiguration%7D and a%0A * %7B@link BlockingQueue%7D of %7B@link Runnable%7D, and outputs an %7B@link ExecutorService%7D. Provides a means to allow%0A * configuration of the used ExecutorService in for example the%0A * %7B@link org.axonframework.axonserver.connector.command.AxonServerCommandBus%7D, but maintaining the option for the%0A * framework to provide a BlockingQueue which is tailored towards message prioritization when building the executor.%0A *%0A * @author Steven van Beelen%0A * @since 4.2%0A */%0A@FunctionalInterface%0Apublic interface ExecutorServiceBuilder extends%0A        BiFunction%3CAxonServerConfiguration, BlockingQueue%3CRunnable%3E, ExecutorService%3E %7B%0A%0A    long THREAD_KEEP_ALIVE_TIME = 100L;%0A%0A    /**%0A     * Create a default ExecutorServiceBuilder uses to create a %7B@link ThreadPoolExecutor%7D for processing incoming%0A     * commands. Uses the %7B@link AxonServerConfiguration#getCommandThreads()%7D as the core and maximum pool size, a%0A     * keep-alive time of %7B@code 100ms%7D, the given %7B@link BlockingQueue%7D as the %7B@code workQueue%7D and an%0A     * %7B@link AxonThreadFactory%7D.%0A     *%0A     * @return a default ExecutorServiceBuilder for processing commands%0A     */%0A    static ExecutorServiceBuilder defaultCommandExecutorServiceBuilder() %7B%0A        return (configuration, commandProcessQueue) -%3E new ThreadPoolExecutor(%0A                configuration.getCommandThreads(),%0A                configuration.getCommandThreads(),%0A                THREAD_KEEP_ALIVE_TIME,%0A                TimeUnit.MILLISECONDS,%0A                commandProcessQueue,%0A                new AxonThreadFactory(%22CommandProcessor%22)%0A        );%0A    %7D%0A%7D%0A

Create an ExecutorServiceBuilder