`
hai0378
  • 浏览: 528291 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Quartz Enterprise Job Scheduler 1.x Configuration Reference

 
阅读更多

Quartz Enterprise Job Scheduler 1.x Configuration Reference

Configure JDBC-JobStoreTX

JDBCJobStore is used to store scheduling information (job, triggers and calendars) within a relational database. There are actually two seperate JDBCJobStore classes that you can select between, depending on the transactional behaviour you need.

JobStoreTX manages all transactions itself by calling commit() (or rollback()) on the database connection after every action (such as the addition of a job). JDBCJobStore is appropriate if you are using Quartz in a stand-alone application, or within a servlet container if the application is not using JTA transactions.

The JobStoreTX is selected by setting the 'org.quartz.jobStore.class' property as such:

Setting The Scheduler's JobStore to JobStoreTX

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

JobStoreTX can be tuned with the following properties:

Property Name Required Type Default Value
org.quartz.jobStore.driverDelegateClass yes string null
org.quartz.jobStore.dataSource yes string null
org.quartz.jobStore.tablePrefix no string "QRTZ_"
org.quartz.jobStore.useProperties no boolean false
org.quartz.jobStore.misfireThreshold no int 60000
org.quartz.jobStore.isClustered no boolean false
org.quartz.jobStore.clusterCheckinInterval no long 15000
org.quartz.jobStore.maxMisfiresToHandleAtATime no int 20
org.quartz.jobStore.dontSetAutoCommitFalse no boolean false
org.quartz.jobStore.selectWithLockSQL no string "SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ? FOR UPDATE"
org.quartz.jobStore.txIsolationLevelSerializable no boolean false
org.quartz.jobStore.acquireTriggersWithinLock no boolean false
org.quartz.jobStore.lockHandler.class no string null

org.quartz.jobStore.driverDelegateClass

Driver delegates understand the particular 'dialects' of varies database systems. Possible choices include:

  • org.quartz.impl.jdbcjobstore.StdJDBCDelegate (for fully JDBC-compliant drivers)
  • org.quartz.impl.jdbcjobstore.MSSQLDelegate (for Microsoft SQL Server, and Sybase)
  • org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
  • org.quartz.impl.jdbcjobstore.WebLogicDelegate (for WebLogic drivers)
  • org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
  • org.quartz.impl.jdbcjobstore.oracle.WebLogicOracleDelegate (for Oracle drivers used within Weblogic)
  • org.quartz.impl.jdbcjobstore.oracle.weblogic.WebLogicOracleDelegate (for Oracle drivers used within Weblogic)
  • org.quartz.impl.jdbcjobstore.CloudscapeDelegate
  • org.quartz.impl.jdbcjobstore.DB2v6Delegate
  • org.quartz.impl.jdbcjobstore.DB2v7Delegate
  • org.quartz.impl.jdbcjobstore.HSQLDBDelegate
  • org.quartz.impl.jdbcjobstore.PointbaseDelegate

Note that many databases are known to work with the StdJDBCDelegate, while others are known to work with delegates for other databases, for example Derby works well with the Cloudscape delegate (no surprise there).

org.quartz.jobStore.dataSource

The value of this property must be the name of one the DataSources defined in the configuration properties file. See theconfiguration docs for DataSources for more information.

org.quartz.jobStore.tablePrefix

JDBCJobStore's "table prefix" property is a string equal to the prefix given to Quartz's tables that were created in your database. You can have multiple sets of Quartz's tables within the same database if they use different table prefixes.

org.quartz.jobStore.useProperties

The "use properties" flag instructs JDBCJobStore that all values in JobDataMaps will be Strings, and therefore can be stored as name-value pairs, rather than storing more complex objects in their serialized form in the BLOB column. This is can be handy, as you avoid the class versioning issues that can arise from serializing your non-String classes into a BLOB.

org.quartz.jobStore.misfireThreshold

The the number of milliseconds the scheduler will 'tolerate' a trigger to pass its next-fire-time by, before being considered "misfired". The default value (if you don't make an entry of this property in your configuration) is 60000 (60 seconds).

org.quartz.jobStore.isClustered

Set to "true" in order to turn on clustering features. This property must be set to "true" if you are having multiple instances of Quartz use the same set of database tables... otherwise you will experience havoc. See the configuration docs for clustering for more information.

org.quartz.jobStore.clusterCheckinInterval

Set the frequency (in milliseconds) at which this instance "checks-in"* with the other instances of the cluster. Affects the quickness of detecting failed instances.

org.quartz.jobStore.maxMisfiresToHandleAtATime

The maximum number of misfired triggers the jobstore will handle in a given pass. Handling many (more than a couple dozen) at once can cause the database tables to be locked long enough that the performance of firing other (not yet misfired) triggers may be hampered.

org.quartz.jobStore.dontSetAutoCommitFalse

Setting this parameter to "true" tells Quartz not to call setAutoCommit(false) on connections obtained from the DataSource(s). This can be helpful in a few situations, such as if you have a driver that complains if it is called when it is already off. This property defaults to false, because most drivers require that setAutoCommit(false) is called.

org.quartz.jobStore.selectWithLockSQL

Must be a SQL string that selects a row in the "LOCKS" table and places a lock on the row. If not set, the default is "SELECT * FROM {0}LOCKS WHERE LOCK_NAME = ? FOR UPDATE", which works for most databases. The "{0}" is replaced during run-time with the TABLE_PREFIX that you configured above.

org.quartz.jobStore.txIsolationLevelSerializable

A value of "true" tells Quartz (when using JobStoreTX or CMT) to call setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE) on JDBC connections. This can be helpful to prevent lock timeouts with some databases under high load, and "long-lasting" transactions.

org.quartz.jobStore.acquireTriggersWithinLock

Whether or not the acquisition of next triggers to fire should occur within an explicit database lock. This was once necessary (in previous versions of Quartz) to avoid dead-locks with particular databases, but is no longer considered necessary, hence the default value is "false".

org.quartz.jobStore.lockHandler.class

The class name to be used to produce an instance of a org.quartz.impl.jdbcjobstore.Semaphore to be used for locking control on the job store data. This is an advanced configuration feature, which should not be used by most users. By default, Quartz will select the most appropriate (pre-bundled) Semaphore implementation to use. "org.quartz.impl.jdbcjobstore.UpdateLockRowSemaphore" QUARTZ-497 may be of interest to MS SQL Server users. SeeQUARTZ-441.

分享到:
评论

相关推荐

    Quartz Enterprise Job Scheduler 2.2.1 API

    Quartz官方API文档,最新2.2.1版

    quartz-scheduler分享.docx

    使用Quartz-Scheduler时,开发者需要创建Job类实现`org.quartz.Job`接口,然后定义Trigger并关联到Job。最后,通过Scheduler实例启动Job的执行。以下是一个简单的示例: ```java import org.quartz.Job; import org...

    quartz-2.2.0.jar.zip

    开发人员可以定义自定义的作业类,这些类实现了`org.quartz.Job`接口,以实现实际的业务逻辑。触发器则定义了作业何时运行的规则,如简单触发器、cron触发器等。 2. **持久化**:Quartz支持将作业和触发器存储在...

    Autofac.Extras.Quartz, Quartz.Net的Autofac集成.zip

    Autofac.Extras.Quartz, Quartz.Net的Autofac集成 Autofac.Extras.Quartz用于 Quartz.Net的Autofac集成包。Autofac.Extras.Quartz 为每个石英作业创建嵌套的litefime作用域。 完成作业执行后释放嵌套作用域。这允许...

    Spring Quatz 书-Quartz.Job.Scheduling.Framework.Building

    1. **Quartz基础**:首先,书中会介绍Quartz的基本概念,包括Job、Trigger、Scheduler等核心组件,以及它们之间的关系和工作原理。读者可以了解到如何定义作业,如何设置触发器,以及如何通过Scheduler安排作业的...

    quartz-all-1.6.0.jar包定时任务jar

    Job是实际执行的任务,可以是任何实现了`org.quartz.Job`接口的类。Trigger定义了何时启动Job,它可以是简单的定时触发,也可以是复杂的基于日历的触发规则。Scheduler负责管理和执行Jobs和Triggers,它提供了灵活的...

    Quartz Job Scheduling Framework.chm

    Quartz Job Scheduling Framework.chm

    quartz-2.3.0-distribution.tar.gz

    1. **Job(作业)**:这是你想要执行的工作的抽象,可以是一个简单的Java类,实现了 `org.quartz.Job` 接口。Job 类包含 `execute()` 方法,该方法在调度时被调用执行实际任务。 2. **Trigger(触发器)**:定义了 ...

    quartz-1.6.0.jar和quartz-all-1.6.0.jar

    Quartz的灵活性使得它能很好地适应这些需求,开发者可以根据业务逻辑定义不同的Job和Trigger,然后由Quartz负责调度执行。 关于触发器,CronTrigger允许我们根据cron表达式设置触发时间,这种表达式能精确到秒,...

    spring3-quartz1.x

    <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <!-- Quartz properties --> <bean id="myJob" class="org.springframework.scheduling.quartz....

    quartz-all-1.8.5.jar

    quartz-all-1.8.5.jar quartz-all-1.8.5.jar quartz-all-1.8.5.jar quartz-all-1.8.5.jar

    quartz-2.3.0-distribution.zip

    - 创建自定义的Job类,实现`org.quartz.Job`接口,定义任务逻辑。 - 定义Trigger,决定Job的执行时间,可以是SimpleTrigger或CronTrigger。 - 将Job和Trigger注册到Scheduler,通过`Scheduler.scheduleJob()`方法...

    quartz scheduler 入门教程

    quartz scheduler 入门教程 Quartz Scheduler 是一种功能丰富、开源的任务调度程序库,可以在任何 Java 程序中使用。它可以用来创建简单或者复杂的执行次数可以达成千上万的任务。任务可以是任何 Java 可以做的事情...

    quartz-2.2.3-distribution.tar.gz

    使用Quartz时,首先需要在项目中引入`quartz.jar`,然后创建作业类实现`org.quartz.Job`接口,并重写`execute(JobExecutionContext context)`方法。接着,定义触发器,如`CronTrigger`,并关联到作业。最后,通过`...

    quartz所需jar包.rar

    1. 创建 Job 类:实现 `org.quartz.Job` 接口,定义 Job 执行的具体逻辑。 2. 创建 Trigger:根据需要设置触发规则,比如定时、周期性或者根据特定事件触发。 3. 定义 JobDetail:包含 Job 类实例和 Trigger 信息。 ...

    Spring4.X+Quartz2.X

    3. **定义Job**:创建实现`org.springframework.core.task.TaskExecutor`接口的类,或者直接使用`org.springframework.scheduling.quartz.JobDetailBean`,来定义具体的任务逻辑。 4. **配置Trigger**:创建一个...

    quartzall1.6.0jar_quartz-all-1.6.0.jar_

    1. **任务与触发器**:在Quartz中,任务被称为Job,触发器则是控制何时执行这些任务的规则。Job代表了需要执行的工作,而Trigger定义了Job何时应该被执行。你可以创建一次性或周期性的触发器,如每分钟、每天或每周...

    quartz-2.2.2-distribution.rar

    定义一个 Job 类,实现 `org.quartz.Job` 接口,并通过 `@Component` 注解使其成为 Spring Bean。例如: ```java import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz....

    quartz-all-1.6.0.jar

    - **Job**:代表要执行的任务,开发者需要实现 `org.quartz.Job` 接口并重写 `execute` 方法。 - **Trigger**:触发器,定义了任务的执行时间,如 SimpleTrigger 或 CronTrigger。 - **JobDetail**:描述 Job 的实例...

    quartz-jobs-2.3.2.jar中文-英文对照文档.zip

    (1)为了防止解压后路径太长导致浏览器无法打开,推荐在解压时选择“解压到当前文件夹”(放心,自带文件夹,文件不会散落一地); (2)有时,一套Java组件会有多个jar,所以在下载前,请仔细阅读本篇描述,以...

Global site tag (gtag.js) - Google Analytics