Java Code Examples for org.quartz.TriggerListener#triggerFired()

The following examples show how to use org.quartz.TriggerListener#triggerFired() . 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 vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void triggerFired(Trigger trigger, JobExecutionContext ctx) {
    for (Iterator iter = this.listenerChain.iterator(); iter.hasNext();) {
        TriggerListener listener = (TriggerListener) iter.next();
        listener.triggerFired(trigger, ctx);
    }
}
 
Example 2
Source File: BroadcastTriggerListener.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void triggerFired(Trigger trigger, JobExecutionContext context) {

        Iterator<TriggerListener> itr = listeners.iterator();
        while(itr.hasNext()) {
            TriggerListener l = itr.next();
            l.triggerFired(trigger, context);
        }
    }
 
Example 3
Source File: QuartzScheduler.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
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 vote down vote up
public void triggerFired(Trigger trigger, JobExecutionContext context) {

        if(!shouldDispatch(trigger)) {
            return;
        }

        Iterator itr = listeners.iterator();
        while(itr.hasNext()) {
            TriggerListener l = (TriggerListener) itr.next();
            l.triggerFired(trigger, context);
        }
    }
 
Example 5
Source File: QuartzScheduler.java    From AsuraFramework with Apache License 2.0 5 votes vote down vote up
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 vote down vote up
/**
 * {@inheritDoc}
 */
public void triggerFired(Trigger trigger, JobExecutionContext ctx) {
    for (Iterator iter = this.listenerChain.iterator(); iter.hasNext();) {
        TriggerListener listener = (TriggerListener) iter.next();
        listener.triggerFired(trigger, ctx);
    }
}