if(taskClassName != null) {
mLogger.info("Initializing task: "+tasks[i]);
try {
Class taskClass = Class.forName(taskClassName);
RollerTask task = (RollerTask) taskClass.newInstance();
task.init();
Date startTime = task.getStartTime(now);
if(startTime == null || now.after(startTime)) {
startTime = now;
}
// schedule it
tmgr.scheduleFixedRateTimerTask(task, startTime, task.getInterval());
} catch (ClassCastException ex) {
mLogger.warn("Task does not extend RollerTask class", ex);
} catch (RollerException ex) {
mLogger.error("Error scheduling task", ex);