如何在Quartz中安排一份永远重复的工作?

Lie*_*oen 4 spring.net quartz.net

是否有可能以串行的方式永远重复Quartz中的工作?

现在,如果我没有设置RepeatInterval,我得到一个错误,说RepeatInterval不能为零.

是否可以使用Spring.NET进行配置?我现在拥有的是:

<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
  <object id="ExampleBusinessObject" type="Edu3.Core.Job.ExampleJob, Edu3.Core"/>

  <object id="JobDetail" 
          type="Spring.Scheduling.Quartz.MethodInvokingJobDetailFactoryObject,
                Spring.Scheduling.Quartz">
    <property name="TargetObject" ref="ExampleBusinessObject" />
    <property name="TargetMethod" value="DoIt" />
    <property name="Concurrent" value="false" />
  </object>

  <object id="SimpleTrigger" 
          type="Spring.Scheduling.Quartz.SimpleTriggerObject, 
                Spring.Scheduling.Quartz">
    <!-- see the example of method invoking job above -->
    <property name="JobDetail" ref="JobDetail" />
    <!-- 10 seconds -->
    <!--<property name="StartDelay" value="5s" />-->
    <!-- repeat every 50 seconds -->
    <property name="RepeatInterval" value="10s" />
  </object>

  <object id="quartzSchedulerFactory" 
          type="Spring.Scheduling.Quartz.SchedulerFactoryObject,
                Spring.Scheduling.Quartz">
    <property name="triggers">
      <list>
        <ref object="SimpleTrigger" />
      </list>
    </property>
  </object>
</objects>
Run Code Online (Sandbox Code Playgroud)

我不希望不同的线程执行相同的工作.我只想要触发DoIt.如果DoIt完成,则再次触发DoIt.就像一个不定式的while循环.

Ait*_*ito 7

'RepeatCount'设置为'-1'