|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.scheduler.CmsSchedulerThreadPool
Simple thread pool used for the Quartz scheduler in OpenCms.
| Constructor Summary | |
CmsSchedulerThreadPool()
Create a new CmsSchedulerThreadPool with default values. |
|
CmsSchedulerThreadPool(int initialThreadCount,
int maxThreadCount,
int threadPriority)
Create a new CmsSchedulerThreadPool with the specified number
of threads that have the given priority. |
|
| Method Summary | |
protected Runnable |
getNextRunnable()
Dequeue the next pending Runnable. |
int |
getPoolSize()
|
int |
getThreadPriority()
Returns the thread priority of the threads in the scheduler pool. |
void |
initialize()
|
boolean |
runInThread(Runnable runnable)
Run the given Runnable object in the next available
Thread. |
void |
shutdown()
Terminate any worker threads in this thread group. |
void |
shutdown(boolean waitForJobsToComplete)
Terminate all threads in this thread group. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CmsSchedulerThreadPool()
CmsSchedulerThreadPool with default values.
This will create a pool with 0 initial and 10 maximum threads running
in normal priority.
CmsSchedulerThreadPool(int, int, int)
public CmsSchedulerThreadPool(int initialThreadCount,
int maxThreadCount,
int threadPriority)
CmsSchedulerThreadPool with the specified number
of threads that have the given priority.
The OpenCms scheduler thread pool will initially start with provided number of
active scheduler threads.
When a thread is requested by the scheduler, and no "free" threads are available,
a new thread will be added to the pool and used for execution. The pool
will be allowed to grow until it has reached the configured number
of maximum threads.
initialThreadCount - the initial number of threads for the poolmaxThreadCount - maximum number of threads the pool is allowed to growthreadPriority - the thread priority for the scheduler threadsThread| Method Detail |
public int getPoolSize()
getPoolSize in interface ThreadPoolThreadPool.getPoolSize()public int getThreadPriority()
public void initialize()
throws SchedulerConfigException
initialize in interface ThreadPoolSchedulerConfigExceptionThreadPool.initialize()public boolean runInThread(Runnable runnable)
Runnable object in the next available
Thread.If while waiting the thread pool is asked to shut down, the Runnable is executed immediately within a new additional thread.
runInThread in interface ThreadPoolrunnable - the Runnable to run
Runnable was runpublic void shutdown()
Jobs currently in progress will be allowed to complete.
public void shutdown(boolean waitForJobsToComplete)
shutdown in interface ThreadPoolwaitForJobsToComplete - if true,, all current jobs will be allowed to complete
protected Runnable getNextRunnable()
throws InterruptedException
Runnable.
Runnable
InterruptedException - if something goes wrong
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||