|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openeai.threadpool.ThreadPoolImpl
public class ThreadPoolImpl
| Constructor Summary | |
|---|---|
ThreadPoolImpl(java.util.Properties props)
|
|
ThreadPoolImpl(ThreadPoolConfig tConfig)
|
|
| Method Summary | |
|---|---|
void |
addJob(java.lang.Runnable job)
Adds a 'job' to the ThreadPool to be executed in a Thread. |
boolean |
checkBeforeProcessing()
Returns a flag indicating whether this ThreadPool should check itself before adding another job to the pool. |
int |
getJobsInProgress()
Returns the number of jobs that are currently in progress for this ThreadPool. |
Stats |
getStats()
Takes a "snapshot" of the threadpool at the current time and returns statistics. |
void |
shutdown()
Sets a flag indicating that the ThreadPool is in a 'shutdown' status. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadPoolImpl(ThreadPoolConfig tConfig)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IllegalArgumentException
public ThreadPoolImpl(java.util.Properties props)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
java.lang.NumberFormatException
java.lang.IllegalArgumentException| Method Detail |
|---|
public boolean checkBeforeProcessing()
ThreadPoolThis is used to verify that the ThreadPool can actually accept and immediately process a job that's added via the addJob method. This is to reduce the number of potential jobs in memory in a "pending" state waiting for the ThreadPool to free up some idle threads.
checkBeforeProcessing in interface ThreadPoolpublic void shutdown()
public void addJob(java.lang.Runnable job)
throws ThreadPoolException
addJob in interface ThreadPooljob - java.lang.Runnable the job to be added to the ThreadPool
- - ThreadPoolException if it has any problems adding the job to the ThreadPool.
ThreadPoolExceptionThreadPool.checkBeforeProcessing()public Stats getStats()
ThreadPool
getStats in interface ThreadPoolStatspublic int getJobsInProgress()
ThreadPool
getJobsInProgress in interface ThreadPool
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||