@@ -0,0 +1,1058 @@
+package roart.queue;%0A%0Aimport java.util.concurrent.Callable;%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.Future;%0Aimport java.util.concurrent.ThreadPoolExecutor;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Apublic class MyExecutors %7B%0A%0A    private static final Logger log = LoggerFactory.getLogger(MyExecutors.class);%0A%0A    private static ThreadPoolExecutor /*ExecutorService*/ pool = null;%0A    %0A    public static void init(double cpu) %7B%0A        if (pool != null) %7B%0A            return;%0A        %7D%0A        if (cpu %3C 1) %7B%0A            cpu = 1;%0A        %7D%0A        int nThreads = (int) (Runtime.getRuntime().availableProcessors() * cpu);%0A        if (nThreads %3C= 10) %7B%0A            nThreads = 10;%0A        %7D%0A        log.info(%22nthreads %7B%7D%22, nThreads);%0A        pool = (ThreadPoolExecutor) Executors.newFixedThreadPool(nThreads);%0A    %7D%0A    %0A    public static %3CT%3E Future%3CT%3E run(Callable%3CT%3E callable) %7B%0A        return pool.submit(callable);%0A    %7D%0A  %0A    public static void run(Runnable callable) %7B%0A        pool.execute(callable);%0A    %7D%0A  %0A%7D

Add executors.