@Deprecated
public abstract class ThreadPool<T>
extends java.lang.Object
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.
|
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.Exception
public 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()