}
}
mainJob
.setJobExecutionListeners(new JobExecutionListener[] { mainJobExecutionListener });
mainJob.setJobRepository(jobRepository);
mainJob.afterPropertiesSet();
JobFactory jobFactory = new ReferenceJobFactory(mainJob);
jobRegistry.register(jobFactory);
logger.info("registered job: " + mainJob.getName());
JobParameters mainJobParameters = new JobParameters(mainJobParams);
JobExecution mainJobExecution =