如何使用 Spring.NET 配置 Quartz.NET 主机 [英] How do I configure Quartz.NET host with Spring.NET
本文介绍了如何使用 Spring.NET 配置 Quartz.NET 主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用 Spring.NET 配置一个 Quartz.NET 实例.除了非常简单的情况外,我一直无法找到如何执行此操作的示例.我不需要任何作业/触发器配置,因为这些都是通过 API 为我们完成的.我需要的是一种配置这些设置的方法.
I need to configure a Quartz.NET instance using Spring.NET. I haven't been able to find an example of how to do this, other than very simple cases. I don't need any of the job/trigger config since those are done via the API for us. What I need is a means to configure these settings.
quartz.scheduler.instanceName = ServerScheduler
quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
quartz.threadPool.threadCount = 10
quartz.threadPool.threadPriority = Normal
quartz.plugin.xml.type = Quartz.Plugin.Xml.JobInitializationPlugin, Quartz
quartz.plugin.xml.fileNames = C:/Tools/Forge/DataImport/Config/quartz_jobs.xml
quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
quartz.jobStore.driverDelegateType = Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz
quartz.jobStore.dataSource = ForgePlatformDatasource
quartz.dataSource.ForgePlatformDatasource.connectionString = Server=172.20.0.113 Database=ForgeQuartz;Uid=sa;Pwd=654321
quartz.dataSource.ForgePlatformDatasource.provider = SqlServer-40
quartz.jobStore.useProperties = true
quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
quartz.scheduler.exporter.port = 555
quartz.scheduler.exporter.bindName = QuartzScheduler
quartz.scheduler.exporter.channelType = tcp
推荐答案
据我所知,您可以在 SchedulerFactoryObject -> QuartzProperties 属性上设置所有配置详细信息.
According to what I remember you can set all your config details on the SchedulerFactoryObject -> QuartzProperties property.
<object name="SomeName" type="Spring.Scheduling.Quartz.SchedulerFactoryObject, Spring.Scheduling.Quartz">
<property name="QuartzProperties">
<dictionary>
<entry key="quartz.scheduler.instanceName" value="ServerScheduler"/>
<entry key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz"/>
<entry key="quartz.threadPool.threadCount" value="10"/>
... and many more ...
</dictionary>
</property>
</object>
API 文档:
/// <summary>
/// Set Quartz properties, like "quartz.threadPool.type".
/// </summary>
/// <remarks>
/// Can be used to override values in a Quartz properties config file,
/// or to specify all necessary properties locally.
/// </remarks>
/// <seealso cref="ConfigLocation" />
public virtual IDictionary QuartzProperties
{
set { quartzProperties = value; }
}
这篇关于如何使用 Spring.NET 配置 Quartz.NET 主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文