use of org.eclipse.che.inject.ConfigurationException in project che by eclipse.
the class ThreadPullLauncher method scheduleCron.
@Override
public void scheduleCron(Runnable runnable, String cron) {
if (cron == null || cron.isEmpty()) {
throw new ConfigurationException("Cron parameter can't be null");
}
try {
CronExpression expression = new CronExpression(cron);
service.schedule(runnable, expression);
LOG.debug("Schedule method {} with cron {} schedule", runnable, cron);
} catch (ParseException e) {
LOG.error(e.getLocalizedMessage(), e);
throw new ConfigurationException(e.getLocalizedMessage());
}
}
Aggregations