我使用SpringMVC(4.x)和Quartz(2.x)。我设置一个bean定义文件来触发一个简单的工作,但是要确保只有在该作业的先前执行已经完成时才会触发该作业。是否有一个参数我可以通知SimpleTriggerFactoryBean
以避免并发执行?
使用repeatInterval
属性,我不会同时解雇工作吗?
<bean id="autoPusherJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="br.teste.AutoMessagePusherJob" />
<property name="jobDataAsMap">
<map>
<entry key="userName" value="SystemCronJob"/>
<entry key="message">
<bean class ="br.teste.model.Message"/>
</entry>
</map>
</property>
<property name="durability" value="true" />
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<property name="jobDetail" ref="autoPusherJob" />
<property name="startDelay" value="1000" />
<property name="repeatInterval" value="1000" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="autoPusherJob" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="simpleTrigger" />
</list>
</property>
</bean>