taskExecutor.setAsyncMode(false);
// Indicate to the task executor to maintain parallelism
taskExecutor.setMaintainsParallelism(true);
/* Create and launch tasks with the task executor */
FileCounterRecursiveTask task01 = new FileCounterRecursiveTask(new File("C:\\"));
FileCounterRecursiveTask task02 = new FileCounterRecursiveTask(new File("D:\\"));
FileCounterRecursiveTask task03 = new FileCounterRecursiveTask(new File("E:\\"));
// Explicit invalid path in order that the task fail !
FileCounterRecursiveTask task04 = new FileCounterRecursiveTask(new File("A:\\"));
taskExecutor.execute(task01);
taskExecutor.execute(task02);
taskExecutor.execute(task03);
taskExecutor.execute(task04);
System.out.println("Tasks launched...");