public static boolean isJobRunning(String jobName) { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching running Job found!"); return true; } } } catch (SchedulerException e) { logger.error("ERROR CHECKING RUNNING JOB!!!", e); } logger.debug("Matching running NOT Job found!"); return false; }
public static boolean isJobRunning(String jobName) throws SundialSchedulerException { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching running Job found!"); return true; } } } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR CHECKING RUNNING JOB!!!", e); } logger.debug("Matching running NOT Job found!"); return false; }
public static boolean isJobRunning(String jobName) throws SundialSchedulerException { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching running Job found!"); return true; } } } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR CHECKING RUNNING JOB!!!", e); } logger.debug("Matching running NOT Job found!"); return false; }
/** * Triggers a Job interrupt on all Jobs matching the given Job Name * * @param jobName The job name */ public static void stopJob(String jobName) { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching Job found. Now Stopping!"); if (jobExecutionContext.getJobInstance() instanceof Job) { ((Job) jobExecutionContext.getJobInstance()).interrupt(); } else { logger.warn("CANNOT STOP NON-INTERRUPTABLE JOB!!!"); } } else { logger.debug("Non-matching Job found. Not Stopping!"); } } } catch (SchedulerException e) { logger.error("ERROR STOPPING JOB!!!", e); } }
logger.debug("value= " + pValue); try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName();
/** * Triggers a Job interrupt on all Jobs matching the given Job Name. The Job termination mechanism * works by setting a flag that the Job should be terminated, but it is up to the logic in the Job * to decide at what point termination should occur. Therefore, in any long-running job that you * anticipate the need to terminate, put the method call checkTerminated() at an appropriate * location. * * @param jobName The job name */ public static void stopJob(String jobName) throws SundialSchedulerException { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching Job found. Now Stopping!"); if (jobExecutionContext.getJobInstance() instanceof Job) { ((Job) jobExecutionContext.getJobInstance()).interrupt(); } else { logger.warn("CANNOT STOP NON-INTERRUPTABLE JOB!!!"); } } else { logger.debug("Non-matching Job found. Not Stopping!"); } } } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR STOPPING JOB!!!", e); } }
/** * Triggers a Job interrupt on all Jobs matching the given Job Name. The Job termination mechanism works by setting a flag that the Job should be * terminated, but it is up to the logic in the Job to decide at what point termination should occur. Therefore, in any long-running job that you * anticipate the need to terminate, put the method call checkTerminated() at an appropriate location. * * @param jobName The job name */ public static void stopJob(String jobName) throws SundialSchedulerException { try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName(); if (currentlyExecutingJobName.equals(jobName)) { logger.debug("Matching Job found. Now Stopping!"); if (jobExecutionContext.getJobInstance() instanceof Job) { ((Job) jobExecutionContext.getJobInstance()).interrupt(); } else { logger.warn("CANNOT STOP NON-INTERRUPTABLE JOB!!!"); } } else { logger.debug("Non-matching Job found. Not Stopping!"); } } } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR STOPPING JOB!!!", e); } }
logger.debug("value= " + pValue); try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName();
logger.debug("value= " + pValue); try { List<JobExecutionContext> currentlyExecutingJobs = getScheduler().getCurrentlyExecutingJobs(); for (JobExecutionContext jobExecutionContext : currentlyExecutingJobs) { String currentlyExecutingJobName = jobExecutionContext.getJobDetail().getName();