Class SchedulingStrategies


  • public class SchedulingStrategies
    extends java.lang.Object
    The factory of SchedulingStrategy.
    Since:
    2.16
    • Field Detail

      • DAEMON_THREAD_FACTORY

        private static final java.util.concurrent.ThreadFactory DAEMON_THREAD_FACTORY
    • Constructor Detail

      • SchedulingStrategies

        public SchedulingStrategies()
    • Method Detail

      • createInvokerStrategy

        public static SchedulingStrategy createInvokerStrategy​(ConsoleStream logger)
        Parameters:
        logger - current error logger
        Returns:
        sequentially executing strategy
      • createParallelStrategy

        public static SchedulingStrategy createParallelStrategy​(ConsoleStream logger,
                                                                int nThreads)
        Parameters:
        logger - current error logger
        nThreads - fixed pool capacity
        Returns:
        parallel scheduling strategy
      • createParallelStrategyUnbounded

        public static SchedulingStrategy createParallelStrategyUnbounded​(ConsoleStream logger)
        Parameters:
        logger - current error logger
        Returns:
        parallel scheduling strategy with unbounded capacity
      • createParallelSharedStrategy

        public static SchedulingStrategy createParallelSharedStrategy​(ConsoleStream logger,
                                                                      java.util.concurrent.ExecutorService threadPool)
        The threadPool passed to this strategy can be shared in other strategies.
        The call SchedulingStrategy.finished() is waiting until own tasks have finished. New tasks will not be scheduled by this call in this strategy. This strategy is not waiting for other strategies to finish. The RunnerScheduler.finished() may freely use SchedulingStrategy.finished().
        Parameters:
        logger - current error logger
        threadPool - thread pool possibly shared with other strategies
        Returns:
        parallel strategy with shared thread pool
        Throws:
        java.lang.NullPointerException - if threadPool is null