From d504d69ae54ec59f17b8106167e416d133135519 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 30 Jul 2013 17:21:18 +0200 Subject: [PATCH] Added "requestsRecovery" bean property to JobDetailFactoryBean Issue: SPR-10775 --- .../scheduling/quartz/JobDetailFactoryBean.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java index 8f177da433f..a2d9beebe0c 100644 --- a/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java +++ b/spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ import org.springframework.context.ApplicationContextAware; * sensible defaults. This class uses the Spring bean name as job name, * and the Quartz default group ("DEFAULT") as job group if not specified. * - *

NOTE: This FactoryBean works against both Quartz 1.x and Quartz 2.0/2.1, + *

NOTE: This FactoryBean works against both Quartz 1.x and Quartz 2.x, * in contrast to the older {@link JobDetailBean} class. * * @author Juergen Hoeller @@ -62,6 +62,8 @@ public class JobDetailFactoryBean private boolean durability = false; + private boolean requestsRecovery = false; + private String description; private String beanName; @@ -132,6 +134,14 @@ public class JobDetailFactoryBean this.durability = durability; } + /** + * Set the recovery flag for this job, i.e. whether or not the job should + * get re-executed if a 'recovery' or 'fail-over' situation is encountered. + */ + public void setRequestsRecovery(boolean requestsRecovery) { + this.requestsRecovery = requestsRecovery; + } + /** * Set a textual description for this job. */ @@ -212,6 +222,7 @@ public class JobDetailFactoryBean pvs.add("jobClass", this.jobClass); pvs.add("jobDataMap", this.jobDataMap); pvs.add("durability", this.durability); + pvs.add("requestsRecovery", this.requestsRecovery); pvs.add("description", this.description); bw.setPropertyValues(pvs); this.jobDetail = (JobDetail) bw.getWrappedInstance();