Scheduler scheduler = (Scheduler) CoreSpringFactory.getBean("schedulerFactoryBean");
String cronExpression = "ERROR";
try {
// Create job with cron trigger configuration
JobDetail jobDetail = new JobDetail(SCHEDULER_NAME, Scheduler.DEFAULT_GROUP, SystemRegistrationJob.class);
CronTrigger trigger = new CronTrigger();
trigger.setName("system_registration_trigger");
cronExpression = persitedProperties.getStringPropertyValue(CONF_KEY_REGISTRATION_CRON, true);
if (!CronExpression.isValidExpression(cronExpression)) {
cronExpression = createCronTriggerExpression();
persitedProperties.setStringPropertyDefault(CONF_KEY_REGISTRATION_CRON, cronExpression);
}
// Use this cron expression for debugging, tries to send data every minute
//trigger.setCronExpression("0 * * * * ?");
trigger.setCronExpression(cronExpression);
// Schedule job now
scheduler.scheduleJob(jobDetail, trigger);
} catch (ParseException e) {
logError("Illegal cron expression for scheduling translation status generator", e);