@Deprecated public abstract class ThreadPool<T> extends Object
Constructor and Description |
---|
ThreadPool(String name,
int numThreads)
Deprecated.
Initializes a new thread pool with a given name and number of threads.
|
ThreadPool(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,
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.
|
public ThreadPool(String name, int numThreads)
name
- identifying namenumThreads
- the number of threads allowed in the poolpublic ThreadPool(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 Exception
t
- the object to handleException
public abstract void handleError(T t, 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()