@Test public void nonSharedPoolStrategy() throws InterruptedException { SchedulingStrategy strategy = SchedulingStrategies.createParallelStrategy( logger, 2 ); assertFalse( strategy.hasSharedThreadPool() ); assertTrue( strategy.canSchedule() ); Task task1 = new Task(); Task task2 = new Task(); strategy.schedule( task1 ); strategy.schedule( task2 ); assertTrue( strategy.canSchedule() ); assertTrue( strategy.finished() ); assertFalse( strategy.canSchedule() ); assertTrue( task1.result ); assertTrue( task2.result ); }
public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); }
SchedulingStrategies { public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); } }
SchedulingStrategies { public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); }  }
SchedulingStrategies { public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); }  static SchedulingStrategy createInvokerStrategy( ConsoleStream logger ); static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ); static SchedulingStrategy createParallelStrategyUnbounded( ConsoleStream logger ); static SchedulingStrategy createParallelSharedStrategy( ConsoleStream logger, ExecutorService threadPool ); }
SchedulingStrategies { public static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ) { return new NonSharedThreadPoolStrategy( logger, Executors.newFixedThreadPool( nThreads, DAEMON_THREAD_FACTORY ) ); }  static SchedulingStrategy createInvokerStrategy( ConsoleStream logger ); static SchedulingStrategy createParallelStrategy( ConsoleStream logger, int nThreads ); static SchedulingStrategy createParallelStrategyUnbounded( ConsoleStream logger ); static SchedulingStrategy createParallelSharedStrategy( ConsoleStream logger, ExecutorService threadPool );  }