|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
net.spy.SpyThread
net.spy.util.LoopingThread
net.spy.util.ThreadPoolManager
public class ThreadPoolManager
Management thread for managing a ThreadPool. This thread basically gets to hear about everything that's going on and can make the decision to spawn more threads, or kill some off if necessary.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class net.spy.util.LoopingThread |
|---|
DEFAULT_MS_PER_LOOP |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
ThreadPoolManager(java.lang.ThreadGroup tg)
Get an instance of ThreadPoolManager. |
|
| Method Summary | |
|---|---|
protected void |
checkTooFewThreads()
Check to see if there are too few threads to handle the current work load. |
protected void |
checkTooManyThreads()
Check to see if there are too many idle threads. |
protected ThreadPool |
getThreadPool()
Get the ThreadPool we're watching. |
protected void |
runLoop()
Check to see if we should start up or shut down any threads. |
void |
setThreadPool(ThreadPool t)
Set the ThreadPool to watch. |
void |
start()
Initialize this ThreadPoolManager. |
| Methods inherited from class net.spy.util.LoopingThread |
|---|
getMsPerLoop, performDelay, requestStop, run, setMsPerLoop |
| Methods inherited from class net.spy.SpyThread |
|---|
getLogger |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadPoolManager(java.lang.ThreadGroup tg)
tg - the thread group in which the pool manager will exist| Method Detail |
|---|
protected ThreadPool getThreadPool()
public final void setThreadPool(ThreadPool t)
public void start()
start in class java.lang.Threadprotected void checkTooFewThreads()
protected void checkTooManyThreads()
The shutdown should be slow, no more than one thread per loop.
protected void runLoop()
runLoop in class LoopingThread
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||