@Test public void testExecutorServicePoolCustomSize() { int customPoolSize = 30; System.setProperty("ksi.executor.pool.size", String.valueOf(customPoolSize)); ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) DefaultExecutorServiceProvider.getExecutorService(); Assert.assertEquals(threadPoolExecutor.getMaximumPoolSize(), customPoolSize); }
public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; }
DefaultExecutorServiceProvider { public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; } }
DefaultExecutorServiceProvider { public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; }  }
DefaultExecutorServiceProvider { public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; }  synchronized static ExecutorService getExecutorService(); }
DefaultExecutorServiceProvider { public synchronized static ExecutorService getExecutorService() { if (executorService == null) { executorService = Executors.newCachedThreadPool(); ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize); } return executorService; }  synchronized static ExecutorService getExecutorService();  }