SchedulerImpl extends AbstractHibernateService implements
		Scheduler { public void reloadSchedules() { getJobService().resetCycles(); logger.debug("Reloading schedules"); try { scheduler = StdSchedulerFactory.getDefaultScheduler(); if (scheduler.isStarted()) { scheduler.shutdown(); scheduler = StdSchedulerFactory.getDefaultScheduler(); } scheduler.start(); } catch (SchedulerException e) { logger.error("Failed to create scheduler"); e.printStackTrace(); return; } for (Job job : getJobService().getAllJobs()) { logger.debug("Scheduling job: " + job.getName()); for (Schedule schedule : job.getSchedules()) { JobDetail jobDetail = new JobDetail("Job-" + job.getId() + schedule.getId(), JobExecutor.class); String cronExpression = schedule.getQuartzScheduling(); logger.debug("Adding schedule " + cronExpression); try { Trigger trigger = new CronTrigger("Trigger-" + schedule.getId(), "JobScheduleGroup", cronExpression); JobDataMap jobData = createJobDataMap(job.getId()); trigger.setJobDataMap(jobData); scheduler.scheduleJob(jobDetail, trigger); } catch (SchedulerException schedulerException) { logger.warn("Scheduling job \"" + job.getName() + "\" failed"); } catch (ParseException parseException) { logger.error("Parsing of cron expression for job \"" + job.getName() + "\" failed: " + cronExpression); parseException.printStackTrace(); } } } }  @Autowired void setJobService(JobService jobService); JobService getJobService(); @PostConstruct void init(); @PreDestroy void preDestroy(); void reloadSchedules(); @Override void immediately(Job job);  }
@Test public void TestSchedulesCanReloadWithoutUser() { scheduler.reloadSchedules(); }