/** * <p> * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the name/group from the given <code>Trigger</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(Trigger offendingTrigger) { super("Unable to store Trigger with name: '" + offendingTrigger.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>Trigger</code>. * </p> * <p> * The message will read: <BR> * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this identification." * </p> */ public ObjectAlreadyExistsException(Trigger offendingTrigger) { super("Unable to store Trigger with name: '" + offendingTrigger.getName() + "', because one already exists with this identification."); }
/** * Create a <code>ObjectAlreadyExistsException</code> and auto-generate a message using the * name/group from the given <code>Trigger</code>. * * <p>The message will read: <br> * "Unable to store Trigger with name: '__' and group: '__', because one already exists with this * identification." */ public ObjectAlreadyExistsException(Trigger offendingTrigger) { super( "Unable to store Trigger with name: '" + offendingTrigger.getName() + "', because one already exists with this identification."); } }
/** * Trigger equality is based upon the equality of the Trigger name. * * @return true if the key of this Trigger equals that of the given Trigger. */ @Override public boolean equals(Object o) { if (!(o instanceof Trigger)) { return false; } Trigger other = (Trigger) o; if (other.getName() == null || getName() == null) { return false; } return getName().equals(other.getName()); }
private void notifySchedulerListenersScheduled(Trigger trigger) { // build a list of all scheduler listeners that are to be notified... List<SchedulerListener> schedListeners = buildSchedulerListenerList(); // notify all scheduler listeners for (SchedulerListener sl : schedListeners) { try { sl.jobScheduled(trigger); } catch (Exception e) { logger.error("Error while notifying SchedulerListener of scheduled job." + " Triger=" + trigger.getName(), e); } } }
public void notifySchedulerListenersFinalized(Trigger trigger) { // build a list of all scheduler listeners that are to be notified... List<SchedulerListener> schedListeners = buildSchedulerListenerList(); // notify all scheduler listeners for (SchedulerListener sl : schedListeners) { try { sl.triggerFinalized(trigger); } catch (Exception e) { logger.error("Error while notifying SchedulerListener of finalized trigger." + " Triger=" + trigger.getName(), e); } } }
public void notifySchedulerListenersFinalized(Trigger trigger) { // build a list of all scheduler listeners that are to be notified... List<SchedulerListener> schedListeners = buildSchedulerListenerList(); // notify all scheduler listeners for (SchedulerListener sl : schedListeners) { try { sl.triggerFinalized(trigger); } catch (Exception e) { logger.error("Error while notifying SchedulerListener of finalized trigger." + " Triger=" + trigger.getName(), e); } } }
private void notifySchedulerListenersScheduled(Trigger trigger) { // build a list of all scheduler listeners that are to be notified... List<SchedulerListener> schedListeners = buildSchedulerListenerList(); // notify all scheduler listeners for (SchedulerListener sl : schedListeners) { try { sl.jobScheduled(trigger); } catch (Exception e) { logger.error("Error while notifying SchedulerListener of scheduled job." + " Triger=" + trigger.getName(), e); } } }
@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 ); }
/** * Add all the mappings from the JobExecutionContext to the JobContext * * @param jobExecutionContext */ public void addQuartzContext(JobExecutionContext jobExecutionContext) { for (Object mapKey : jobExecutionContext.getMergedJobDataMap().keySet()) { // logger.debug("added key: " + (String) mapKey); // logger.debug("added value: " + (String) // jobExecutionContext.getMergedJobDataMap().get(mapKey)); map.put((String) mapKey, jobExecutionContext.getMergedJobDataMap().get(mapKey)); } map.put(KEY_JOB_NAME, jobExecutionContext.getJobDetail().getName()); map.put(KEY_TRIGGER_NAME, (jobExecutionContext.getTrigger().getName())); if (jobExecutionContext.getTrigger() instanceof CronTrigger) { map.put( KEY_TRIGGER_CRON_EXPRESSION, ((CronTrigger) jobExecutionContext.getTrigger()).getCronExpression()); } }
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; }
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 void deleteJob(String jobKey) throws SchedulerException { validateState(); List<? extends Trigger> triggers = getTriggersOfJob(jobKey); for (Trigger trigger : triggers) { unscheduleJob(trigger.getName()); } boolean result = quartzSchedulerResources.getJobStore().removeJob(jobKey); if (result) { notifySchedulerThread(0L); notifySchedulerListenersJobDeleted(jobKey); } }
@Override public void deleteJob(String jobKey) throws SchedulerException { validateState(); List<? extends Trigger> triggers = getTriggersOfJob(jobKey); for (Trigger trigger : triggers) { unscheduleJob(trigger.getName()); } boolean result = quartzSchedulerResources.getJobStore().removeJob(jobKey); if (result) { notifySchedulerThread(0L); notifySchedulerListenersJobDeleted(jobKey); } }
@Override public void deleteJob(String jobKey) throws SchedulerException { validateState(); List<? extends Trigger> triggers = getTriggersOfJob(jobKey); for (Trigger trigger : triggers) { unscheduleJob(trigger.getName()); } boolean result = quartzSchedulerResources.getJobStore().removeJob(jobKey); if (result) { notifySchedulerThread(0L); notifySchedulerListenersJobDeleted(jobKey); } }
@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; }