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
        Parameters:
        task - The task to be executed
        Returns:
        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
        Returns:
        The number of idle threads in the pool
      • getThreads

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

        public boolean isLowOnThreads()
        Specified by:
        isLowOnThreads in interface ThreadPool
        Returns:
        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
        Throws:
        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.
        Overrides:
        doStop in class ContainerLifeCycle
        Throws:
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state