下面列出了怎么用org.quartz.DisallowConcurrentExecution的API类实例代码及写法,或者点击链接到github查看源代码。
@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;
}
/**
* @return whether the associated Job class carries the {@link DisallowConcurrentExecution} annotation.
*/
public boolean isConcurrentExectionDisallowed() {
return ClassUtils.isAnnotationPresent(jobClass, DisallowConcurrentExecution.class);
}
public static boolean isDisallowConcurrentExecution(Class<?> jobClass) {
return getAnnotation(jobClass, DisallowConcurrentExecution.class) != null;
}