|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opengts.util.ThreadPool
public class ThreadPool
Thread pool manager
| Field Summary | |
|---|---|
static int |
STOP_NEVER
|
static int |
STOP_NOW
|
static int |
STOP_WAITING
|
| Constructor Summary | |
|---|---|
ThreadPool(java.lang.String name)
Constuctor |
|
ThreadPool(java.lang.String name,
int maxPoolSize)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
_removeThread(org.opengts.util.ThreadPool.ThreadJob thread)
Removes the specified worker thread from the pool |
boolean |
equals(java.lang.Object other)
Returns true if this object is equal to other. |
int |
getMaxSize()
Gets the maximum size of this thread pool |
java.lang.String |
getName()
Gets the name of the thread pool |
int |
getSize()
Gets the current size of this thread pool |
java.lang.ThreadGroup |
getThreadGroup()
Gets the thread group of the Threads in this pool |
static void |
main(java.lang.String[] argv)
Main entry point for testing/debugging |
void |
run(java.lang.Runnable job)
Adds a new job to the thread pool's queue |
void |
setMaxSize(int maxSize)
Sets the maximum size of this thread pool |
void |
stopThreads()
Stops all threads in this pool once queued jobs are complete |
java.lang.String |
toString()
Returns the name of the thread pool |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int STOP_WAITING
public static final int STOP_NEVER
public static final int STOP_NOW
| Constructor Detail |
|---|
public ThreadPool(java.lang.String name)
name - The name of the thread pool
public ThreadPool(java.lang.String name,
int maxPoolSize)
name - The name of the thread poolmaxPoolSize - The maximum number of threads in the thread pool[CHECK]| Method Detail |
|---|
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
other. This will
only return true if they are the same object
equals in class java.lang.Objectother - The object to check equality with
other is the same objectpublic java.lang.ThreadGroup getThreadGroup()
public int getSize()
public void setMaxSize(int maxSize)
maxSize - The maximum size of the thread poolpublic int getMaxSize()
public void run(java.lang.Runnable job)
job - The job to add to the queuepublic void stopThreads()
protected void _removeThread(org.opengts.util.ThreadPool.ThreadJob thread)
thread - The thread to remove from the poolpublic static void main(java.lang.String[] argv)
argv - Comand-line arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||