org.apache.commons.threadpool
Class DefaultThreadPool

java.lang.Object
  extended by org.apache.commons.threadpool.DefaultThreadPool
All Implemented Interfaces:
Runnable, ThreadPool

public class DefaultThreadPool
extends Object
implements Runnable, ThreadPool

A default implementation of a ThreadPool which is constructed with a given number of threads.

Version:
$Revision: 155472 $
Author:
James Strachan

Constructor Summary
DefaultThreadPool()
           
DefaultThreadPool(int numberOfThreads)
           
DefaultThreadPool(int numberOfThreads, int threadPriority)
           
DefaultThreadPool(ThreadPoolMonitor monitor, int numberOfThreads)
           
DefaultThreadPool(ThreadPoolMonitor monitor, int numberOfThreads, int threadPriority)
           
 
Method Summary
 int getRunnableCount()
          Returns number of runnable object in the queue.
 void invokeLater(Runnable task)
          Dispatch a new task onto this pool to be invoked asynchronously later
 void run()
          The method ran by the pool of background threads
 void setThreadGroup(ThreadGroup threadGroup)
           
 Thread startThread()
          Start a new thread running
 Thread startThread(int priority)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultThreadPool

public DefaultThreadPool(ThreadPoolMonitor monitor,
                         int numberOfThreads,
                         int threadPriority)

DefaultThreadPool

public DefaultThreadPool(ThreadPoolMonitor monitor,
                         int numberOfThreads)

DefaultThreadPool

public DefaultThreadPool()

DefaultThreadPool

public DefaultThreadPool(int numberOfThreads)

DefaultThreadPool

public DefaultThreadPool(int numberOfThreads,
                         int threadPriority)
Method Detail

setThreadGroup

public void setThreadGroup(ThreadGroup threadGroup)

startThread

public Thread startThread()
Start a new thread running


startThread

public Thread startThread(int priority)

stop

public void stop()

getRunnableCount

public int getRunnableCount()
Returns number of runnable object in the queue.


invokeLater

public void invokeLater(Runnable task)
Dispatch a new task onto this pool to be invoked asynchronously later

Specified by:
invokeLater in interface ThreadPool

run

public void run()
The method ran by the pool of background threads

Specified by:
run in interface Runnable


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.