Class ThreadPool

java.lang.Object
org.apache.axis.components.threadpool.ThreadPool

public class ThreadPool extends Object
Author:
James M Snell (jasnell@us.ibm.com)
  • Field Details

    • log

      protected static org.apache.commons.logging.Log log
    • DEFAULT_MAX_THREADS

      public static final int DEFAULT_MAX_THREADS
      See Also:
    • threads

      protected Map threads
    • threadcount

      protected long threadcount
    • _shutdown

      public boolean _shutdown
  • Constructor Details

    • ThreadPool

      public ThreadPool()
    • ThreadPool

      public ThreadPool(int maxPoolSize)
  • Method Details

    • cleanup

      public void cleanup() throws InterruptedException
      Throws:
      InterruptedException
    • isShutdown

      public boolean isShutdown()
      Returns true if all workers have been shutdown
    • isShuttingDown

      public boolean isShuttingDown()
      Returns true if all workers are in the process of shutting down
    • getWorkerCount

      public long getWorkerCount()
      Returns the total number of currently active workers
    • addWorker

      public void addWorker(Runnable worker)
      Adds a new worker to the pool
    • interruptAll

      public void interruptAll()
      Forcefully interrupt all workers
    • shutdown

      public void shutdown()
      Forcefully shutdown the pool
    • safeShutdown

      public void safeShutdown()
      Forcefully shutdown the pool
    • awaitShutdown

      public void awaitShutdown() throws InterruptedException
      Await shutdown of the worker
      Throws:
      InterruptedException
    • awaitShutdown

      public boolean awaitShutdown(long timeout) throws InterruptedException
      Await shutdown of the worker
      Throws:
      InterruptedException
    • workerDone

      public void workerDone(Runnable worker, boolean restart)
      Used by MessageWorkers to notify the pool that it is done