Java Code Examples for org.springframework.scheduling.quartz.SimpleTriggerFactoryBean#setMisfireInstruction()

The following examples show how to use org.springframework.scheduling.quartz.SimpleTriggerFactoryBean#setMisfireInstruction() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobUtil.java    From spring-boot-quartz-demo with MIT License 5 votes vote down vote up
/**
 * Create a Single trigger.
 * 
 * @param triggerName Trigger name.
 * @param startTime Trigger start time.
 * @param misFireInstruction Misfire instruction (what to do in case of misfire happens).
 * 
 * @return Trigger
 */
protected static Trigger createSingleTrigger(String triggerName, Date startTime, int misFireInstruction){
	SimpleTriggerFactoryBean factoryBean = new SimpleTriggerFactoryBean();
    factoryBean.setName(triggerName);
    factoryBean.setStartTime(startTime);
    factoryBean.setMisfireInstruction(misFireInstruction);
    factoryBean.setRepeatCount(0);
    factoryBean.afterPropertiesSet();
    return factoryBean.getObject();
}
 
Example 2
Source File: SchedulerConfig.java    From ehousechina with Apache License 2.0 5 votes vote down vote up
@Bean(name = "sampleJobTrigger")
public SimpleTriggerFactoryBean sampleJobTrigger(@Qualifier("sampleJobDetail") JobDetail jobDetail) {
	SimpleTriggerFactoryBean factoryBean = new SimpleTriggerFactoryBean();
	factoryBean.setJobDetail(jobDetail);
	factoryBean.setStartDelay(0L);
	factoryBean.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
	factoryBean.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT);
	return factoryBean;
}
 
Example 3
Source File: SchedulerConfig.java    From quartz-manager with Apache License 2.0 5 votes vote down vote up
private static SimpleTriggerFactoryBean createTrigger(JobDetail jobDetail, long pollFrequencyMs,
		int repeatCount) {
	SimpleTriggerFactoryBean factoryBean = new SimpleTriggerFactoryBean();
	factoryBean.setJobDetail(jobDetail);
	factoryBean.setStartDelay(3000L);
	factoryBean.setRepeatInterval(pollFrequencyMs);
	factoryBean.setRepeatCount(repeatCount);
	factoryBean
	.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT);// in case of misfire, ignore all missed triggers and continue
	return factoryBean;
}