3

How to use a Job that is operating in Cluster with Spring?

  • Spring 4.3
  • Quartz 2.2.3

Sample job declaration

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class SysEncryptEmailSendSystemJob implements Job{
..
  @Override
  public void execute(final JobExecutionContext context) throws 
    JobExecutionException {
  }
}

My Factory IOC

@Autowired
@Qualifier(value = SysConfig.SCHEDULER_FACTORY)
private SchedulerFactoryBean schedulerFactory;

I know I could annotate as @Component but thus lose the functionality of quartz, the goal of doing the IOC is to do the tests with JUnit!

Any way to do that? has anyone done or doc explaining how to do this?

Marcelo Ferreira
  • 428
  • 1
  • 5
  • 20

0 Answers0