/** * Exposes the raw executor service for the given category. * <p> * This shouldn't be used for custom task scheduling (use {@link #executor(String)} instead) but rather for other * frameworks which need an executor service. Using this approach, all thread pools of an application are managed * and visible via central facility. * * @param category the category which is used to specify the capacity of the executor * @return the executor service for the given category */ @Nonnull public AsyncExecutor executorService(String category) { return findExecutor(category); }
private void executeNow(ExecutionBuilder.TaskWrapper wrapper) { wrapper.prepare(); AsyncExecutor exec = findExecutor(wrapper.category); wrapper.jobNumber = exec.executed.inc(); wrapper.durationAverage = exec.duration; if (wrapper.synchronizer != null) { scheduleTable.put(wrapper.synchronizer, System.currentTimeMillis()); } exec.execute(wrapper); }