org.quartz.Matcher源码实例Demo

类org.quartz.Matcher源码实例Demo

下面列出了org.quartz.Matcher 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: 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);
    }
}
 
源代码2 项目: 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);
    }
}
 
源代码3 项目: 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);
    }
}
 
源代码4 项目: lams   文件: ListenerManagerImpl.java
public void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey> matcher) {
    if(matcher == null)
        throw new IllegalArgumentException("Null value not acceptable for matcher.");
    
    if (triggerListener.getName() == null
            || triggerListener.getName().length() == 0) {
        throw new IllegalArgumentException(
                "TriggerListener name cannot be empty.");
    }

    synchronized (globalTriggerListeners) {
        globalTriggerListeners.put(triggerListener.getName(), triggerListener);
        List<Matcher<TriggerKey>> matchers = new LinkedList<Matcher<TriggerKey>>();
        matchers.add(matcher);
        globalTriggerListenersMatchers.put(triggerListener.getName(), matchers);
    }
}
 
源代码5 项目: 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);
		}
	}
}
 
public AbstractQuartzTaskManager(TaskRepository taskRepository, TaskStore taskStore) throws TaskException {

        this.taskRepository = taskRepository;
        this.scheduler = TasksDSComponent.getScheduler();
        this.taskStore = taskStore;
        try {
            Matcher<TriggerKey> tenantTaskTypeGroupMatcher = GroupMatcher.groupEquals(this.getTenantTaskGroup());
            this.getScheduler().getListenerManager().addTriggerListener(
                    new TaskTriggerListener(this.getTenantTaskGroup()), tenantTaskTypeGroupMatcher);
        } catch (SchedulerException e) {
            throw new TaskException("Error in initiating task trigger listener", TaskException.Code.UNKNOWN, e);
        }
    }
 
源代码7 项目: lams   文件: AndMatcher.java
protected AndMatcher(Matcher<T> leftOperand, Matcher<T> rightOperand) {
    if(leftOperand == null || rightOperand == null)
        throw new IllegalArgumentException("Two non-null operands required!");
    
    this.leftOperand = leftOperand;
    this.rightOperand = rightOperand;
}
 
源代码8 项目: lams   文件: OrMatcher.java
protected OrMatcher(Matcher<T> leftOperand, Matcher<T> rightOperand) {
    if(leftOperand == null || rightOperand == null)
        throw new IllegalArgumentException("Two non-null operands required!");
    
    this.leftOperand = leftOperand;
    this.rightOperand = rightOperand;
}
 
源代码9 项目: lams   文件: ListenerManagerImpl.java
public boolean addJobListenerMatcher(String listenerName, Matcher<JobKey> matcher) {
    if(matcher == null)
        throw new IllegalArgumentException("Null value not acceptable.");
    
    synchronized (globalJobListeners) {
        List<Matcher<JobKey>> matchers = globalJobListenersMatchers.get(listenerName);
        if(matchers == null)
            return false;
        matchers.add(matcher);
        return true;
    }
}
 
源代码10 项目: lams   文件: ListenerManagerImpl.java
public boolean removeJobListenerMatcher(String listenerName, Matcher<JobKey> matcher) {
    if(matcher == null)
        throw new IllegalArgumentException("Non-null value not acceptable.");
    
    synchronized (globalJobListeners) {
        List<Matcher<JobKey>> matchers = globalJobListenersMatchers.get(listenerName);
        if(matchers == null)
            return false;
        return matchers.remove(matcher);
    }
}
 
源代码11 项目: lams   文件: ListenerManagerImpl.java
public List<Matcher<JobKey>> getJobListenerMatchers(String listenerName) {
    synchronized (globalJobListeners) {
        List<Matcher<JobKey>> matchers = globalJobListenersMatchers.get(listenerName);
        if(matchers == null)
            return null;
        return Collections.unmodifiableList(matchers);
    }
}
 
源代码12 项目: lams   文件: ListenerManagerImpl.java
public boolean setJobListenerMatchers(String listenerName, List<Matcher<JobKey>> matchers)  {
    if(matchers == null)
        throw new IllegalArgumentException("Non-null value not acceptable.");
    
    synchronized (globalJobListeners) {
        List<Matcher<JobKey>> oldMatchers = globalJobListenersMatchers.get(listenerName);
        if(oldMatchers == null)
            return false;
        globalJobListenersMatchers.put(listenerName, matchers);
        return true;
    }
}
 
源代码13 项目: lams   文件: ListenerManagerImpl.java
public boolean addTriggerListenerMatcher(String listenerName, Matcher<TriggerKey> matcher) {
    if(matcher == null)
        throw new IllegalArgumentException("Non-null value not acceptable.");
    
    synchronized (globalTriggerListeners) {
        List<Matcher<TriggerKey>> matchers = globalTriggerListenersMatchers.get(listenerName);
        if(matchers == null)
            return false;
        matchers.add(matcher);
        return true;
    }
}
 
源代码14 项目: lams   文件: ListenerManagerImpl.java
public boolean removeTriggerListenerMatcher(String listenerName, Matcher<TriggerKey> matcher) {
    if(matcher == null)
        throw new IllegalArgumentException("Non-null value not acceptable.");
    
    synchronized (globalTriggerListeners) {
        List<Matcher<TriggerKey>> matchers = globalTriggerListenersMatchers.get(listenerName);
        if(matchers == null)
            return false;
        return matchers.remove(matcher);
    }
}
 
源代码15 项目: lams   文件: ListenerManagerImpl.java
public List<Matcher<TriggerKey>> getTriggerListenerMatchers(String listenerName) {
    synchronized (globalTriggerListeners) {
        List<Matcher<TriggerKey>> matchers = globalTriggerListenersMatchers.get(listenerName);
        if(matchers == null)
            return null;
        return Collections.unmodifiableList(matchers);
    }
}
 
源代码16 项目: lams   文件: ListenerManagerImpl.java
public boolean setTriggerListenerMatchers(String listenerName, List<Matcher<TriggerKey>> matchers)  {
    if(matchers == null)
        throw new IllegalArgumentException("Non-null value not acceptable.");
    
    synchronized (globalTriggerListeners) {
        List<Matcher<TriggerKey>> oldMatchers = globalTriggerListenersMatchers.get(listenerName);
        if(oldMatchers == null)
            return false;
        globalTriggerListenersMatchers.put(listenerName, matchers);
        return true;
    }
}
 
源代码17 项目: lams   文件: QuartzScheduler.java
private boolean matchJobListener(JobListener listener, JobKey key) {
    List<Matcher<JobKey>> matchers = getListenerManager().getJobListenerMatchers(listener.getName());
    if(matchers == null)
        return true;
    for(Matcher<JobKey> matcher: matchers) {
        if(matcher.isMatch(key))
            return true;
    }
    return false;
}
 
源代码18 项目: lams   文件: QuartzScheduler.java
private boolean matchTriggerListener(TriggerListener listener, TriggerKey key) {
    List<Matcher<TriggerKey>> matchers = getListenerManager().getTriggerListenerMatchers(listener.getName());
    if(matchers == null)
        return true;
    for(Matcher<TriggerKey> matcher: matchers) {
        if(matcher.isMatch(key))
            return true;
    }
    return false;
}
 
源代码19 项目: lams   文件: AndMatcher.java
/**
 * Create an AndMatcher that depends upon the result of both of the given matchers.
 */
public static <U extends Key<?>> AndMatcher<U> and(Matcher<U> leftOperand, Matcher<U> rightOperand) {
    return new AndMatcher<U>(leftOperand, rightOperand);
}
 
源代码20 项目: lams   文件: AndMatcher.java
public Matcher<T> getLeftOperand() {
    return leftOperand;
}
 
源代码21 项目: lams   文件: AndMatcher.java
public Matcher<T> getRightOperand() {
    return rightOperand;
}
 
源代码22 项目: lams   文件: NotMatcher.java
protected NotMatcher(Matcher<T> operand) {
    if(operand == null)
        throw new IllegalArgumentException("Non-null operand required!");
    
    this.operand = operand;
}
 
源代码23 项目: lams   文件: NotMatcher.java
/**
 * Create a NotMatcher that reverses the result of the given matcher.
 */
public static <U extends Key<?>> NotMatcher<U> not(Matcher<U> operand) {
    return new NotMatcher<U>(operand);
}
 
源代码24 项目: lams   文件: NotMatcher.java
public Matcher<T> getOperand() {
    return operand;
}
 
源代码25 项目: lams   文件: OrMatcher.java
/**
 * Create an OrMatcher that depends upon the result of at least one of the given matchers.
 */
public static <U extends Key<?>> OrMatcher<U> or(Matcher<U> leftOperand, Matcher<U> rightOperand) {
    return new OrMatcher<U>(leftOperand, rightOperand);
}
 
源代码26 项目: lams   文件: OrMatcher.java
public Matcher<T> getLeftOperand() {
    return leftOperand;
}
 
源代码27 项目: lams   文件: OrMatcher.java
public Matcher<T> getRightOperand() {
    return rightOperand;
}
 
源代码28 项目: lams   文件: ListenerManagerImpl.java
public void addJobListener(JobListener jobListener, Matcher<JobKey> ... matchers) {
    addJobListener(jobListener, Arrays.asList(matchers));
}
 
源代码29 项目: lams   文件: ListenerManagerImpl.java
public void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey> ... matchers) {
    addTriggerListener(triggerListener, Arrays.asList(matchers));
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 类方法
 同包方法