[Feature] Custom Quartz Job and Trigger
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2018 10:52 AM
Hello,
It is currently not possible to customize the Quartz job and trigger created by the SchedulerService
, like adding @DisallowConcurrentExecution
to the job or changing the misfire behavior.
This PR adds an optional jobFactoryClass
attribute on the schedule
extension point of SchedulerService
allowing to customize the job and the trigger, falling back to the previous behavior if not specified.
For example :
<schedule id="testSchedulerSingleExecution"
jobFactoryClass="org.nuxeo.ecm.core.scheduler.SingleExecutionEventJobFactory">
<event>testSchedulerSingleExecution</event>
<cronExpression>* * * * * ?</cronExpression>
</schedule>
public class SingleExecutionEventJobFactory extends DefaultEventJobFactory {
@Override
protected Class<? extends EventJob> getJobClass() {
return SingleExecutionEventJob.class;
}
}
@DisallowConcurrentExecution
public class SingleExecutionEventJob extends EventJob {
}
0 REPLIES 0
