本文整理汇总了Java中org.quartz.Trigger.CompletedExecutionInstruction类的典型用法代码示例。如果您正苦于以下问题:Java CompletedExecutionInstruction类的具体用法?Java CompletedExecutionInstruction怎么用?Java CompletedExecutionInstruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CompletedExecutionInstruction类属于org.quartz.Trigger包,在下文中一共展示了CompletedExecutionInstruction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyTriggerListenersComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
private boolean notifyTriggerListenersComplete(JobExecutionContext jobExCtxt, CompletedExecutionInstruction instCode) {
try {
qs.notifyTriggerListenersComplete(jobExCtxt, instCode);
} catch (SchedulerException se) {
qs.notifySchedulerListenersError(
"Unable to notify TriggerListener(s) of Job that was executed: "
+ "(error will be ignored). trigger= "
+ jobExCtxt.getTrigger().getKey() + " job= "
+ jobExCtxt.getJobDetail().getKey(), se);
return false;
}
if (jobExCtxt.getTrigger().getNextFireTime() == null) {
qs.notifySchedulerListenersFinalized(jobExCtxt.getTrigger());
}
return true;
}
示例2: notifyTriggerListenersComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
public void notifyTriggerListenersComplete(JobExecutionContext jec,
CompletedExecutionInstruction instCode) throws SchedulerException {
// build a list of all trigger listeners that are to be notified...
List<TriggerListener> triggerListeners = buildTriggerListenerList();
// notify all trigger listeners in the list
for(TriggerListener tl: triggerListeners) {
try {
if(!matchTriggerListener(tl, jec.getTrigger().getKey()))
continue;
tl.triggerComplete(jec.getTrigger(), jec, instCode);
} catch (Exception e) {
SchedulerException se = new SchedulerException(
"TriggerListener '" + tl.getName()
+ "' threw exception: " + e.getMessage(), e);
throw se;
}
}
}
示例3: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
public void triggerComplete(Trigger trigger, JobExecutionContext context,
CompletedExecutionInstruction triggerInstructionCode) {
if (!getLog().isInfoEnabled()) {
return;
}
String instrCode = "UNKNOWN";
if (triggerInstructionCode == CompletedExecutionInstruction.DELETE_TRIGGER) {
instrCode = "DELETE TRIGGER";
} else if (triggerInstructionCode == CompletedExecutionInstruction.NOOP) {
instrCode = "DO NOTHING";
} else if (triggerInstructionCode == CompletedExecutionInstruction.RE_EXECUTE_JOB) {
instrCode = "RE-EXECUTE JOB";
} else if (triggerInstructionCode == CompletedExecutionInstruction.SET_ALL_JOB_TRIGGERS_COMPLETE) {
instrCode = "SET ALL OF JOB'S TRIGGERS COMPLETE";
} else if (triggerInstructionCode == CompletedExecutionInstruction.SET_TRIGGER_COMPLETE) {
instrCode = "SET THIS TRIGGER COMPLETE";
}
Object[] args = {
trigger.getKey().getName(), trigger.getKey().getGroup(),
trigger.getPreviousFireTime(), trigger.getNextFireTime(),
new java.util.Date(), context.getJobDetail().getKey().getName(),
context.getJobDetail().getKey().getGroup(),
Integer.valueOf(context.getRefireCount()),
triggerInstructionCode.toString(), instrCode
};
getLog().info(MessageFormat.format(getTriggerCompleteMessage(), args));
}
示例4: jobDataOnlySavedWhenDirty
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Test
public void jobDataOnlySavedWhenDirty() throws Exception {
JobDetail job = JobBuilder.newJob(MyJob.class).withIdentity("testJob").build();
OperableTrigger trigger = (OperableTrigger) TriggerBuilder.newTrigger().withIdentity("testJob").forJob(job).build();
jobStore.storeJobAndTrigger(job, trigger);
int baseRecordVersion = queryJobDetail("testJob").getVersion();
// same job data after trigger fired...
jobStore.triggersFired(Arrays.asList(trigger));
jobStore.triggeredJobComplete(trigger, job, CompletedExecutionInstruction.NOOP);
// ...should not save the job
assertThat(queryJobDetail("testJob").getVersion(), is(baseRecordVersion));
// different job data after trigger fired...
jobStore.triggersFired(Arrays.asList(trigger));
job.getJobDataMap().put("testKey", "testValue");
jobStore.triggeredJobComplete(trigger, job, CompletedExecutionInstruction.NOOP);
// ...should save the job
assertThat(queryJobDetail("testJob").getVersion(), greaterThan(baseRecordVersion));
}
示例5: triggeredJobComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
/**
* <p>
* Inform the <code>JobStore</code> that the scheduler has completed the
* firing of the given <code>Trigger</code> (and the execution its
* associated <code>Job</code>), and that the <code>{@link org.quartz.JobDataMap}</code>
* in the given <code>JobDetail</code> should be updated if the <code>Job</code>
* is stateful.
* </p>
*/
public void triggeredJobComplete(final OperableTrigger trigger,
final JobDetail jobDetail, final CompletedExecutionInstruction triggerInstCode) {
retryExecuteInNonManagedTXLock(
LOCK_TRIGGER_ACCESS,
new VoidTransactionCallback() {
public void executeVoid(Connection conn) throws JobPersistenceException {
triggeredJobComplete(conn, trigger, jobDetail,triggerInstCode);
}
});
}
示例6: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
Iterator<TriggerListener> itr = listeners.iterator();
while(itr.hasNext()) {
TriggerListener l = itr.next();
l.triggerComplete(trigger, context, triggerInstructionCode);
}
}
示例7: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger,
JobExecutionContext context,
CompletedExecutionInstruction triggerInstructionCode) {
if(trigger.getKey().equals(triggerKey)) {
firedWhen = null;
triggerKey = null;
}
}
示例8: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
System.out.println("TriggerListner.triggerComplete()");
}
示例9: triggeredJobComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail,
CompletedExecutionInstruction triggerInstCode) {
clusteredJobStore.triggeredJobComplete(trigger, jobDetail, triggerInstCode);
}
示例10: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
public void triggerComplete(
Trigger trigger,
JobExecutionContext context,
CompletedExecutionInstruction triggerInstructionCode) {
}
示例11: notifyJobStoreJobComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
protected void notifyJobStoreJobComplete(OperableTrigger trigger, JobDetail detail, CompletedExecutionInstruction instCode) {
resources.getJobStore().triggeredJobComplete(trigger, detail, instCode);
}
示例12: notifyJobStoreJobVetoed
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
protected void notifyJobStoreJobVetoed(OperableTrigger trigger, JobDetail detail, CompletedExecutionInstruction instCode) {
resources.getJobStore().triggeredJobComplete(trigger, detail, instCode);
}
示例13: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context,
CompletedExecutionInstruction triggerInstructionCode) {
ProcessLogger.debug("trigger complete:" + trigger);
}
示例14: triggeredJobComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggeredJobComplete(final OperableTrigger trigger,
final JobDetail jobDetail,
final CompletedExecutionInstruction instruction)
{
log.debug("Triggered job complete: trigger={}, jobDetail={}, instruction={}", trigger, jobDetail, instruction);
executeAndPropagate(db -> {
// back from quartz; save job-data-map if needed
if (jobDetail.getJobDataMap().isDirty() && jobDetail.isPersistJobDataAfterExecution()) {
JobDetailEntity jobDetailEntity = jobDetailEntityAdapter.readByKey(db, jobDetail.getKey());
if (jobDetailEntity != null) {
jobDetailEntity.setValue(jobDetail);
jobDetailEntityAdapter.editEntity(db, jobDetailEntity);
}
}
// unblock triggers if concurrent execution is disallowed
if (jobDetail.isConcurrentExectionDisallowed()) {
unblockTriggers(db, jobDetail);
signaler.signalSchedulingChange(0L);
}
TriggerEntity triggerEntity = triggerEntityAdapter.readByKey(db, trigger.getKey());
if (triggerEntity != null) {
switch (instruction) {
case DELETE_TRIGGER:
if (trigger.getNextFireTime() == null) {
// double check for possible reschedule within job execution, which would cancel the need to delete
if (triggerEntity.getValue().getNextFireTime() == null) {
triggerEntityAdapter.deleteEntity(db, triggerEntity);
}
}
else {
triggerEntityAdapter.deleteEntity(db, triggerEntity);
signaler.signalSchedulingChange(0L);
}
break;
case SET_TRIGGER_COMPLETE:
triggerEntity.setState(COMPLETE);
triggerEntityAdapter.editEntity(db, triggerEntity);
signaler.signalSchedulingChange(0L);
break;
case SET_TRIGGER_ERROR:
triggerEntity.setState(ERROR);
triggerEntityAdapter.editEntity(db, triggerEntity);
signaler.signalSchedulingChange(0L);
break;
case SET_ALL_JOB_TRIGGERS_COMPLETE:
updateTriggerState(db, jobDetail.getKey(), COMPLETE);
signaler.signalSchedulingChange(0L);
break;
case SET_ALL_JOB_TRIGGERS_ERROR:
updateTriggerState(db, jobDetail.getKey(), ERROR);
signaler.signalSchedulingChange(0L);
break;
}
}
return null;
});
}
示例15: triggerComplete
import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
System.out.println("trigger complete");
}