|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.scheduler.CmsSchedulerThreadPool
public class 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 | |
---|---|
int |
blockForAvailableThreads()
|
protected java.lang.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(java.lang.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 blockForAvailableThreads()
ThreadPool
public int getPoolSize()
getPoolSize
in interface org.quartz.spi.ThreadPool
ThreadPool.getPoolSize()
public int getThreadPriority()
public void initialize() throws org.quartz.SchedulerConfigException
initialize
in interface org.quartz.spi.ThreadPool
org.quartz.SchedulerConfigException
ThreadPool.initialize()
public boolean runInThread(java.lang.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 org.quartz.spi.ThreadPool
runnable
- 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 org.quartz.spi.ThreadPool
waitForJobsToComplete
- if true,, all current jobs will be allowed to completeprotected java.lang.Runnable getNextRunnable() throws java.lang.InterruptedException
Runnable
.
Runnable
java.lang.InterruptedException
- if something goes wrong
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |