|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.wsrf.container.ServiceThreadPool
This class is responsible for managing a set of threads. New threads can be added to the pool at any given time.
| Field Summary | |
protected ServiceDispatcher |
dispatcher
|
private static org.globus.util.I18n |
i18n
|
private static org.apache.commons.logging.Log |
logger
|
private java.util.ArrayList |
serviceThreads
|
| Constructor Summary | |
ServiceThreadPool(ServiceDispatcher dispatcher)
|
|
| Method Summary | |
protected ServiceThread |
createThread()
|
int |
getThreads()
Returns the current number of service threads in the pool. |
boolean |
hasThread(java.lang.Thread thread)
Checks the specified thread is in the pool. |
private boolean |
isDone()
|
void |
postReload()
Puts ServiceThreads in post reload mode. |
void |
preReload(int timeout)
Puts ServiceThreads in reload mode and waits until they finish executing the current request (if any) or the given timeout expires. |
void |
removeThread(ServiceThread thread)
Removes the specified thread from the pool. |
int |
startThreads(int threads)
Creates the specified number of threads and adds them to the pool. |
void |
stopThreads()
Requests all of the service threads to stop. |
void |
stopThreads(int numThreads)
Requests the specified number of service threads to stop. |
void |
waitForThreads()
Blocks until the thread pool is empty. |
void |
waitForThreads(int timeout)
Blocks until the thread pool is empty or until the given timeout elapses. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final org.apache.commons.logging.Log logger
private static org.globus.util.I18n i18n
private java.util.ArrayList serviceThreads
protected ServiceDispatcher dispatcher
| Constructor Detail |
public ServiceThreadPool(ServiceDispatcher dispatcher)
| Method Detail |
public int startThreads(int threads)
protected ServiceThread createThread()
public int getThreads()
public void preReload(int timeout)
public void postReload()
public void stopThreads(int numThreads)
public void stopThreads()
public void removeThread(ServiceThread thread)
public boolean hasThread(java.lang.Thread thread)
public void waitForThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForThreads(int timeout)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprivate boolean isDone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||