protected final JobContextHolder getJobContextHolder ( final JobExecutionContext jobContext ) { final Scheduler scheduler = jobContext . getScheduler ( ) ; JobContextHolder bean = null ; try { final SchedulerContext schedulerContext = scheduler . getContext ( ) ; final ApplicationContext appContext = ( ApplicationContext ) schedulerContext . get ( APPLICATION_CONTEXT ) ; bean = appContext . getBean ( JobContextHolder . class ) ; } catch ( final SchedulerException e ) { LOGGER . error ( "Failed to get JobContextHolder" , e ) ; } return bean ; }
Gets the job context holder .