Class DelegatingThreadPool

    • Constructor Detail

      • DelegatingThreadPool

        public DelegatingThreadPool​(java.util.concurrent.Executor executor)
    • Method Detail

      • getExecutor

        public java.util.concurrent.Executor getExecutor()
      • setExecutor

        public void setExecutor​(java.util.concurrent.Executor executor)
      • execute

        public void execute​(java.lang.Runnable job)
        Specified by:
        execute in interface java.util.concurrent.Executor
        Specified by:
        execute in interface TryExecutor
      • tryExecute

        public boolean tryExecute​(java.lang.Runnable task)
        Description copied from interface: TryExecutor
        Attempt to execute a task.
        Specified by:
        tryExecute in interface TryExecutor
        task - The task to be executed
        True IFF the task has been given directly to a thread to execute. The task cannot be queued pending the later availability of a Thread.
      • getIdleThreads

        public int getIdleThreads()
        Specified by:
        getIdleThreads in interface ThreadPool
        The number of idle threads in the pool
      • getThreads

        public int getThreads()
        Specified by:
        getThreads in interface ThreadPool
        The total number of threads currently in the pool
      • isLowOnThreads

        public boolean isLowOnThreads()
        Specified by:
        isLowOnThreads in interface ThreadPool
        True if the pool is low on threads
      • join

        public void join()
                  throws java.lang.InterruptedException
        Description copied from interface: ThreadPool
        Blocks until the thread pool is stopped.
        Specified by:
        join in interface ThreadPool
        java.lang.InterruptedException - if thread was interrupted
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Stops the managed lifecycle beans in the reverse order they were added.
        doStop in class ContainerLifeCycle
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state