Class TaskRunnerFactory

  • All Implemented Interfaces:
    Executor

    public class TaskRunnerFactory
    extends Object
    implements Executor
    Manages the thread pool for long running tasks. Long running tasks are not always active but when they are active, they may need a few iterations of processing for them to become idle. The manager ensures that each task is processes but that no one task overtakes the system. This is somewhat like cooperative multitasking.
    • Constructor Detail

      • TaskRunnerFactory

        public TaskRunnerFactory()
      • TaskRunnerFactory

        public TaskRunnerFactory​(String name)
      • TaskRunnerFactory

        public TaskRunnerFactory​(String name,
                                 int priority,
                                 boolean daemon,
                                 int maxIterationsPerRun,
                                 boolean dedicatedTaskRunner)
      • TaskRunnerFactory

        public TaskRunnerFactory​(String name,
                                 int priority,
                                 boolean daemon,
                                 int maxIterationsPerRun,
                                 boolean dedicatedTaskRunner,
                                 int maxThreadPoolSize)
    • Method Detail

      • init

        public void init()
      • createDefaultExecutor

        protected ExecutorService createDefaultExecutor()
      • getMaxIterationsPerRun

        public int getMaxIterationsPerRun()
      • setMaxIterationsPerRun

        public void setMaxIterationsPerRun​(int maxIterationsPerRun)
      • getName

        public String getName()
      • setName

        public void setName​(String name)
      • getPriority

        public int getPriority()
      • setPriority

        public void setPriority​(int priority)
      • isDaemon

        public boolean isDaemon()
      • setDaemon

        public void setDaemon​(boolean daemon)
      • isDedicatedTaskRunner

        public boolean isDedicatedTaskRunner()
      • setDedicatedTaskRunner

        public void setDedicatedTaskRunner​(boolean dedicatedTaskRunner)
      • getMaxThreadPoolSize

        public int getMaxThreadPoolSize()
      • setMaxThreadPoolSize

        public void setMaxThreadPoolSize​(int maxThreadPoolSize)
      • setThreadClassLoader

        public void setThreadClassLoader​(ClassLoader threadClassLoader)
      • getShutdownAwaitTermination

        public long getShutdownAwaitTermination()
      • setShutdownAwaitTermination

        public void setShutdownAwaitTermination​(long shutdownAwaitTermination)