/** * <p> * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>JobDetail</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Job with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super("Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
/** * <p> * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>JobDetail</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Job with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super("Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
JobWrapper(JobDetail jobDetail) { this.jobDetail = jobDetail; key = jobDetail.getName(); }
/** * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the * name/group from the given <code>JobDetail</code>. * * <p>The message will read: <br> * "Unable to store Job with name: '__' and group: '__', because one already exists with this * identification." */ public ObjectAlreadyExistsException(JobDetail offendingJob) { super( "Unable to store Job : '" + offendingJob.getName() + "', because one already exists with this identification."); }
/** Get the names of all of the <code>{@link org.quartz.jobs.Job}</code> s */ @Override public Set<String> getJobKeys() { Set<String> outList = new HashSet<String>(); synchronized (lock) { for (JobWrapper jw : jobsByKey.values()) { if (jw != null) { outList.add(jw.jobDetail.getName()); } } } return outList == null ? java.util.Collections.<String>emptySet() : outList; } }
private boolean vetoedJobRetryLoop(OperableTrigger trigger, JobDetail jobDetail, CompletedExecutionInstruction instCode) { while (!shutdownRequested) { try { Thread.sleep(5 * 1000L); // retry every 5 seconds (the db // connection must be failed) qs.notifyJobStoreJobVetoed(trigger, jobDetail, instCode); return true; } catch (JobPersistenceException jpe) { qs.notifySchedulerListenersError("An error occured while marking executed job vetoed. job= '" + jobDetail.getName() + "'", jpe); } catch (InterruptedException ignore) { } } return false; }
private boolean vetoedJobRetryLoop(OperableTrigger trigger, JobDetail jobDetail, CompletedExecutionInstruction instCode) { while (!shutdownRequested) { try { Thread.sleep(5 * 1000L); // retry every 5 seconds (the db // connection must be failed) qs.notifyJobStoreJobVetoed(trigger, jobDetail, instCode); return true; } catch (JobPersistenceException jpe) { qs.notifySchedulerListenersError("An error occured while marking executed job vetoed. job= '" + jobDetail.getName() + "'", jpe); } catch (InterruptedException ignore) { } } return false; }
@Override public Job newJob(TriggerFiredBundle bundle, Scheduler Scheduler) throws SchedulerException { JobDetail jobDetail = bundle.getJobDetail(); Class<? extends Job> jobClass = jobDetail.getJobClass(); try { if (log.isDebugEnabled()) { log.debug("Producing instance of Job '" + jobDetail.getName() + "', class=" + jobClass.getName()); } return jobClass.newInstance(); } catch (Exception e) { SchedulerException se = new SchedulerException("Problem instantiating class '" + jobDetail.getJobClass().getName() + "'", e); throw se; } }
@Override public void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode) { metrics.timer(triggerMetricName(trigger.getName())).update( context.getJobRunTime(), TimeUnit.MILLISECONDS ); metrics.timer(jobMetricName(context.getJobDetail().getName())).update( context.getJobRunTime(), TimeUnit.MILLISECONDS ); }
private boolean notifyJobListenersComplete(JobExecutionContext jec, JobExecutionException jobExEx) { try { qs.notifyJobListenersWasExecuted(jec, jobExEx); } catch (SchedulerException se) { qs.notifySchedulerListenersError("Unable to notify JobListener(s) of Job that was executed: " + "(error will be ignored). trigger= " + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se); return false; } return true; }
private boolean notifyJobListenersComplete(JobExecutionContext jec, JobExecutionException jobExEx) { try { qs.notifyJobListenersWasExecuted(jec, jobExEx); } catch (SchedulerException se) { qs.notifySchedulerListenersError("Unable to notify JobListener(s) of Job that was executed: " + "(error will be ignored). trigger= " + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se); return false; } return true; }
@Override public String toString() { return "JobExecutionContext:" + " trigger: '" + getTrigger().getName() + " job: " + getJobDetail().getName() + " fireTime: '" + getFireTime() + " scheduledFireTime: " + getScheduledFireTime() + " previousFireTime: '" + getPreviousFireTime() + " nextFireTime: " + getNextFireTime() + " isRecovering: " + isRecovering() + " refireCount: " + getRefireCount(); }
@Override public String toString() { return "JobExecutionContext:" + " trigger: '" + getTrigger().getName() + " job: " + getJobDetail().getName() + " fireTime: '" + getFireTime() + " scheduledFireTime: " + getScheduledFireTime() + " previousFireTime: '" + getPreviousFireTime() + " nextFireTime: " + getNextFireTime() + " isRecovering: " + isRecovering() + " refireCount: " + getRefireCount(); }
private boolean notifyTriggerListenersComplete(JobExecutionContext jec, CompletedExecutionInstruction instCode) { try { qs.notifyTriggerListenersComplete(jec, instCode); } catch (SchedulerException se) { qs.notifySchedulerListenersError("Unable to notify TriggerListener(s) of Job that was executed: " + "(error will be ignored). trigger= " + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se); return false; } if (jec.getTrigger().getNextFireTime() == null) { qs.notifySchedulerListenersFinalized(jec.getTrigger()); } return true; }
private boolean notifyTriggerListenersComplete(JobExecutionContext jec, CompletedExecutionInstruction instCode) { try { qs.notifyTriggerListenersComplete(jec, instCode); } catch (SchedulerException se) { qs.notifySchedulerListenersError("Unable to notify TriggerListener(s) of Job that was executed: " + "(error will be ignored). trigger= " + jec.getTrigger().getName() + " job= " + jec.getJobDetail().getName(), se); return false; } if (jec.getTrigger().getNextFireTime() == null) { qs.notifySchedulerListenersFinalized(jec.getTrigger()); } return true; }