Class ThreadPoolService

    • Field Detail

      • threadpool

        protected IThreadPool threadpool
        The threadpool.
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable task)
        Execute a task in its own thread.
        Specified by:
        execute in interface IThreadPool
        Parameters:
        task - The task to execute.
      • executeForever

        public void executeForever​(java.lang.Runnable task)
        Execute a task in its own thread. The pool expects the thread executing the task to never return. Preferably use this method if you want to permanently retrieve a thread e.g. for repeated blocking operations. Consider requesting the daemon version.
        Specified by:
        executeForever in interface IThreadPool
        Parameters:
        task - The task to execute.
      • dispose

        public void dispose()
        Shutdown the thread pool.
        Specified by:
        dispose in interface IThreadPool
      • isRunning

        public boolean isRunning()
        Test if the thread pool is running.
        Specified by:
        isRunning in interface IThreadPool