Class InvokerStrategy

    • Field Detail

      • activeThreads

        private final java.util.Queue<java.lang.Thread> activeThreads
    • Constructor Detail

      • InvokerStrategy

        protected InvokerStrategy​(ConsoleStream logger)
    • Method Detail

      • stop

        protected boolean stop()
        Description copied from class: SchedulingStrategy
        Stops scheduling new tasks (e.g. by ExecutorService.shutdown() on a private thread pool which cannot be shared with other strategy).
        Specified by:
        stop in class SchedulingStrategy
        Returns:
        true if successfully stopped the scheduler, else false if already stopped (a shared thread pool was shutdown externally).
        See Also:
        ExecutorService.shutdown()
      • stopNow

        protected boolean stopNow()
        Description copied from class: SchedulingStrategy
        Stops scheduling new tasks and interrupts running tasks (e.g. by ExecutorService.shutdownNow() on a private thread pool which cannot be shared with other strategy).
        This method calls SchedulingStrategy.stop() by default.
        Overrides:
        stopNow in class SchedulingStrategy
        Returns:
        true if successfully stopped the scheduler, else false if already stopped (a shared thread pool was shutdown externally).
        See Also:
        ExecutorService.shutdownNow()
      • hasSharedThreadPool

        public boolean hasSharedThreadPool()
        Specified by:
        hasSharedThreadPool in class SchedulingStrategy
        Returns:
        true if a thread pool associated with this strategy can be shared with other strategies.
      • finished

        public boolean finished()
                         throws java.lang.InterruptedException
        Description copied from class: SchedulingStrategy
        Waiting for scheduled tasks to finish. New tasks will not be scheduled by calling this method.
        Specified by:
        finished in class SchedulingStrategy
        Returns:
        true if successfully stopped the scheduler, else false if already stopped (a shared thread pool was shutdown externally).
        Throws:
        java.lang.InterruptedException - if interrupted while waiting for scheduled tasks to finish
        See Also:
        RunnerScheduler.finished()
      • destroy

        public boolean destroy()
        Description copied from interface: Destroyable
        Calling ThreadPoolExecutor.shutdown() and ThreadPoolExecutor.awaitTermination(long, java.util.concurrent.TimeUnit).
        Returns:
        true if not interrupted in current thread