You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
setCronExpression method not exposed in CronTriggerBean [SPR-8556] #13200
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
The CronTriggerBean does not expose the setCronExpression() method. It looks like the Spring CronTriggerBean should extend the QUARTZ CronTriggerImpl, not the QUARTZ interface?? of CronTrigger, which only contain 4 getter methods. I have no idea where it would get access to setCronExpression any other way.
This is an effect of Quartz 2.0's rearchitecture of its core APIs which breaks quite a bit of Spring's traditional Quartz support. As a consequence of that, up until Spring 3.1 M2, Spring is only fully compatible with Quartz 1.x.
As of Spring 3.1 RC1 (scheduled for release in August), we officially support Quartz 2.0 next to Quartz 1.5+ now: see #12923. Hoever, CronTriggerBean, SimpleTriggerBean and JobDetailBean do not work against Quartz 2.0: They are marked as only compatible with Quartz 1.x now.
With Spring 3.1 and Quartz 2.0, we recommend use of the native Quartz 2.0 JobDetailImpl etc classes or of Quartz 2.0's corresponding builder APIs. This should work nicely in Spring 3 @Bean methods, populating SchedulerFactoryBean's "triggers" and "jobDetails" properties.
Note that you may also @Inject the Scheduler in any application component and schedule jobs using the native schedule methods there, for example in your @PostConstruct methods. That way, programmatic scheduling can be used for such 'static' registration of triggers and jobs as well.
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
Activity
spring-projects-issues commentedon Jul 25, 2011
Juergen Hoeller commented
This is an effect of Quartz 2.0's rearchitecture of its core APIs which breaks quite a bit of Spring's traditional Quartz support. As a consequence of that, up until Spring 3.1 M2, Spring is only fully compatible with Quartz 1.x.
As of Spring 3.1 RC1 (scheduled for release in August), we officially support Quartz 2.0 next to Quartz 1.5+ now: see #12923. Hoever, CronTriggerBean, SimpleTriggerBean and JobDetailBean do not work against Quartz 2.0: They are marked as only compatible with Quartz 1.x now.
With Spring 3.1 and Quartz 2.0, we recommend use of the native Quartz 2.0 JobDetailImpl etc classes or of Quartz 2.0's corresponding builder APIs. This should work nicely in Spring 3
@Beanmethods, populating SchedulerFactoryBean's "triggers" and "jobDetails" properties.Note that you may also
@Injectthe Scheduler in any application component and schedule jobs using the native schedule methods there, for example in your@PostConstructmethods. That way, programmatic scheduling can be used for such 'static' registration of triggers and jobs as well.Juergen