开发者

How to schedule a job in Quartz that repeats forever?

开发者 https://www.devze.com 2023-01-13 11:01 出处:网络
Is it possible to repeat a job in Quartz forever in a serial way? Now, if I don\'t set RepeatInterval I get an error saying that RepeatInterval cannot be zero.

Is it possible to repeat a job in Quartz forever in a serial way?

Now, if I don't set RepeatInterval I get an error saying that RepeatInterval cannot be zero.

Is it possible to configure this using Spring.NET? What I have now is this:

<?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>

I don't want different threads executing the same job. I just want DoIt to be triggered. If DoIt is finished, then DoIt is triggered again. Like a infinitive while loo开发者_运维百科p.


'RepeatCount' set to '-1'

0

精彩评论

暂无评论...
验证码 换一张
取 消