org.apache.catalina.tribes.transport
Class ThreadPool

java.lang.Object
  extended by org.apache.catalina.tribes.transport.ThreadPool

public class ThreadPool
extends java.lang.Object

Version:
1.0
Author:
not attributable

Nested Class Summary
static interface ThreadPool.ThreadCreator
           
 
Constructor Summary
ThreadPool(int maxThreads, int minThreads, ThreadPool.ThreadCreator creator)
           
 
Method Summary
 int available()
           
 int getMaxThreads()
           
 int getMinThreads()
           
 ThreadPool.ThreadCreator getThreadCreator()
           
 WorkerThread getWorker()
          Find an idle worker thread, if any.
 void returnWorker(WorkerThread worker)
          Called by the worker thread to return itself to the idle pool.
 void setMaxThreads(int maxThreads)
           
 void setMinThreads(int minThreads)
           
protected  void setupThread(WorkerThread thread)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadPool

public ThreadPool(int maxThreads,
                  int minThreads,
                  ThreadPool.ThreadCreator creator)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setupThread

protected void setupThread(WorkerThread thread)

getWorker

public WorkerThread getWorker()
Find an idle worker thread, if any. Could return null.


available

public int available()

returnWorker

public void returnWorker(WorkerThread worker)
Called by the worker thread to return itself to the idle pool.


getMaxThreads

public int getMaxThreads()

getMinThreads

public int getMinThreads()

stop

public void stop()

setMaxThreads

public void setMaxThreads(int maxThreads)

setMinThreads

public void setMinThreads(int minThreads)

getThreadCreator

public ThreadPool.ThreadCreator getThreadCreator()


Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.