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

The following examples show how to use org.springframework.scheduling.quartz.SimpleTriggerFactoryBean#setRepeatCount() . 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: BlobStorageConfiguration.java    From mojito with Apache License 2.0 5 votes vote down vote up
@Profile("!disablescheduling")
@Bean
public SimpleTriggerFactoryBean triggerExpiringBlobCleanup(@Qualifier("jobDetailDatabaseBlobStorageCleanupJob") JobDetail job) {
    logger.info("Configure jobDetailDatabaseBlobStorageCleanupJob");
    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setJobDetail(job);
    trigger.setRepeatInterval(Duration.ofMinutes(5).toMillis());
    trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
    return trigger;
}
 
Example 4
Source File: AssetExtractionCleanupJob.java    From mojito with Apache License 2.0 5 votes vote down vote up
@Bean
public SimpleTriggerFactoryBean triggerAssetExtractionCleanup(@Qualifier("jobDetailAssetExtractionCleanup") JobDetail job) {
    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setJobDetail(job);
    trigger.setRepeatInterval(Duration.ofMinutes(5).toMillis());
    trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
    return trigger;
}
 
Example 5
Source File: PollableTaskCleanupJob.java    From mojito with Apache License 2.0 5 votes vote down vote up
@Bean
public SimpleTriggerFactoryBean triggerPollableTaskCleanup(@Qualifier("jobDetailPollableTaskCleanup") JobDetail job) {
    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setJobDetail(job);
    trigger.setRepeatInterval(REPEAT_INTERVAL);
    trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
    return trigger;
}
 
Example 6
Source File: PluralFormUpdaterJob.java    From mojito with Apache License 2.0 5 votes vote down vote up
@Bean
SimpleTriggerFactoryBean triggerPluralFormUpdater(@Qualifier("jobDetailPluralFromUpdater") JobDetail job) {
    SimpleTriggerFactoryBean trigger = new SimpleTriggerFactoryBean();
    trigger.setJobDetail(job);
    trigger.setRepeatInterval(10000);
    trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
    return trigger;
}
 
Example 7
Source File: RepositoryManualScreenshotRunJob.java    From mojito with Apache License 2.0 5 votes vote down vote up
@Bean
public SimpleTriggerFactoryBean triggerRepositoryManualScreenshotRunJob(@Qualifier("repositoryManualScreenshotRun") JobDetail job) {
    SimpleTriggerFactoryBean simpleTriggerFactoryBean = new SimpleTriggerFactoryBean();
    simpleTriggerFactoryBean.setJobDetail(job);
    simpleTriggerFactoryBean.setRepeatCount(0);
    return simpleTriggerFactoryBean;
}
 
Example 8
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;
}