Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mule.util
Class ThreadPool  view ThreadPool download ThreadPool.java

java.lang.Object
  extended byorg.mule.util.ThreadPool
All Implemented Interfaces:
java.lang.Runnable

public class ThreadPool
extends java.lang.Object
implements java.lang.Runnable

ThreadPool A pool of threads for dispatching work

Version:
$ Revision: 1.2 $

Field Summary
private  ExceptionListener exceptionListener
           
private static org.apache.commons.logging.Log log
          The logger for this class
private  MTQueue queue
           
private  boolean stopped
           
private  int threadCount
           
 
Constructor Summary
ThreadPool()
           
ThreadPool(int numberOfThreads)
           
ThreadPool(int numberOfThreads, int threadPriority)
           
ThreadPool(int numberOfThreads, int threadPriority, java.lang.String name)
           
 
Method Summary
 void dispatch(java.lang.Runnable task)
          Dispatch a new task onto this pool
 ExceptionListener getExceptionListener()
           
protected  void handleException(java.lang.Throwable t)
           
 void run()
          The method ran by the pool of background threads
 void setExceptionListener(ExceptionListener listener)
           
 int size()
          Returns number of runnable object in the queue.
 java.lang.Thread startThread()
          Start a new thread running
 java.lang.Thread startThread(int priority)
           
 java.lang.Thread startThread(int priority, java.lang.String name)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final transient org.apache.commons.logging.Log log
The logger for this class


queue

private MTQueue queue

stopped

private boolean stopped

exceptionListener

private ExceptionListener exceptionListener

threadCount

private int threadCount
Constructor Detail

ThreadPool

public ThreadPool()

ThreadPool

public ThreadPool(int numberOfThreads)

ThreadPool

public ThreadPool(int numberOfThreads,
                  int threadPriority)

ThreadPool

public ThreadPool(int numberOfThreads,
                  int threadPriority,
                  java.lang.String name)
Method Detail

dispatch

public void dispatch(java.lang.Runnable task)
Dispatch a new task onto this pool


run

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

Specified by:
run in interface java.lang.Runnable

startThread

public java.lang.Thread startThread()
Start a new thread running


startThread

public java.lang.Thread startThread(int priority)

startThread

public java.lang.Thread startThread(int priority,
                                    java.lang.String name)

stop

public void stop()

size

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


handleException

protected void handleException(java.lang.Throwable t)

getExceptionListener

public ExceptionListener getExceptionListener()

setExceptionListener

public void setExceptionListener(ExceptionListener listener)