Skip to content

Commit f367619

Browse files
committed
added "durability" and "description" properties to JobDetailFactoryBean (SPR-9080)
1 parent afa4bb3 commit f367619

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 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.
@@ -60,6 +60,10 @@ public class JobDetailFactoryBean
6060

6161
private JobDataMap jobDataMap = new JobDataMap();
6262

63+
private boolean durability = false;
64+
65+
private String description;
66+
6367
private String beanName;
6468

6569
private ApplicationContext applicationContext;
@@ -120,6 +124,21 @@ public void setJobDataAsMap(Map<String, ?> jobDataAsMap) {
120124
getJobDataMap().putAll(jobDataAsMap);
121125
}
122126

127+
/**
128+
* Specify the job's durability, i.e. whether it should remain stored
129+
* in the job store even if no triggers point to it anymore.
130+
*/
131+
public void setDurability(boolean durability) {
132+
this.durability = durability;
133+
}
134+
135+
/**
136+
* Set a textual description for this job.
137+
*/
138+
public void setDescription(String description) {
139+
this.description = description;
140+
}
141+
123142
public void setBeanName(String beanName) {
124143
this.beanName = beanName;
125144
}
@@ -172,6 +191,8 @@ public void afterPropertiesSet() {
172191
jdi.setGroup(this.group);
173192
jdi.setJobClass(this.jobClass);
174193
jdi.setJobDataMap(this.jobDataMap);
194+
jdi.setDurability(this.durability);
195+
jdi.setDescription(this.description);
175196
this.jobDetail = jdi;
176197
*/
177198

@@ -188,6 +209,8 @@ public void afterPropertiesSet() {
188209
pvs.add("group", this.group);
189210
pvs.add("jobClass", this.jobClass);
190211
pvs.add("jobDataMap", this.jobDataMap);
212+
pvs.add("durability", this.durability);
213+
pvs.add("description", this.description);
191214
bw.setPropertyValues(pvs);
192215
this.jobDetail = (JobDetail) bw.getWrappedInstance();
193216
}

0 commit comments

Comments
 (0)