Support Quartz trigger without JobDetail
This commit allows to create a Quartz trigger implementation via either `CronTriggerFactoryBean` or `SimpleTriggerFactoryBean` even if no job detail is provided. Issue: SPR-13604
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -237,7 +237,9 @@ public class CronTriggerFactoryBean implements FactoryBean<CronTrigger>, BeanNam
|
||||
CronTriggerImpl cti = new CronTriggerImpl();
|
||||
cti.setName(this.name);
|
||||
cti.setGroup(this.group);
|
||||
cti.setJobKey(this.jobDetail.getKey());
|
||||
if (this.jobDetail != null) {
|
||||
cti.setJobKey(this.jobDetail.getKey());
|
||||
}
|
||||
cti.setJobDataMap(this.jobDataMap);
|
||||
cti.setStartTime(this.startTime);
|
||||
cti.setCronExpression(this.cronExpression);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -228,7 +228,9 @@ public class SimpleTriggerFactoryBean implements FactoryBean<SimpleTrigger>, Bea
|
||||
SimpleTriggerImpl sti = new SimpleTriggerImpl();
|
||||
sti.setName(this.name);
|
||||
sti.setGroup(this.group);
|
||||
sti.setJobKey(this.jobDetail.getKey());
|
||||
if (this.jobDetail != null) {
|
||||
sti.setJobKey(this.jobDetail.getKey());
|
||||
}
|
||||
sti.setJobDataMap(this.jobDataMap);
|
||||
sti.setStartTime(this.startTime);
|
||||
sti.setRepeatInterval(this.repeatInterval);
|
||||
|
||||
Reference in New Issue
Block a user