Commit ed19f20c authored by Stephane Nicoll's avatar Stephane Nicoll

Merge branch '2.0.x'

parents 70826f54 38bd4bd5
...@@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.quartz; ...@@ -19,7 +19,6 @@ package org.springframework.boot.autoconfigure.quartz;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.Executor;
import javax.sql.DataSource; import javax.sql.DataSource;
...@@ -64,8 +63,6 @@ public class QuartzAutoConfiguration { ...@@ -64,8 +63,6 @@ public class QuartzAutoConfiguration {
private final List<SchedulerFactoryBeanCustomizer> customizers; private final List<SchedulerFactoryBeanCustomizer> customizers;
private final Executor taskExecutor;
private final JobDetail[] jobDetails; private final JobDetail[] jobDetails;
private final Map<String, Calendar> calendars; private final Map<String, Calendar> calendars;
...@@ -76,12 +73,11 @@ public class QuartzAutoConfiguration { ...@@ -76,12 +73,11 @@ public class QuartzAutoConfiguration {
public QuartzAutoConfiguration(QuartzProperties properties, public QuartzAutoConfiguration(QuartzProperties properties,
ObjectProvider<List<SchedulerFactoryBeanCustomizer>> customizers, ObjectProvider<List<SchedulerFactoryBeanCustomizer>> customizers,
ObjectProvider<Executor> taskExecutor, ObjectProvider<JobDetail[]> jobDetails, ObjectProvider<JobDetail[]> jobDetails,
ObjectProvider<Map<String, Calendar>> calendars, ObjectProvider<Map<String, Calendar>> calendars,
ObjectProvider<Trigger[]> triggers, ApplicationContext applicationContext) { ObjectProvider<Trigger[]> triggers, ApplicationContext applicationContext) {
this.properties = properties; this.properties = properties;
this.customizers = customizers.getIfAvailable(); this.customizers = customizers.getIfAvailable();
this.taskExecutor = taskExecutor.getIfUnique();
this.jobDetails = jobDetails.getIfAvailable(); this.jobDetails = jobDetails.getIfAvailable();
this.calendars = calendars.getIfAvailable(); this.calendars = calendars.getIfAvailable();
this.triggers = triggers.getIfAvailable(); this.triggers = triggers.getIfAvailable();
...@@ -98,9 +94,6 @@ public class QuartzAutoConfiguration { ...@@ -98,9 +94,6 @@ public class QuartzAutoConfiguration {
schedulerFactoryBean schedulerFactoryBean
.setQuartzProperties(asProperties(this.properties.getProperties())); .setQuartzProperties(asProperties(this.properties.getProperties()));
} }
if (this.taskExecutor != null) {
schedulerFactoryBean.setTaskExecutor(this.taskExecutor);
}
if (this.jobDetails != null && this.jobDetails.length > 0) { if (this.jobDetails != null && this.jobDetails.length > 0) {
schedulerFactoryBean.setJobDetails(this.jobDetails); schedulerFactoryBean.setJobDetails(this.jobDetails);
} }
......
...@@ -5876,6 +5876,10 @@ Quartz Scheduler configuration can be customized by using Quartz configuration p ...@@ -5876,6 +5876,10 @@ Quartz Scheduler configuration can be customized by using Quartz configuration p
()`spring.quartz.properties.*`) and `SchedulerFactoryBeanCustomizer` beans, which allow ()`spring.quartz.properties.*`) and `SchedulerFactoryBeanCustomizer` beans, which allow
programmatic `SchedulerFactoryBean` customization. programmatic `SchedulerFactoryBean` customization.
NOTE: In particular, an `Executor` bean is not associated with the scheduler as Quartz
offers a way to configure the scheduler via `spring.quartz.properties`. If you need
to customize the task executor, consider implementing `SchedulerFactoryBeanCustomizer`.
Jobs can define setters to inject data map properties. Regular beans can also be injected Jobs can define setters to inject data map properties. Regular beans can also be injected
in a similar manner, as shown in the following example: in a similar manner, as shown in the following example:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment