Quartz.NET笔记(十二) Miscellaneous Features of Quartz

本文介绍Quartz调度器的插件系统及任务工厂功能,包括ISchedulerPlugin接口、自动安排任务、事件历史记录等插件,以及如何通过JobFactory自定义任务实例化过程。此外还介绍了Quartz提供的实用Jobs,如发送邮件和调用远程对象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Plug-Ins

Quartz provides an interface (ISchedulerPlugin) for plugging-in additional functionality.

Plugins that ship with Quartz to provide various utililty capabilities can be found documented in the Quartz.Plugins namespace. They provide functionality such as auto-scheduling of jobs upon scheduler startup, logging a history of job and trigger events, and ensuring that the scheduler shuts down cleanly when the virtual machine exits.

JobFactory

When a trigger fires, the Job it is associated to is instantiated via the JobFactory configured on the Scheduler. The default JobFactory simply activates a new instance of the job class. You may want to create your own implementation of JobFactory to accomplish things such as having your application's IoC or DI container produce/initialize the job instance.

See the IJobFactory interface, and the associated Scheduler.SetJobFactory(fact) method.

'Factory-Shipped' Jobs

Quartz also provides a number of utility Jobs that you can use in your application for doing things like sending e-mails and invoking remote objects. These out-of-the-box Jobs can be found documented in the Quartz.Jobs namespace.

 

 

Plug-Ins 插件

Quartz提供了一个接口(ISchedulerPlugin)来插入附加的功能。

Quartz打包来的插件有很多有用的功能,它们在Quartz.Plugins命名空间中找到。他们提供了诸如自动安排任务的日程,将任务和触发器事件的历史记入日志以及虚拟机退出时确保干净地关闭scheduler等的功能。

JobFactory

当触发器触发时,与之相关联的任务被Scheduler中配置的JobFactory所实例化。缺省的JobFactory只是简单地创建一个Job实例。你也许想创建自己的JobFactory实现,以完成诸如让应用的IoC 或者 DI容器产生/初始化job实例的功能。

查看IJobFactory 接口及与之相关的Scheduler.SetJobFactory(fact)方法。

'Factory-Shipped' Jobs

Quartz也提供了一些可以在你的应用中使用的实用的Jobs,比如,发邮件、调用远程对象。这些外来的Job可以在Quartz.Jobs命名空间里中找到。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值