/** * Extension of the MethodInvokingJob, implementing the StatefulJob interface. * Quartz checks whether or not jobs are stateful and if so, * won't let jobs interfere with each other. */ @PersistJobDataAfterExecution @DisallowConcurrentExecution public static class StatefulMethodInvokingJob extends MethodInvokingJob { // No implementation, just an addition of the tag interface StatefulJob // in order to allow stateful method invoking jobs. }
/** * Extension of the MethodInvokingJob, implementing the StatefulJob interface. * Quartz checks whether or not jobs are stateful and if so, * won't let jobs interfere with each other. */ @PersistJobDataAfterExecution @DisallowConcurrentExecution public static class StatefulMethodInvokingJob extends MethodInvokingJob { // No implementation, just an addition of the tag interface StatefulJob // in order to allow stateful method invoking jobs. }
@PersistJobDataAfterExecution @DisallowConcurrentExecution public interface StatefulJob extends Job {
@PersistJobDataAfterExecution @DisallowConcurrentExecution public interface StatefulJob extends Job {
@PersistJobDataAfterExecution public class FileScanJob implements Job {
@PersistJobDataAfterExecution public class DirectoryScanJob implements Job {
@PersistJobDataAfterExecution public class OverseerJob implements Job { private static final Logger LOG = LoggerFactory.getLogger(OverseerJob.class);
@PersistJobDataAfterExecution public class ScheduledInvocationJob implements Job { private static final Log LOG = LogFactory.getLog(ScheduledInvocationJob.class); /* (non-Javadoc) * @see org.quartz.Job#execute(org.quartz.JobExecutionContext) */ @SuppressWarnings("unchecked") public void execute(JobExecutionContext jobContext) throws JobExecutionException { String contextId = jobContext.getMergedJobDataMap().getString("contextId"); String componentId = jobContext.getJobDetail().getKey().getName(); try { ScheduledInvocationCommand command = (ScheduledInvocationCommand) ComponentManager.get(componentId); command.execute(contextId); } catch (Exception e) { LOG.error("Failed to execute component: [" + componentId + "]: ", e); } } }
@PersistJobDataAfterExecution public class ContentReviewReports implements Job { @Setter private ContentReviewService contentReviewService; public void execute(JobExecutionContext arg0) throws JobExecutionException { contentReviewService.checkForReports(); } }
@PersistJobDataAfterExecution public class ScheduledInvocationJob implements Job { private static final Log LOG = LogFactory.getLog(ScheduledInvocationJob.class); /* (non-Javadoc) * @see org.quartz.Job#execute(org.quartz.JobExecutionContext) */ @SuppressWarnings("unchecked") public void execute(JobExecutionContext jobContext) throws JobExecutionException { String contextId = jobContext.getMergedJobDataMap().getString("contextId"); String componentId = jobContext.getJobDetail().getKey().getName(); try { ScheduledInvocationCommand command = (ScheduledInvocationCommand) ComponentManager.get(componentId); command.execute(contextId); } catch (Exception e) { LOG.error("Failed to execute component: [" + componentId + "]: ", e); } } }
@PersistJobDataAfterExecution public class ContentReviewQueue implements Job { @Setter private SessionManager sessionManager; @Setter private ContentReviewService contentReviewService; public void execute(JobExecutionContext arg0) throws JobExecutionException { Session sakaiSession = sessionManager.getCurrentSession(); sakaiSession.setUserId("admin"); sakaiSession.setUserEid("admin"); contentReviewService.processQueue(); } }
/** * 串行执行任务类 * @author HuHui * @version $Id: NoConcurrentJob.java, v 0.1 2018年1月23日 下午4:11:33 HuHui Exp $ */ @DisallowConcurrentExecution @PersistJobDataAfterExecution public class NoConcurrentJob extends CommonJob { }
/** * A stateful job for CamelJob. For Quartz, this means it will re-save all job data map after each job execution, * and it will not run concurrently within the Quartz thread pool even if you have multiple triggers or misfired * instruct to do so. */ @PersistJobDataAfterExecution @DisallowConcurrentExecution public class StatefulCamelJob extends CamelJob { private static final long serialVersionUID = 25L; }
/** * 阻塞调度 * * @author ShenHuaJie * @version 2016年5月27日 下午4:30:46 */ @PersistJobDataAfterExecution @DisallowConcurrentExecution public class StatefulJob extends BaseJob implements Job { }
/** * Extension of the MethodInvokingJob, implementing the StatefulJob interface. * Quartz checks whether or not jobs are stateful and if so, * won't let jobs interfere with each other. */ @PersistJobDataAfterExecution @DisallowConcurrentExecution public static class StatefulMethodInvokingJob extends MethodInvokingJob { // No implementation, just an addition of the tag interface StatefulJob // in order to allow stateful method invoking jobs. }
@PersistJobDataAfterExecution @DisallowConcurrentExecution public class XsltStatefulJob extends XsltTransformJob implements InterruptableJob { private static final Logger LOG = LoggerFactory.getLogger(XsltStatefulJob.class); protected JobTerminationMonitor jobTerminationMonitor; public XsltStatefulJob() { super(); } @Override protected void executeInternal(JobExecutionContext context) { jobTerminationMonitor = JobTerminationMonitor.createInstance(context.getJobDetail().getDescription()); super.executeInternal(context); } @Override public void interrupt() throws UnableToInterruptJobException { if (jobTerminationMonitor != null) { LOG.info("Received cancellation request for job " + jobTerminationMonitor.getJobName()); jobTerminationMonitor.terminate(); } } }
@PersistJobDataAfterExecution public class DynamicExpressionObserverJob implements Deactivatable, Job
@PersistJobDataAfterExecution @DisallowConcurrentExecution public class MailSenderJob implements Job {
@PersistJobDataAfterExecution @DisallowConcurrentExecution public static class TestJob implements Job { @Override public void execute(JobExecutionContext context) throws JobExecutionException { AlarmServiceTest.counter++; } } }
@PersistJobDataAfterExecution @DisallowConcurrentExecution public class HibernateDataSourceHarvesterJob extends ScheduledJob implements Job {