Configuring the Quartz ThreadPool

Table A.2 lists the available properties for configuring the Quartz ThredPool. Only a few of the properties are required, and the rest have reasonable defaults.

Table A.2. The Properties for Configuring the Quartz ThreadPool

Name

Required

Type

Default Value

org.quartz.threadPool.class

Yes

String

null

org.quartz.threadPool.threadCount

Yes

Integer

-1

org.quartz.threadPool.threadPriority

No

Integer

5

org.quartz.threadPool.makeThreadsDaemons

No

boolean

false

org.quartz.threadPool.threadsInheritGroupOf-InitializingThread

No

boolean

TRue

.quartz.threadPool.threadsInheritContext-ClassLoaderOfInitializingThread

No

boolean

false

 

org.quartz.threadPool.class

This is used to specify the class name of the THReadPool implementation you want to use. The ThreadPool that ships with Quartz is org.quartz.simpl.SimpleThreadPool and should be sufficient in most situations. It has very simple behavior and is very well tested. It provides a fixed-size pool of threads that "live" the lifetime of the Scheduler.

org.quartz.threadPool.threadCount

This specifies the number of threads that are available for concurrent execution of jobs. It can be set to a positive integer between 1 and 100. Values greater than 100 are allowed but might be impractical. If you have only a few jobs that fire a few times a day, one thread is plenty. If you have tens of thousands of jobs, with many firing every minute, you probably want a thread count more like 50 or 100.

org.quartz.threadPool.threadPriority

This is used to specify the priority that the worker threads run at. The value can be any integer between 1 and 10. The default is 5, which equates to THRead.NORM_PRIORITY.

org.quartz.threadPool.makeThreadsDaemons

Set this to true to have the threads in the pool created as daemon threads. The default is false.

org.quartz.threadPool.threadsInheritGroupOfInitializingThread

Set this to true if you want new threads to inherit the group of its parent thread. The default is true.

org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread

Set this to true if you want new threads to inherit the Classloader of the parent creating thread. The default is false.

Категории