org.quartz.utils.ClassUtils Java Examples

The following examples show how to use org.quartz.utils.ClassUtils. 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: JTAAnnotationAwareJobRunShellFactory.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * <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);
        }
    }
}
 
Example #2
Source File: RedisJobStore.java    From redis-quartz with MIT License 5 votes vote down vote up
@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;
}
 
Example #3
Source File: RedisJobStore.java    From redis-quartz with MIT License 5 votes vote down vote up
@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;
}
 
Example #4
Source File: JobDetailImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return whether the associated Job class carries the {@link PersistJobDataAfterExecution} annotation.
 */
public boolean isPersistJobDataAfterExecution() {

    return ClassUtils.isAnnotationPresent(jobClass, PersistJobDataAfterExecution.class);
}
 
Example #5
Source File: JobDetailImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @return whether the associated Job class carries the {@link DisallowConcurrentExecution} annotation.
 */
public boolean isConcurrentExectionDisallowed() {
    
    return ClassUtils.isAnnotationPresent(jobClass, DisallowConcurrentExecution.class);
}
 
Example #6
Source File: AbstractRedisStorage.java    From quartz-redis-jobstore with Apache License 2.0 4 votes vote down vote up
protected boolean isPersistJobDataAfterExecution(Class<? extends Job> jobClass){
    return ClassUtils.isAnnotationPresent(jobClass, PersistJobDataAfterExecution.class);
}
 
Example #7
Source File: AbstractRedisStorage.java    From quartz-redis-jobstore with Apache License 2.0 2 votes vote down vote up
/**
 * 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);
}