如何使用Spring.NET配置Quartz.NET主机

时间:2011-07-29 15:25:13

标签: spring.net quartz.net

我需要使用Spring.NET配置Quartz.NET实例。除了非常简单的情况,我还没有找到如何做到这一点的例子。我不需要任何作业/触发器配置,因为这些是通过API为我们完成的。我需要的是一种配置这些设置的方法。

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

1 个答案:

答案 0 :(得分:1)

根据我的记忆,您可以在SchedulerFactoryObject上设置所有配置详细信息 - > QuartzProperties属性。

<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-Documentation:

    /// <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; }
    }