Java Code Examples for org.quartz.TriggerListener#vetoJobExecution()
The following examples show how to use
org.quartz.TriggerListener#vetoJobExecution() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChainedListener.java From uyuni with GNU General Public License v2.0 | 5 votes |
/** * {@inheritDoc} */ @Override public boolean vetoJobExecution(Trigger trigger, JobExecutionContext ctx) { boolean retval = false; for (Iterator iter = this.listenerChain.iterator(); iter.hasNext();) { TriggerListener listener = (TriggerListener) iter.next(); boolean tmp = listener.vetoJobExecution(trigger, ctx); if (!retval && tmp) { retval = true; } } return retval; }
Example 2
Source File: BroadcastTriggerListener.java From lams with GNU General Public License v2.0 | 5 votes |
public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) { Iterator<TriggerListener> itr = listeners.iterator(); while(itr.hasNext()) { TriggerListener l = itr.next(); if(l.vetoJobExecution(trigger, context)) { return true; } } return false; }
Example 3
Source File: QuartzScheduler.java From lams with GNU General Public License v2.0 | 5 votes |
public boolean notifyTriggerListenersFired(JobExecutionContext jec) throws SchedulerException { boolean vetoedExecution = false; // build a list of all trigger listeners that are to be notified... List<TriggerListener> triggerListeners = buildTriggerListenerList(); // notify all trigger listeners in the list for(TriggerListener tl: triggerListeners) { try { if(!matchTriggerListener(tl, jec.getTrigger().getKey())) continue; tl.triggerFired(jec.getTrigger(), jec); if(tl.vetoJobExecution(jec.getTrigger(), jec)) { vetoedExecution = true; } } catch (Exception e) { SchedulerException se = new SchedulerException( "TriggerListener '" + tl.getName() + "' threw exception: " + e.getMessage(), e); throw se; } } return vetoedExecution; }
Example 4
Source File: FilterAndBroadcastTriggerListener.java From AsuraFramework with Apache License 2.0 | 5 votes |
public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context) { if(!shouldDispatch(trigger)) { return false; } Iterator itr = listeners.iterator(); while(itr.hasNext()) { TriggerListener l = (TriggerListener) itr.next(); if(l.vetoJobExecution(trigger, context)) { return true; } } return false; }
Example 5
Source File: QuartzScheduler.java From AsuraFramework with Apache License 2.0 | 5 votes |
public boolean notifyTriggerListenersFired(JobExecutionContext jec) throws SchedulerException { // build a list of all trigger listeners that are to be notified... List triggerListeners = buildTriggerListenerList(jec.getTrigger() .getTriggerListenerNames()); boolean vetoedExecution = false; // notify all trigger listeners in the list java.util.Iterator itr = triggerListeners.iterator(); while (itr.hasNext()) { TriggerListener tl = (TriggerListener) itr.next(); try { tl.triggerFired(jec.getTrigger(), jec); if(tl.vetoJobExecution(jec.getTrigger(), jec)) { vetoedExecution = true; } } catch (Exception e) { SchedulerException se = new SchedulerException( "TriggerListener '" + tl.getName() + "' threw exception: " + e.getMessage(), e); se.setErrorCode(SchedulerException.ERR_TRIGGER_LISTENER); throw se; } } return vetoedExecution; }
Example 6
Source File: ChainedListener.java From spacewalk with GNU General Public License v2.0 | 5 votes |
/** * {@inheritDoc} */ public boolean vetoJobExecution(Trigger trigger, JobExecutionContext ctx) { boolean retval = false; for (Iterator iter = this.listenerChain.iterator(); iter.hasNext();) { TriggerListener listener = (TriggerListener) iter.next(); boolean tmp = listener.vetoJobExecution(trigger, ctx); if (!retval && tmp) { retval = true; } } return retval; }