Interface ExecutorServices.TaskFactory<T>

  • Type Parameters:
    T - the type of the result of created tasks
    Enclosing interface:
    ExecutorServices

    public static interface ExecutorServices.TaskFactory<T>
    Instead of submitting a list of tasks to be executed a caller may submit a factory object capable of creating the list of tasks. The size of the underlying thread pool is passed as a parameter. An implementation may or may not consider this parameter when creating the task list.
    Author:
    Jozef Hartinger
    • Method Detail

      • createTasks

        List<Callable<T>> createTasks​(int threadPoolSize)
        Creates a list of tasks to be executed in a thread pool.
        Parameters:
        threadPoolSize - the size of the underlying thread pool
        Returns:
        a list of tasks to be executed in a thread pool