Skip to content

Commit dfac1d0

Browse files
jhoellerunknown
authored and
unknown
committed
Added "requestsRecovery" bean property to JobDetailFactoryBean
Issue: SPR-10775
1 parent 14b83c3 commit dfac1d0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
3939
* sensible defaults. This class uses the Spring bean name as job name,
4040
* and the Quartz default group ("DEFAULT") as job group if not specified.
4141
*
42-
* <p><b>NOTE:</b> This FactoryBean works against both Quartz 1.x and Quartz 2.0/2.1,
42+
* <p><b>NOTE:</b> This FactoryBean works against both Quartz 1.x and Quartz 2.x,
4343
* in contrast to the older {@link JobDetailBean} class.
4444
*
4545
* @author Juergen Hoeller
@@ -62,6 +62,8 @@ public class JobDetailFactoryBean
6262

6363
private boolean durability = false;
6464

65+
private boolean requestsRecovery = false;
66+
6567
private String description;
6668

6769
private String beanName;
@@ -132,6 +134,14 @@ public void setDurability(boolean durability) {
132134
this.durability = durability;
133135
}
134136

137+
/**
138+
* Set the recovery flag for this job, i.e. whether or not the job should
139+
* get re-executed if a 'recovery' or 'fail-over' situation is encountered.
140+
*/
141+
public void setRequestsRecovery(boolean requestsRecovery) {
142+
this.requestsRecovery = requestsRecovery;
143+
}
144+
135145
/**
136146
* Set a textual description for this job.
137147
*/
@@ -209,6 +219,7 @@ public void afterPropertiesSet() {
209219
pvs.add("jobClass", this.jobClass);
210220
pvs.add("jobDataMap", this.jobDataMap);
211221
pvs.add("durability", this.durability);
222+
pvs.add("requestsRecovery", this.requestsRecovery);
212223
pvs.add("description", this.description);
213224
bw.setPropertyValues(pvs);
214225
this.jobDetail = (JobDetail) bw.getWrappedInstance();

0 commit comments

Comments
 (0)