final JobContext jobCtx = new JobContextImpl(name, configuration);
((org.apache.sling.commons.scheduler.Job) job).execute(jobCtx);
} else if (job instanceof Runnable) {
((Runnable) job).run();
} else {
logger.error("Scheduled job {} is neither a job nor a runnable.", job);
}
} catch (final Throwable t) {
// if this is a quartz exception, rethrow it
if (t instanceof JobExecutionException) {
throw (JobExecutionException) t;