提交 24030a3f 编写于 作者: J Juergen Hoeller

Added deprecation log message and javadoc note for Quartz 1.x support

Issue: SPR-11262
上级 b228a06e
......@@ -31,6 +31,7 @@ import org.springframework.util.ReflectionUtils;
* objects as well as standard Quartz {@link org.quartz.Job} instances.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @since 2.0
......
......@@ -107,7 +107,9 @@ public class CronTriggerBean extends CronTrigger
* by the TriggerListener implementation.
* @see SchedulerFactoryBean#setTriggerListeners
* @see org.quartz.TriggerListener#getName
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setTriggerListenerNames(String... names) {
for (String name : names) {
addTriggerListener(name);
......
......@@ -82,7 +82,7 @@ public class JobDetailBean extends JobDetail
* to adapt the given job class to the Quartz Job interface.
*/
@Override
public Class<?> getJobClass() {
public Class getJobClass() {
return (this.actualJobClass != null ? this.actualJobClass : super.getJobClass());
}
......@@ -97,7 +97,7 @@ public class JobDetailBean extends JobDetail
* (for example Spring-managed beans)
* @see SchedulerFactoryBean#setSchedulerContextAsMap
*/
public void setJobDataAsMap(Map jobDataAsMap) {
public void setJobDataAsMap(Map<String, ?> jobDataAsMap) {
getJobDataMap().putAll(jobDataAsMap);
}
......@@ -108,7 +108,9 @@ public class JobDetailBean extends JobDetail
* by the JobListener implementation.
* @see SchedulerFactoryBean#setJobListeners
* @see org.quartz.JobListener#getName
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setJobListenerNames(String... names) {
for (String name : names) {
addJobListener(name);
......
......@@ -68,6 +68,7 @@ import org.springframework.util.ReflectionUtils;
* where you want a persistent job to delegate to a specific service method.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @author Alef Arendsen
......@@ -171,7 +172,9 @@ public class MethodInvokingJobDetailFactoryBean extends ArgumentConvertingMethod
* by the JobListener implementation.
* @see SchedulerFactoryBean#setJobListeners
* @see org.quartz.JobListener#getName
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setJobListenerNames(String... names) {
this.jobListenerNames = names;
}
......
......@@ -53,6 +53,7 @@ import org.springframework.util.ReflectionUtils;
* {@link SchedulerAccessorBean} classes.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @since 2.5.6
......@@ -64,6 +65,7 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
private static Class<?> triggerKeyClass;
static {
// Quartz 2.0 job/trigger key available?
try {
jobKeyClass = Class.forName("org.quartz.JobKey");
triggerKeyClass = Class.forName("org.quartz.TriggerKey");
......@@ -102,6 +104,13 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
protected ResourceLoader resourceLoader;
public SchedulerAccessor() {
if (jobKeyClass == null && logger.isInfoEnabled()) {
logger.info("Spring's Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+");
}
}
/**
* Set whether any jobs defined on this SchedulerFactoryBean should overwrite
* existing job definitions. Default is "false", to not overwrite already
......@@ -202,7 +211,9 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
* manually register a Matcher against the Quartz ListenerManager instead.
* @see org.quartz.JobListener#getName
* @see JobDetailBean#setJobListenerNames
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setJobListeners(JobListener... jobListeners) {
this.jobListeners = jobListeners;
}
......@@ -224,7 +235,9 @@ public abstract class SchedulerAccessor implements ResourceLoaderAware {
* @see org.quartz.TriggerListener#getName
* @see CronTriggerBean#setTriggerListenerNames
* @see SimpleTriggerBean#setTriggerListenerNames
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setTriggerListeners(TriggerListener... triggerListeners) {
this.triggerListeners = triggerListeners;
}
......
......@@ -30,6 +30,7 @@ import org.springframework.beans.factory.ListableBeanFactory;
* triggers and listeners on a given {@link org.quartz.Scheduler} instance.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @since 2.5.6
......
......@@ -76,6 +76,7 @@ import org.springframework.util.CollectionUtils;
* Alternatively, you may add transactional advice for the Scheduler itself.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @since 18.02.2004
......@@ -454,10 +455,8 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
this.resourceLoader = this.applicationContext;
}
// Create SchedulerFactory instance.
SchedulerFactory schedulerFactory = (SchedulerFactory)
BeanUtils.instantiateClass(this.schedulerFactoryClass);
// Create SchedulerFactory instance...
SchedulerFactory schedulerFactory = BeanUtils.instantiateClass(this.schedulerFactoryClass);
initSchedulerFactory(schedulerFactory);
if (this.resourceLoader != null) {
......@@ -520,9 +519,7 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
* Load and/or apply Quartz properties to the given SchedulerFactory.
* @param schedulerFactory the SchedulerFactory to initialize
*/
private void initSchedulerFactory(SchedulerFactory schedulerFactory)
throws SchedulerException, IOException {
private void initSchedulerFactory(SchedulerFactory schedulerFactory) throws SchedulerException, IOException {
if (!(schedulerFactory instanceof StdSchedulerFactory)) {
if (this.configLocation != null || this.quartzProperties != null ||
this.taskExecutor != null || this.dataSource != null) {
......
......@@ -112,7 +112,9 @@ public class SimpleTriggerBean extends SimpleTrigger
* by the TriggerListener implementation.
* @see SchedulerFactoryBean#setTriggerListeners
* @see org.quartz.TriggerListener#getName
* @deprecated as of Spring 4.0, since it only works on Quartz 1.x
*/
@Deprecated
public void setTriggerListenerNames(String... names) {
for (String name : names) {
addTriggerListener(name);
......
......@@ -38,6 +38,7 @@ import org.springframework.util.ReflectionUtils;
* is by default simply ignored. This is analogous to QuartzJobBean's behavior.
*
* <p>Compatible with Quartz 1.8 as well as Quartz 2.0-2.2, as of Spring 4.0.
* <b>Note:</b> Quartz 1.x support is deprecated - please upgrade to Quartz 2.0+.
*
* @author Juergen Hoeller
* @since 2.0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册