@Deprecated
public abstract class ThreadPool<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ThreadPool.MyThread
Deprecated.
|
(package private) class |
ThreadPool.MyThreadGroup
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.atomic.AtomicInteger |
_inProgress
Deprecated.
|
(package private) int |
_maxThreads
Deprecated.
|
private ThreadPool.MyThreadGroup |
_myThreadGroup
Deprecated.
|
(package private) java.lang.String |
_name
Deprecated.
|
private java.util.concurrent.BlockingQueue<T> |
_queue
Deprecated.
|
private java.util.List<ThreadPool.MyThread> |
_threads
Deprecated.
|
| Constructor and Description |
|---|
ThreadPool(java.lang.String name,
int numThreads)
Deprecated.
Initializes a new thread pool with a given name and number of threads.
|
ThreadPool(java.lang.String name,
int numThreads,
int maxQueueSize)
Deprecated.
Initializes a new thread pool with a given name, number of threads, and queue size.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
handle(T t)
Deprecated.
Handles a given object.
|
abstract void |
handleError(T t,
java.lang.Exception e)
Deprecated.
Handles a given object and exception.
|
int |
inProgress()
Deprecated.
|
int |
numThreads()
Deprecated.
|
boolean |
offer(T t)
Deprecated.
Adds a new object to the pool, if possible.
|
int |
queueSize()
Deprecated.
Returns the size of the pool's queue.
|
final java.lang.String _name
final int _maxThreads
private final java.util.concurrent.atomic.AtomicInteger _inProgress
private final java.util.List<ThreadPool.MyThread> _threads
private final java.util.concurrent.BlockingQueue<T> _queue
private final ThreadPool.MyThreadGroup _myThreadGroup
public ThreadPool(java.lang.String name,
int numThreads)
name - identifying namenumThreads - the number of threads allowed in the poolpublic ThreadPool(java.lang.String name,
int numThreads,
int maxQueueSize)
name - identifying namenumThreads - the number of threads allowed in the poolmaxQueueSize - the size of the pool entry queuepublic abstract void handle(T t) throws java.lang.Exception
t - the object to handlejava.lang.Exceptionpublic abstract void handleError(T t, java.lang.Exception e)
t - the object to handlee - the exception to handlepublic int queueSize()
public boolean offer(T t)
t - the object to be addedpublic int inProgress()
public int numThreads()