当前位置: 首页>>代码示例>>Java>>正文


Java CompletedExecutionInstruction类代码示例

本文整理汇总了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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:JobRunShell.java

示例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;
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:QuartzScheduler.java

示例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));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:LoggingTriggerHistoryPlugin.java

示例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));
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:24,代码来源:JobStoreImplTest.java

示例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);
            }
        });    
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:JobStoreSupport.java

示例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);
        }
    }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:BroadcastTriggerListener.java

示例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;
	}
}
 
开发者ID:bnitin,项目名称:bgp-ls,代码行数:10,代码来源:FireEventTimeManager.java

示例8: triggerComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
    System.out.println("TriggerListner.triggerComplete()");
}
 
开发者ID:javabypatel,项目名称:spring-boot-quartz-demo,代码行数:5,代码来源:TriggerListner.java

示例9: triggeredJobComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail,
                                 CompletedExecutionInstruction triggerInstCode) {
  clusteredJobStore.triggeredJobComplete(trigger, jobDetail, triggerInstCode);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:PlainTerracottaJobStore.java

示例10: triggerComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
public void triggerComplete(
    Trigger trigger,
    JobExecutionContext context,
    CompletedExecutionInstruction triggerInstructionCode) {
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:TriggerListenerSupport.java

示例11: notifyJobStoreJobComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
protected void notifyJobStoreJobComplete(OperableTrigger trigger, JobDetail detail, CompletedExecutionInstruction instCode) {
    resources.getJobStore().triggeredJobComplete(trigger, detail, instCode);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:QuartzScheduler.java

示例12: notifyJobStoreJobVetoed

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
protected void notifyJobStoreJobVetoed(OperableTrigger trigger, JobDetail detail, CompletedExecutionInstruction instCode) {
    resources.getJobStore().triggeredJobComplete(trigger, detail, instCode);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:QuartzScheduler.java

示例13: triggerComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context,
		CompletedExecutionInstruction triggerInstructionCode) {
	ProcessLogger.debug("trigger complete:" + trigger);
}
 
开发者ID:daileyet,项目名称:webscheduler,代码行数:6,代码来源:SchedulerService.java

示例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;
  });
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:70,代码来源:JobStoreImpl.java

示例15: triggerComplete

import org.quartz.Trigger.CompletedExecutionInstruction; //导入依赖的package包/类
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, CompletedExecutionInstruction triggerInstructionCode) {
    System.out.println("trigger complete");
}
 
开发者ID:sunlin901203,项目名称:example-java,代码行数:5,代码来源:WakeMeUpTriggerListener.java


注:本文中的org.quartz.Trigger.CompletedExecutionInstruction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。