[Feature] Custom Quartz Job and Trigger

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>
```java
public class SingleExecutionEventJobFactory extends DefaultEventJobFactory {
    @Override
    protected Class<? extends EventJob> getJobClass() {
        return SingleExecutionEventJob.class;
    }
}

@DisallowConcurrentExecution
public class SingleExecutionEventJob extends EventJob {
}

See https://jira.nuxeo.com/browse/NXP-24540

0 votes

0 answers

354 views

ANSWER