Java 类org.quartz.impl.matchers.EverythingMatcher 实例源码

项目:lams    文件:ListenerManagerImpl.java   
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);
    }
}
项目:lams    文件:ListenerManagerImpl.java   
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);
    }
}
项目:lams    文件:ListenerManagerImpl.java   
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);
    }
}
项目:javamelody    文件:Quartz2Adapter.java   
@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);
        }
    }
}
项目:oxCore    文件:QuartzSchedulerManager.java   
protected void initInternal() {
    try {
        StdSchedulerFactory factory = new StdSchedulerFactory();
        factory.initialize(QUARTZ_PROPERTY_FILE_NAME);

        scheduler = factory.getScheduler();

        // Register job listener to bound request context to every job
        // execution
        scheduler.getListenerManager().addJobListener(jobListener, EverythingMatcher.allJobs());
        // Replace default job factory
        scheduler.setJobFactory(jobFactory);
    } catch (SchedulerException ex) {
        throw new IllegalStateException("Failed to initialize Quartz scheduler manager", ex);
    }

    log.info("Quartz scheduler manager initialized");
}
项目:bgp-ls    文件:FireEventTimeManager.java   
void createJobDetail(Class<T> jobClass, InternalFSM fsm, Map<String, Object> additionalJobData) throws SchedulerException {
    JobDataMap map = new JobDataMap();

    map.put(FireEventTimeJob.FSM_KEY, fsm);

    if(additionalJobData != null)  {
        for(Entry<String, Object> entry : additionalJobData.entrySet())
            map.put(entry.getKey(), entry.getValue());
    }

    jobKey = new JobKey(UUID.randomUUID().toString());
    jobDetail = JobBuilder.newJob(jobClass).usingJobData(map).withIdentity(jobKey).build();

    scheduler.getListenerManager().addTriggerListener(clearTriggerData, EverythingMatcher.allTriggers());
}
项目:lams    文件:ListenerManagerImpl.java   
public void addJobListener(JobListener jobListener) {
    addJobListener(jobListener, EverythingMatcher.allJobs());
}
项目:lams    文件:ListenerManagerImpl.java   
public void addTriggerListener(TriggerListener triggerListener) {
    addTriggerListener(triggerListener, EverythingMatcher.allTriggers());
}
项目:springboot-quartz-mongodb    文件:JobHistoryListener.java   
public void initialize(String pname, Scheduler scheduler, ClassLoadHelper classLoadHelper) throws SchedulerException {
    this.name = pname;
    this.scheduler = scheduler;
    scheduler.getListenerManager().addJobListener(this, EverythingMatcher.allJobs());
}
项目:lams    文件:LoggingTriggerHistoryPlugin.java   
/**
 * <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());
}
项目:lams    文件:LoggingJobHistoryPlugin.java   
/**
 * <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());
}