if (job instanceof org.apache.sling.commons.scheduler.Job) {
@SuppressWarnings("unchecked")
final Map<String, Serializable> configuration = (Map<String, Serializable>) data.get(QuartzScheduler.DATA_MAP_CONFIGURATION);
final String name = (String) data.get(QuartzScheduler.DATA_MAP_NAME);
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);