Java Code Examples for org.quartz.Trigger#CompletedExecutionInstruction

The following examples show how to use org.quartz.Trigger#CompletedExecutionInstruction . 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: AbstractQuartzTaskManager.java    From micro-integrator with Apache License 2.0 6 votes vote down vote up
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext jobExecutionContext,
                            Trigger.CompletedExecutionInstruction completedExecutionInstruction) {

    if (trigger.getNextFireTime() == null) {
        try {
            String taskName = trigger.getJobKey().getName();
            TaskUtils.setTaskFinished(getTaskRepository(), taskName, true);
            if (getAllCoordinatedTasksDeployed().contains(taskName)) {
                removeTaskFromLocallyRunningTaskList(taskName);
                taskStore.updateTaskState(Collections.singletonList(taskName),
                                          CoordinatedTask.States.COMPLETED);
            }
        } catch (TaskException | TaskCoordinationException e) {
            log.error("Error in Finishing Task [" + trigger.getJobKey().getName() + "]: " + e.getMessage(), e);
        }
    }
}
 
Example 2
Source File: SchedulerTriggerListener.java    From dapeng-soa with Apache License 2.0 6 votes vote down vote up
/**
 * (4) 任务完成时触发
 * Called by the Scheduler when a Trigger has fired, it's associated JobDetail has been executed
 * and it's triggered(xx) method has been called.
 */
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode) {
    JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
    String serviceName = jobDataMap.getString("serviceName");
    String versionName = jobDataMap.getString("versionName");
    String methodName = jobDataMap.getString("methodName");

    LocalDateTime currentTime = LocalDateTime.now(ZoneId.of("Asia/Shanghai"));
    LocalDateTime startTime = (LocalDateTime) jobDataMap.get("startTime");
    long taskCost = Duration.between(startTime, currentTime).toMillis();

    String message = String.format("SchedulerTriggerListener::triggerComplete;Task[%s:%s:%s] 执行完成[%s] ,cost:%sms", serviceName, versionName, methodName, currentTime.format(DATE_TIME), taskCost);
    //sendMessage(serviceName, versionName, methodName, message, false, jobDataMap, "succeed");
    TaskMonitorDataReportUtils.removeSessionTid();
}
 
Example 3
Source File: ScheduledInvocationManagerImpl.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public void triggerComplete(
		Trigger trigger,
		JobExecutionContext context,
		Trigger.CompletedExecutionInstruction triggerInstructionCode) {
	// Check it's one of ours
	if (GROUP_NAME.equals(trigger.getKey().getGroup())) {
		String contextId = trigger.getJobDataMap().getString(CONTEXT_ID);
		if (contextId == null) {
			log.warn("One of our triggers ({}) didn't have a context ID", trigger.getKey());
		} else {
			dao.remove(trigger.getJobKey().getName(), contextId);
		}
	}
}
 
Example 4
Source File: ScheduledInvocationManagerImpl.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public void triggerComplete(
		Trigger trigger,
		JobExecutionContext context,
		Trigger.CompletedExecutionInstruction triggerInstructionCode) {
	// Check it's one of ours
	if (GROUP_NAME.equals(trigger.getKey().getGroup())) {
		String contextId = trigger.getJobDataMap().getString(CONTEXT_ID);
		if (contextId == null) {
			log.warn("One of our triggers ({}) didn't have a context ID", trigger.getKey());
		} else {
			dao.remove(trigger.getJobKey().getName(), contextId);
		}
	}
}
 
Example 5
Source File: CronIT.java    From attic-aurora with Apache License 2.0 5 votes vote down vote up
@Override
public void triggerComplete(
    Trigger trigger,
    JobExecutionContext context,
    Trigger.CompletedExecutionInstruction triggerInstructionCode) {

  countDownLatch.countDown();
  // No-op.
}
 
Example 6
Source File: WatchBattleRoomTriggerListener.java    From Almost-Famous with MIT License 4 votes vote down vote up
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode) {
    if (log.isDebugEnabled()) {
        log.debug("triggerComplete = {}", getName());
    }
}
 
Example 7
Source File: MonitorTriggerListener.java    From MicroCommunity with Apache License 2.0 4 votes vote down vote up
@Override
public void triggerComplete(Trigger trigger, JobExecutionContext context,
                            Trigger.CompletedExecutionInstruction triggerInstructionCode) {
    logger.info("Trigger被触发并且完成了job的执行,此方法被调用");

}
 
Example 8
Source File: AbstractTerracottaJobStore.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction instruction) {
  realJobStore.triggeredJobComplete(trigger, jobDetail, instruction);
}