org.objectweb.jonas_ejb.container.ThreadPool Class Reference

List of all members.

Public Member Functions

 ThreadPool ()
 ThreadPool (int size)
 ThreadPool (int minsz, int maxsz)
synchronized void addRunnable (Runnable runner)
synchronized Runnable nextRunnable ()
synchronized void stopThreads ()

Detailed Description

This is a generic Thread Pool. It manages an ArrayList of Runnable Each thread picks one to run it and loop on the next.
Author:
Philippe Coq

Philippe Durieux

Definition at line 38 of file ThreadPool.java.


Constructor & Destructor Documentation

org.objectweb.jonas_ejb.container.ThreadPool.ThreadPool  ) 
 

Create a pool with default values

Definition at line 63 of file ThreadPool.java.

org.objectweb.jonas_ejb.container.ThreadPool.ThreadPool int  size  ) 
 

Create a pool with a number of threads pre allocated

Parameters:
size thread number to start the pool with.

Definition at line 71 of file ThreadPool.java.

org.objectweb.jonas_ejb.container.ThreadPool.ThreadPool int  minsz,
int  maxsz
 

Create a pool with a minimum and a maximum values for thread number.

Parameters:
minsz thread number to start the pool with.
maxsz maximum nb of threads in the pool

Definition at line 80 of file ThreadPool.java.


Member Function Documentation

synchronized void org.objectweb.jonas_ejb.container.ThreadPool.addRunnable Runnable  runner  ) 
 

Add a Runnable in the pool, ready to be run.

Parameters:
runner The runnable object

Definition at line 96 of file ThreadPool.java.

Referenced by org.objectweb.jonas_ejb.container.JMessageDrivenBean.start().

synchronized Runnable org.objectweb.jonas_ejb.container.ThreadPool.nextRunnable  ) 
 

Returns:
the next Runnable to be run.

Definition at line 119 of file ThreadPool.java.

synchronized void org.objectweb.jonas_ejb.container.ThreadPool.stopThreads  ) 
 

Pool is removed: Stop all threads

Definition at line 148 of file ThreadPool.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:10:56 2005 for JOnAS by  doxygen 1.3.9.1