|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ThreadGroup
org.jasig.portal.utils.ThreadPool
public class ThreadPool
A thread pool implementation with a few extra kinks, such as ThreadPoolReceipt.
| Constructor Summary | |
|---|---|
ThreadPool(String name,
ResourceLimits rl)
|
|
| Method Summary | |
|---|---|
protected void |
addNewWorker()
Adds a new worker. |
protected void |
addWorker()
Grow the size of the worker pool. |
protected void |
adjustSize(int newSize)
Adjust the size of the worker pool. |
void |
clear()
Clears all of the workers. |
void |
clearIdle()
Clears all of the idle workers |
ThreadPoolReceipt |
execute(Runnable target)
|
protected void |
killWorkerThread(ThreadPoolWorker pw)
|
protected void |
notifyWorkerFinished(ThreadPoolWorker pw)
Notifies the pool that a certain worker has finished. |
protected void |
notifyWorkerRestart(ThreadPoolWorker pw)
Notifies the pool that a certain worker is done and wants to have a replacement started. |
protected boolean |
releaseWorker(ThreadPoolWorker worker)
Signals the worker that it should quite as soon as a job (if any) is complete |
protected void |
stopWorker(ThreadPoolWorker worker)
Signals the worker that it try to interrupt the current job and quit. |
void |
uncaughtException(Thread t,
Throwable e)
Handle the case when some worker crashes |
| Methods inherited from class java.lang.ThreadGroup |
|---|
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadPool(String name,
ResourceLimits rl)
| Method Detail |
|---|
public ThreadPoolReceipt execute(Runnable target)
throws InterruptedException
InterruptedExceptionprotected void adjustSize(int newSize)
protected void addWorker()
protected void stopWorker(ThreadPoolWorker worker)
protected boolean releaseWorker(ThreadPoolWorker worker)
protected void addNewWorker()
public void clearIdle()
public void clear()
public void uncaughtException(Thread t,
Throwable e)
uncaughtException in interface Thread.UncaughtExceptionHandleruncaughtException in class ThreadGroupprotected void notifyWorkerRestart(ThreadPoolWorker pw)
protected void killWorkerThread(ThreadPoolWorker pw)
protected void notifyWorkerFinished(ThreadPoolWorker pw)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||