if (job instanceof org.apache.karaf.scheduler.Job) {
@SuppressWarnings("unchecked")
final InternalScheduleOptions options = (InternalScheduleOptions) data.get(QuartzScheduler.DATA_MAP_OPTIONS);
final String name = (String) data.get(QuartzScheduler.DATA_MAP_NAME);
final JobContext jobCtx = new JobContextImpl(name, options.configuration);
((org.apache.karaf.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);