类org.quartz.utils.ClassUtils源码实例Demo

下面列出了怎么用org.quartz.utils.ClassUtils的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * <p>
 * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread}
 * </code> to obtain instances of <code>
 * {@link org.quartz.core.JobRunShell}</code>.
 * </p>
 */
public JobRunShell createJobRunShell(TriggerFiredBundle bundle)
        throws SchedulerException {
    ExecuteInJTATransaction jtaAnnotation = ClassUtils.getAnnotation(bundle.getJobDetail().getJobClass(), ExecuteInJTATransaction.class);
    if(jtaAnnotation == null)
        return new JobRunShell(scheduler, bundle);
    else {
        int timeout = jtaAnnotation.timeout();
        if (timeout >= 0) {
            return new JTAJobRunShell(scheduler, bundle, timeout);
        } else {
            return new JTAJobRunShell(scheduler, bundle);
        }
    }
}
 
源代码2 项目: redis-quartz   文件: RedisJobStore.java
@SuppressWarnings("unchecked")
private boolean isJobConcurrentExectionDisallowed(String jobClassName) {
	boolean jobConcurrentExectionDisallowed = false;
	try {
		Class<Job> jobClass = (Class<Job>) loadHelper.getClassLoader().loadClass(jobClassName);
		jobConcurrentExectionDisallowed = ClassUtils.isAnnotationPresent(jobClass, DisallowConcurrentExecution.class);
	} catch (Exception ex) {
		log.error("could not determine whether class: " + jobClassName + " is JobConcurrentExectionDisallowed annotated");
	}
	return jobConcurrentExectionDisallowed;
}
 
源代码3 项目: redis-quartz   文件: RedisJobStore.java
@SuppressWarnings("unchecked")
private boolean isPersistJobDataAfterExecution(String jobClassName) {
	boolean persistJobDataAfterExecution = false;
	try {
		Class<Job> jobClass = (Class<Job>) loadHelper.getClassLoader().loadClass(jobClassName);
		persistJobDataAfterExecution = ClassUtils.isAnnotationPresent(jobClass, PersistJobDataAfterExecution.class);
	} catch (Exception ex) {
		log.error("could not determine whether class: " + jobClassName + " is PersistJobDataAfterExecution annotated");
	}
	return persistJobDataAfterExecution;
}
 
源代码4 项目: lams   文件: JobDetailImpl.java
/**
 * @return whether the associated Job class carries the {@link PersistJobDataAfterExecution} annotation.
 */
public boolean isPersistJobDataAfterExecution() {

    return ClassUtils.isAnnotationPresent(jobClass, PersistJobDataAfterExecution.class);
}
 
源代码5 项目: lams   文件: JobDetailImpl.java
/**
 * @return whether the associated Job class carries the {@link DisallowConcurrentExecution} annotation.
 */
public boolean isConcurrentExectionDisallowed() {
    
    return ClassUtils.isAnnotationPresent(jobClass, DisallowConcurrentExecution.class);
}
 
protected boolean isPersistJobDataAfterExecution(Class<? extends Job> jobClass){
    return ClassUtils.isAnnotationPresent(jobClass, PersistJobDataAfterExecution.class);
}
 
/**
 * Determine if the given job class disallows concurrent execution
 * @param jobClass the job class in question
 * @return true if concurrent execution is NOT allowed; false if concurrent execution IS allowed
 */
protected boolean isJobConcurrentExecutionDisallowed(Class<? extends Job> jobClass){
    return ClassUtils.isAnnotationPresent(jobClass, DisallowConcurrentExecution.class);
}
 
 类所在包
 同包方法