Browse Source

Added "requestsRecovery" bean property to JobDetailFactoryBean

Issue: SPR-10775
pull/294/merge
Juergen Hoeller 13 years ago committed by unknown
parent
commit
dfac1d0510
  1. 15
      spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java

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

@ -1,5 +1,5 @@ @@ -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; @@ -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.
*
* <p><b>NOTE:</b> This FactoryBean works against both Quartz 1.x and Quartz 2.0/2.1,
* <p><b>NOTE:</b> 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 @@ -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 @@ -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.
*/
@ -209,6 +219,7 @@ public class JobDetailFactoryBean @@ -209,6 +219,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();

Loading…
Cancel
Save