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

Quick Search    Search Deep

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

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

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

ThreadPool A pool of threads for dispatching work

Version:
$Revision: 1.3 $

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
NamedThreadPool()
           
NamedThreadPool(int numberOfThreads)
           
NamedThreadPool(int numberOfThreads, int threadPriority)
           
NamedThreadPool(int numberOfThreads, int threadPriority, java.lang.String name)
           
 
Method Summary
 ExceptionListener getExceptionListener()
           
protected  void handleException(java.lang.Throwable t)
           
 void invokeLater(java.lang.Runnable task)
          Dispatch a new task onto this pool
 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

NamedThreadPool

public NamedThreadPool()

NamedThreadPool

public NamedThreadPool(int numberOfThreads)

NamedThreadPool

public NamedThreadPool(int numberOfThreads,
                       int threadPriority)

NamedThreadPool

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

invokeLater

public void invokeLater(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)