/** * Creates a new CronTrigger. * @param cronExpression the cronExpression that is used for the CronTrigger * @return created CronTrigger */ public CronTrigger createCronTrigger(final String cronExpression) { CronTrigger result; try { result = new CronTrigger(cronExpression); } catch (IllegalArgumentException e) { throw new SchedulingCannotBeStartedException("Scheduling cannot be started, cron expression given in properties file is not valid! " + e.getMessage(), e); } return result; }
/** * Starts the scheduling of the {@link SequenceCleanerTask}. */ public void startScheduling() { CronTrigger cronTrigger = createCronTrigger(); if (maintainerTask != null) { taskScheduler.schedule(maintainerTask, cronTrigger); } else { throw new SchedulingCannotBeStartedException("Scheduling cannot be started, in Sequence module."); } }
/** * Starts the scheduling of the LogFileMaintainerTask. */ public void startScheduling() { CronTrigger cronTrigger = createCronTrigger(); MaintainerMethod method = getMaintainerMethod(); MaintainerTask maintainerTask = maintainerTasks.get(method); if (maintainerTask != null) { taskScheduler.schedule(maintainerTask, cronTrigger); maintainerTask.logParameters(); } else { throw new SchedulingCannotBeStartedException("Scheduling cannot be started, maintenance method given in properties file is not valid!"); } }