jobDescription = (JobDescription)jobClass.newInstance();
if(jobDescription.getName() == null) {
jobDescription.setName(name);
}
} else {
throw new ConfigurationException("Java Jobs must extend org.exist.scheduler.UserJavaJob");
}
} catch(final ClassNotFoundException cnfe) {
throw new ConfigurationException("No such class: " + clazz, cnfe);
} catch(final InstantiationException ie) {
throw new ConfigurationException("Cannot instantiate class: " + clazz, ie);
} catch(final IllegalAccessException ie) {
throw new ConfigurationException("Cannot instantiate class: " + clazz, ie);
}
}
manager.getScheduler().createCronJob(cronExpression, jobDescription, null, true);
}