All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.quartz.ListenerManager Maven / Gradle / Ivy

/*
 * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */

package org.quartz;

import java.util.List;

/**
 * Client programs may be interested in the 'listener' interfaces that are
 * available from Quartz. The {@link JobListener} interface
 * provides notifications of Job executions. The 
 * {@link TriggerListener} interface provides notifications of 
 * Trigger firings. The {@link SchedulerListener} 
 * interface provides notifications of Scheduler events and 
 * errors.  Listeners can be associated with local schedulers through the 
 * {@link ListenerManager} interface.  
 * 
 * 

Listener registration order is preserved, and hence notification of listeners * will be in the order in which they were registered.

* * @author jhouse * @since 2.0 - previously listeners were managed directly on the Scheduler interface. */ public interface ListenerManager { /** * Add the given {@link JobListener} to the Scheduler, * and register it to receive events for all Jobs. * * Because no matchers are provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addJobListener(JobListener jobListener); /** * Add the given {@link JobListener} to the Scheduler, * and register it to receive events for Jobs that are matched by the * given Matcher. * * If no matchers are provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addJobListener(JobListener jobListener, Matcher matcher); /** * Add the given {@link JobListener} to the Scheduler, * and register it to receive events for Jobs that are matched by ANY of the * given Matchers. * * If no matchers are provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addJobListener(JobListener jobListener, Matcher ... matchers); /** * Add the given {@link JobListener} to the Scheduler, * and register it to receive events for Jobs that are matched by ANY of the * given Matchers. * * If no matchers are provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addJobListener(JobListener jobListener, List> matchers); /** * Add the given Matcher to the set of matchers for which the listener * will receive events if ANY of the matchers match. * * @param listenerName the name of the listener to add the matcher to * @param matcher the additional matcher to apply for selecting events * @return true if the identified listener was found and updated */ public boolean addJobListenerMatcher(String listenerName, Matcher matcher); /** * Remove the given Matcher to the set of matchers for which the listener * will receive events if ANY of the matchers match. * * @param listenerName the name of the listener to add the matcher to * @param matcher the additional matcher to apply for selecting events * @return true if the given matcher was found and removed from the listener's list of matchers */ public boolean removeJobListenerMatcher(String listenerName, Matcher matcher); /** * Set the set of Matchers for which the listener * will receive events if ANY of the matchers match. * *

Removes any existing matchers for the identified listener!

* * @param listenerName the name of the listener to add the matcher to * @param matchers the matchers to apply for selecting events * @return true if the given matcher was found and removed from the listener's list of matchers */ public boolean setJobListenerMatchers(String listenerName, List> matchers); /** * Get the set of Matchers for which the listener * will receive events if ANY of the matchers match. * * * @param listenerName the name of the listener to add the matcher to * @return the matchers registered for selecting events for the identified listener */ public List> getJobListenerMatchers(String listenerName); /** * Remove the identified {@link JobListener} from the Scheduler. * * @return true if the identified listener was found in the list, and * removed. */ public boolean removeJobListener(String name); /** * Get a List containing all of the {@link JobListener}s in * the Scheduler, in the order in which they were registered. */ public List getJobListeners(); /** * Get the {@link JobListener} that has the given name. */ public JobListener getJobListener(String name); /** * Add the given {@link TriggerListener} to the Scheduler, * and register it to receive events for all Triggers. * * Because no matcher is provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addTriggerListener(TriggerListener triggerListener); /** * Add the given {@link TriggerListener} to the Scheduler, * and register it to receive events for Triggers that are matched by the * given Matcher. * * If no matcher is provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addTriggerListener(TriggerListener triggerListener, Matcher matcher); /** * Add the given {@link TriggerListener} to the Scheduler, * and register it to receive events for Triggers that are matched by ANY of the * given Matchers. * * If no matcher is provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addTriggerListener(TriggerListener triggerListener, Matcher ... matchers); /** * Add the given {@link TriggerListener} to the Scheduler, * and register it to receive events for Triggers that are matched by ANY of the * given Matchers. * * If no matcher is provided, the EverythingMatcher will be used. * * @see Matcher * @see org.quartz.impl.matchers.EverythingMatcher */ public void addTriggerListener(TriggerListener triggerListener, List> matchers); /** * Add the given Matcher to the set of matchers for which the listener * will receive events if ANY of the matchers match. * * @param listenerName the name of the listener to add the matcher to * @param matcher the additional matcher to apply for selecting events * @return true if the identified listener was found and updated */ public boolean addTriggerListenerMatcher(String listenerName, Matcher matcher); /** * Remove the given Matcher to the set of matchers for which the listener * will receive events if ANY of the matchers match. * * @param listenerName the name of the listener to add the matcher to * @param matcher the additional matcher to apply for selecting events * @return true if the given matcher was found and removed from the listener's list of matchers */ public boolean removeTriggerListenerMatcher(String listenerName, Matcher matcher); /** * Set the set of Matchers for which the listener * will receive events if ANY of the matchers match. * *

Removes any existing matchers for the identified listener!

* * @param listenerName the name of the listener to add the matcher to * @param matchers the matchers to apply for selecting events * @return true if the given matcher was found and removed from the listener's list of matchers */ public boolean setTriggerListenerMatchers(String listenerName, List> matchers); /** * Get the set of Matchers for which the listener * will receive events if ANY of the matchers match. * * * @param listenerName the name of the listener to add the matcher to * @return the matchers registered for selecting events for the identified listener */ public List> getTriggerListenerMatchers( String listenerName); /** * Remove the identified {@link TriggerListener} from the Scheduler. * * @return true if the identified listener was found in the list, and * removed. */ public boolean removeTriggerListener(String name); /** * Get a List containing all of the {@link TriggerListener}s * in the Scheduler, in the order in which they were registered. */ public List getTriggerListeners(); /** * Get the {@link TriggerListener} that has the given name. */ public TriggerListener getTriggerListener(String name); /** * Register the given {@link SchedulerListener} with the * Scheduler. */ public void addSchedulerListener(SchedulerListener schedulerListener); /** * Remove the given {@link SchedulerListener} from the * Scheduler. * * @return true if the identified listener was found in the list, and * removed. */ public boolean removeSchedulerListener(SchedulerListener schedulerListener); /** * Get a List containing all of the {@link SchedulerListener}s * registered with the Scheduler, in the order in which they were registered. */ public List getSchedulerListeners(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy