code: @Override
      public void execute(JobExecutionContext context) throws JobExecutionException {
          JobDataMap map = context.getJobDetail().getJobDataMap();
          AlertService alertService = (AlertService) map.get("AlertService");
          AuditService auditService = (AuditService) map.get("AuditService");
  
          if (map.containsKey(LOCK_TYPE)) {
              lockType = (LockType) map.get(LOCK_TYPE);
          }
          if (map.containsKey(CRON_JOB)) {
              job = (CronJob) map.get(CRON_JOB);
          }
          try {
              if (!alertService.isDisposed()) {
                  if (LockType.ALERT_SCHEDULING.equals(lockType)) {
                      alertService.enqueueAlerts(Arrays.asList(new Alert[] { Alert.class.cast(job) }));
                  } else {
                      throw new SystemException("Unsupported lock type " + lockType);
                  }
              }
          } catch (Exception ex) {
              auditService.createAudit("Could not enqueue scheduled job. " + ex.getMessage(), JPAEntity.class.cast(job));
          }
      }
docs: Passing the service instance from quartz main thread, to worker thread as a parameter. Although the alert service used here is not thread safe,
  we are using the enqueueAlerts in a thread safe manner, since there is no shared mutable state in this method.
  
  <p>Not using Guice for injecton of services, since the JPAService in Guice when called as part of worker thread context has emfFactory as null.
  Hence no database operation can be performed through JPA from he worker thread.</p>
  
  @param   context  - Job context passed from quartz main thread, to worker thread. Parameters are extracted from this context.
  
  @throws  JobExecutionException  If an error occurs.