*
* @param cronExpression the cron expression
* @return the cron trigger
*/
private Trigger getCronTrigger(String cronExpression) {
CronScheduleBuilder cronScheduleBuilder = null;
Trigger cronTrigger = null;
try {
cronScheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression);
cronScheduleBuilder.withMisfireHandlingInstructionFireAndProceed();
TriggerBuilder<Trigger> cronTtriggerBuilder = TriggerBuilder.newTrigger();
cronTtriggerBuilder.withSchedule(cronScheduleBuilder);
cronTrigger = cronTtriggerBuilder.build();
} catch (ParseException pe) {
logger.error("Error occurred while builiding the cronTrigger : " + pe.getMessage(), pe);