CronTrigger cronTrigger = new CronTrigger();
try {
cronTrigger.setCronExpression(cronExpression);
trigger = cronTrigger;
} catch (ParseException e) {
throw new SynapseException("Error setting cron expression : " +
e.getMessage() + cronExpression, e);
}
}
trigger.setName(name + "-trigger");
JobDetail jobDetail = getJobDetail();
JobDataMap jobDataMap = getJobDataMap();
jobDataMap.put(MessageProcessorConsents.MESSAGE_STORE,
configuration.getMessageStore(messageStore));
jobDataMap.put(MessageProcessorConsents.PARAMETERS, parameters);
jobDetail.setJobDataMap(jobDataMap);
jobDetail.setGroup(SCHEDULED_MESSAGE_PROCESSOR_GROUP);
try {
scheduler.scheduleJob(jobDetail, trigger);
} catch (SchedulerException e) {
throw new SynapseException("Error scheduling job : " + jobDetail
+ " with trigger " + trigger ,e);
}
}