code: public ApplicationContext getApplicationContext(final JobExecutionContext context) throws JobExecutionException {
          SchedulerContext schedulerContext;
          try {
              final Scheduler scheduler = context.getScheduler();
              schedulerContext = scheduler.getContext();
          } catch (SchedulerException e) {
          	logger.error("Unable to retrieve the scheduler context, cause : ", e);
              throw new JobExecutionException(e);
          }
          final ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get(APPLICATION_CONTEXT_BEAN_NAME);
          return applicationContext;
      }
docs: Retrieves the spring application context from the job execution context.
  
  @param context the quartz job execution context which is used to retrieve the spring application context bean.
  
  @return the spring application context bean.