Search in sources :

Example 1 with ConfigurationException

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());
    }
}
Also used : ConfigurationException(org.eclipse.che.inject.ConfigurationException) ParseException(java.text.ParseException)

Aggregations

ParseException (java.text.ParseException)1 ConfigurationException (org.eclipse.che.inject.ConfigurationException)1