p2ps.imp.endpoint
Class ThreadPool
java.lang.Object
p2ps.imp.endpoint.ThreadPool
- public class ThreadPool
- extends java.lang.Object
A utility thread pool.
- Version:
- $Revision: 295 $
- Author:
- Ian Wang
|
Constructor Summary |
ThreadPool(java.lang.String name)
Constructs a thread pool with default min and max threads and idle time |
ThreadPool(java.lang.String name,
int min,
int max,
int idle)
Constructs a thread pool with specified min and max threads and idle time |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_MINIMUM_THREADS
public static int DEFAULT_MINIMUM_THREADS
DEFAULT_MAXIMUM_THREADS
public static int DEFAULT_MAXIMUM_THREADS
DEFAULT_IDLE_TIME_MILLIS
public static int DEFAULT_IDLE_TIME_MILLIS
ThreadPool
public ThreadPool(java.lang.String name)
- Constructs a thread pool with default min and max threads and idle time
ThreadPool
public ThreadPool(java.lang.String name,
int min,
int max,
int idle)
- Constructs a thread pool with specified min and max threads and idle time
- Parameters:
name - the name of the thread poolmin - the minimum number of threads that is maintained by the poolmax - the maximum number of threads that is maintained by the poolidle - the time a thread is idle before it is disposed
addTask
public void addTask(java.lang.Runnable task)
dispose
public void dispose()