Quartz特点

来源:互联网 发布:怎么把一个淘宝店搞死 编辑:程序博客网 时间:2024/05/17 06:42

运行环境

  • 嵌入式石英可以运行在另一个自由站立应用
  • 石英可以在一个应用服务器实例(或servlet容器),并参与XA事务
  • 石英可以运行一个独立的程序(在它自己的Java虚拟机),将通过RMI使用
  • 石英可以实例作为一个独立的集群(负载平衡和故障切换功能,单独程序)

Job Scheduling作业调度

工作是计划运行给定的触发器时发生。 触发器可以创建几乎任何下列指令的组合:

  • 在一天的特定时间(以毫秒)
  • 在一周的某几天
  • 在该月的某几天
  • 在一年中的某些天
  • 没有登记在日历中所列的某些天(如商业假期)
  • 重复某个特定时期的数目
  • 反复进行,直到一个特定的时间/日期
  • 重复无限期
  • 反复延迟间隔

Jobs are given names by their creator and can also be organized into named groups.乔布斯被其创建者的名字,也可以到一个名为群体组织。 Triggers may also be given names and placed into groups, in order to easily organize them within the scheduler.触发器也可以本人名字和成组放置,以便能方便地组织他们在调度。 Jobs can be added to the scheduler once, but registered with multiple Triggers.乔布斯可以添加到调度一次,而是多个触发器注册。 Within a J2EE environment, Jobs can perform their work as part of a distributed (XA) transaction.在J2EE环境中,乔布斯可以执行其工作的一部分,分布式(XA)产品交易。

Job Execution执行工作

  • Jobs can be any Java class that implements the simple Job interface, leaving infinite possibilities for the work your Jobs can perform.乔布斯可以是任何Java类实现了简单的工作界面,使您的工作职位可以进行无限的可能性。
  • Job class instances can be instantiated by Quartz, or by your application's framework.就业类的实例可以被实例化的石英,或应用程序的框架。
  • When a Trigger occurs, the scheduler notifies zero or more Java objects implementing the JobListener and TriggerListener interfaces (listeners can be simple Java objects, or EJBs, or JMS publishers, etc.).当触发时,调度通知零个或多个Java对象实施JobListener和TriggerListener接口(听众可以是简单的Java对象,或EJB或JMS出版社等)。 These listeners are also notified after the Job has executed.这些听众也通知后,工作已执行。
  • As Jobs are completed, they return a JobCompletionCode which informs the scheduler of success or failure.由于工作完成后,他们返回JobCompletionCode的通知成败的调度。 The JobCompletionCode can also instruct the scheduler of any actions it should take based on the success/fail code - such as immediate re-execution of the Job.该JobCompletionCode还可以指示任何应采取的行动的成功调度/失败代码-如即时再就业执行。

Job Persistence工作持久性

  • The design of Quartz includes a JobStore interface that can be implemented to provide various mechanisms for the storage of jobs.在石英设计包括一个JobStore接口,可实施提供就业存储的各种机制。
  • With the use of the included JDBCJobStore, all Jobs and Triggers configured as "non-volatile" are stored in a relational database via JDBC.随着包括JDBCJobStore,所有工作和触发器配置为使用“非挥发性”是存储在关系数据库通过JDBC。
  • With the use of the included RAMJobStore, all Jobs and Triggers are stored in RAM and therefore do not persist between program executions - but this has the advantage of not requiring an external database.随着包括RAMJobStore,所有工作和触发器使用存储在RAM中,因此没有坚持执行的程序之间-但这并没有要求对外部数据库的优势。

Transactions交易

  • Quartz can participate in JTA transactions, via the use of JobStoreCMT (a subclas of JDBCJobStore).石英可以参与到JTA事务中通过了JobStoreCMT使用,JDBCJobStore(1 subclas)。
  • Quartz can manage JTA transactions (begin and commit them) around the execution of a Job, so that the work performed by the Job automatically happens within a JTA transaction.石英可以管理JTA事务(开始并提交它们)围绕一个作业的执行,这样的工作会自动完成的工作在一个JTA事务发生。

Clustering聚类

  • Fail-over.故障切换。
  • Load balancing.负载平衡。
  • Quartz's built-in clustering features rely upon database persistence via JDBCJobStore (described above).石英内置的集群功能,数据库持久化后,通过JDBCJobStore依赖(如上所述)。
  • Terracotta extensions to Quartz provide clustering capabilities without the need for a backing database.秦始皇扩展石英没有提供集群为后盾的数据库需要的能力。

Listeners & Plug-Ins听众和插件

  • Applications can catch scheduling events to monitor or control job/trigger behavior by implementing one or more listener interfaces.应用程序可以捕获的事件进行调度,监察或管制工作/触发执行一个或多个监听器接口的行为。
  • The Plug-In mechanism can be used add functionality to Quartz, such keeping a history of job executions, or loading job and trigger definitions from a file.该插件机制,可以用来添加功能,石英,这种不让一个文件的工作处决的历史,或装填工作,并触发定义。
  • Quartz ships with a number of "factory built" plug-ins and listeners.与“工厂建成的”插件和听众人数石英船只。