org.quartz.impl.matchers.EverythingMatcher Java Examples

The following examples show how to use org.quartz.impl.matchers.EverythingMatcher. 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: ListenerManagerImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public void addJobListener(JobListener jobListener, List<Matcher<JobKey>> matchers) {
    if (jobListener.getName() == null || jobListener.getName().length() == 0) {
        throw new IllegalArgumentException(
                "JobListener name cannot be empty.");
    }
    
    synchronized (globalJobListeners) {
        globalJobListeners.put(jobListener.getName(), jobListener);
        LinkedList<Matcher<JobKey>> matchersL = new  LinkedList<Matcher<JobKey>>();
        if(matchers != null && matchers.size() > 0)
            matchersL.addAll(matchers);
        else
            matchersL.add(EverythingMatcher.allJobs());
        
        globalJobListenersMatchers.put(jobListener.getName(), matchersL);
    }
}
 
Example #2
Source File: ListenerManagerImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public void addJobListener(JobListener jobListener, Matcher<JobKey> matcher) {
    if (jobListener.getName() == null || jobListener.getName().length() == 0) {
        throw new IllegalArgumentException(
                "JobListener name cannot be empty.");
    }
    
    synchronized (globalJobListeners) {
        globalJobListeners.put(jobListener.getName(), jobListener);
        LinkedList<Matcher<JobKey>> matchersL = new  LinkedList<Matcher<JobKey>>();
        if(matcher != null)
            matchersL.add(matcher);
        else
            matchersL.add(EverythingMatcher.allJobs());
        
        globalJobListenersMatchers.put(jobListener.getName(), matchersL);
    }
}
 
Example #3
Source File: ListenerManagerImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public void addTriggerListener(TriggerListener triggerListener, List<Matcher<TriggerKey>> matchers) {
    if (triggerListener.getName() == null
            || triggerListener.getName().length() == 0) {
        throw new IllegalArgumentException(
                "TriggerListener name cannot be empty.");
    }

    synchronized (globalTriggerListeners) {
        globalTriggerListeners.put(triggerListener.getName(), triggerListener);

        LinkedList<Matcher<TriggerKey>> matchersL = new  LinkedList<Matcher<TriggerKey>>();
        if(matchers != null && matchers.size() > 0)
            matchersL.addAll(matchers);
        else
            matchersL.add(EverythingMatcher.allTriggers());

        globalTriggerListenersMatchers.put(triggerListener.getName(), matchersL);
    }
}
 
Example #4
Source File: Quartz2Adapter.java    From javamelody with Apache License 2.0 6 votes vote down vote up
@Override
public void addGlobalJobListener(JobListener jobGlobalListener) throws SchedulerException {
	final Scheduler defaultScheduler;
	final List<Matcher<JobKey>> allJobs = new ArrayList<Matcher<JobKey>>();
	allJobs.add(EverythingMatcher.allJobs());
	if (Parameter.QUARTZ_DEFAULT_LISTENER_DISABLED.getValueAsBoolean()) {
		defaultScheduler = null;
		LOG.debug("Initialization of Quartz default listener has been disabled");
	} else {
		defaultScheduler = StdSchedulerFactory.getDefaultScheduler();
		defaultScheduler.getListenerManager().addJobListener(jobGlobalListener, allJobs);
	}
	for (final Scheduler scheduler : JobInformations.getAllSchedulers()) {
		if (scheduler != defaultScheduler) {
			scheduler.getListenerManager().addJobListener(jobGlobalListener, allJobs);
		}
	}
}
 
Example #5
Source File: Context.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
private Context() throws Exception {
	this.token = UUID.randomUUID().toString();
	this.applications = new Applications();
	this.queues = new ArrayList<AbstractQueue<?>>();
	this.scheduler = new StdSchedulerFactory(SchedulerFactoryProperties.concrete()).getScheduler();
	this.scheduler.getListenerManager().addJobListener(new JobReportListener(), EverythingMatcher.allJobs());
	this.scheduler.start();
}
 
Example #6
Source File: Context.java    From o2oa with GNU Affero General Public License v3.0 5 votes vote down vote up
private Context() throws Exception {
	SslTools.ignoreSsl();
	this.applications = new Applications();
	this.token = UUID.randomUUID().toString();
	this.queues = new ArrayList<AbstractQueue<?>>();
	this.scheduler = new StdSchedulerFactory(SchedulerFactoryProperties.concrete()).getScheduler();
	this.scheduler.getListenerManager().addJobListener(new JobReportListener(), EverythingMatcher.allJobs());
	this.scheduler.start();
}
 
Example #7
Source File: ListenerManagerImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void addJobListener(JobListener jobListener) {
    addJobListener(jobListener, EverythingMatcher.allJobs());
}
 
Example #8
Source File: ListenerManagerImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void addTriggerListener(TriggerListener triggerListener) {
    addTriggerListener(triggerListener, EverythingMatcher.allTriggers());
}
 
Example #9
Source File: LoggingTriggerHistoryPlugin.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String pname, Scheduler scheduler, ClassLoadHelper classLoadHelper)
    throws SchedulerException {
    this.name = pname;

    scheduler.getListenerManager().addTriggerListener(this,  EverythingMatcher.allTriggers());
}
 
Example #10
Source File: LoggingJobHistoryPlugin.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String pname, Scheduler scheduler,ClassLoadHelper classLoadHelper)
    throws SchedulerException {
    this.name = pname;
    scheduler.getListenerManager().addJobListener(this, EverythingMatcher.allJobs());
}