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


Java Trigger.getNextFireTime方法代码示例

本文整理汇总了Java中org.quartz.Trigger.getNextFireTime方法的典型用法代码示例。如果您正苦于以下问题:Java Trigger.getNextFireTime方法的具体用法?Java Trigger.getNextFireTime怎么用?Java Trigger.getNextFireTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.quartz.Trigger的用法示例。


在下文中一共展示了Trigger.getNextFireTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: jobToBeExecuted

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobToBeExecuted(JobExecutionContext)
 */
public void jobToBeExecuted(JobExecutionContext context) {
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    Trigger trigger = context.getTrigger();

    Object[] args = {
        context.getJobDetail().getKey().getName(),
        context.getJobDetail().getKey().getGroup(), new java.util.Date(),
        trigger.getKey().getName(), trigger.getKey().getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        Integer.valueOf(context.getRefireCount())
    };

    getLog().info(MessageFormat.format(getJobToBeFiredMessage(), args));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:LoggingJobHistoryPlugin.java

示例2: jobExecutionVetoed

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobExecutionVetoed(org.quartz.JobExecutionContext)
 */
public void jobExecutionVetoed(JobExecutionContext context) {
    
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    Trigger trigger = context.getTrigger();

    Object[] args = {
        context.getJobDetail().getKey().getName(),
        context.getJobDetail().getKey().getGroup(), new java.util.Date(),
        trigger.getKey().getName(), trigger.getKey().getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        Integer.valueOf(context.getRefireCount())
    };

    getLog().info(MessageFormat.format(getJobWasVetoedMessage(), args));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:LoggingJobHistoryPlugin.java

示例3: jobToBeExecuted

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobToBeExecuted(JobExecutionContext)
 */
public void jobToBeExecuted(JobExecutionContext context) {
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    Trigger trigger = context.getTrigger();

    Object[] args = {
        context.getJobDetail().getName(),
        context.getJobDetail().getGroup(), new java.util.Date(),
        trigger.getName(), trigger.getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        new Integer(context.getRefireCount())
    };

    getLog().info(MessageFormat.format(getJobToBeFiredMessage(), args));
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:21,代码来源:LoggingJobHistoryPlugin.java

示例4: jobExecutionVetoed

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobExecutionVetoed(org.quartz.JobExecutionContext)
 */
public void jobExecutionVetoed(JobExecutionContext context) {
    
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    Trigger trigger = context.getTrigger();

    Object[] args = {
        context.getJobDetail().getName(),
        context.getJobDetail().getGroup(), new java.util.Date(),
        trigger.getName(), trigger.getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        new Integer(context.getRefireCount())
    };

    getLog().info(MessageFormat.format(getJobWasVetoedMessage(), args));
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:LoggingJobHistoryPlugin.java

示例5: toCompositeData

import org.quartz.Trigger; //导入方法依赖的package包/类
public static CompositeData toCompositeData(Trigger trigger) {
	try {
		return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
				new Object[] {
						trigger.getName(),
						trigger.getGroup(),
						trigger.getJobName(),
						trigger.getJobGroup(),
						trigger.getDescription(),
						JobDataMapSupport.toTabularData(trigger
								.getJobDataMap()), trigger.isVolatile(),
						trigger.getCalendarName(),
						trigger.getFireInstanceId(),
						trigger.getMisfireInstruction(),
						trigger.getPriority(), trigger.getStartTime(),
						trigger.getEndTime(), trigger.getNextFireTime(),
						trigger.getPreviousFireTime(),
						trigger.getFinalFireTime() });
	} catch (OpenDataException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:23,代码来源:TriggerSupport.java

示例6: toCompositeData

import org.quartz.Trigger; //导入方法依赖的package包/类
public static CompositeData toCompositeData(Trigger trigger) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        trigger.getKey().getName(),
                        trigger.getKey().getGroup(),
                        trigger.getJobKey().getName(),
                        trigger.getJobKey().getGroup(),
                        trigger.getDescription(),
                        JobDataMapSupport.toTabularData(trigger
                                .getJobDataMap()),
                        trigger.getCalendarName(),
                        ((OperableTrigger)trigger).getFireInstanceId(),
                        trigger.getMisfireInstruction(),
                        trigger.getPriority(), trigger.getStartTime(),
                        trigger.getEndTime(), trigger.getNextFireTime(),
                        trigger.getPreviousFireTime(),
                        trigger.getFinalFireTime() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:TriggerSupport.java

示例7: jobWasExecuted

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobWasExecuted(JobExecutionContext, JobExecutionException)
 */
public void jobWasExecuted(JobExecutionContext context,
        JobExecutionException jobException) {

    Trigger trigger = context.getTrigger();
    
    Object[] args = null;
    
    if (jobException != null) {
        if (!getLog().isWarnEnabled()) {
            return;
        } 
        
        String errMsg = jobException.getMessage();
        args = 
            new Object[] {
                context.getJobDetail().getKey().getName(),
                context.getJobDetail().getKey().getGroup(), new java.util.Date(),
                trigger.getKey().getName(), trigger.getKey().getGroup(),
                trigger.getPreviousFireTime(), trigger.getNextFireTime(),
                Integer.valueOf(context.getRefireCount()), errMsg
            };
        
        getLog().warn(MessageFormat.format(getJobFailedMessage(), args), jobException); 
    } else {
        if (!getLog().isInfoEnabled()) {
            return;
        } 
        
        String result = String.valueOf(context.getResult());
        args =
            new Object[] {
                context.getJobDetail().getKey().getName(),
                context.getJobDetail().getKey().getGroup(), new java.util.Date(),
                trigger.getKey().getName(), trigger.getKey().getGroup(),
                trigger.getPreviousFireTime(), trigger.getNextFireTime(),
                Integer.valueOf(context.getRefireCount()), result
            };
        
        getLog().info(MessageFormat.format(getJobSuccessMessage(), args));
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:45,代码来源:LoggingJobHistoryPlugin.java

示例8: triggerFired

import org.quartz.Trigger; //导入方法依赖的package包/类
public void triggerFired(Trigger trigger, JobExecutionContext context) {
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    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())
    };

    getLog().info(MessageFormat.format(getTriggerFiredMessage(), args));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:LoggingTriggerHistoryPlugin.java

示例9: triggerMisfired

import org.quartz.Trigger; //导入方法依赖的package包/类
public void triggerMisfired(Trigger trigger) {
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    Object[] args = {
        trigger.getKey().getName(), trigger.getKey().getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        new java.util.Date(), trigger.getJobKey().getName(),
        trigger.getJobKey().getGroup()
    };

    getLog().info(MessageFormat.format(getTriggerMisfiredMessage(), args));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:LoggingTriggerHistoryPlugin.java

示例10: triggerComplete

import org.quartz.Trigger; //导入方法依赖的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

示例11: doUpdateOfMisfiredTrigger

import org.quartz.Trigger; //导入方法依赖的package包/类
private void doUpdateOfMisfiredTrigger(Connection conn, SchedulingContext ctxt, Trigger trig, boolean forceState, String newStateIfNotComplete, boolean recovering) throws JobPersistenceException {
    Calendar cal = null;
    if (trig.getCalendarName() != null) {
        cal = retrieveCalendar(conn, ctxt, trig.getCalendarName());
    }

    schedSignaler.notifyTriggerListenersMisfired(trig);

    trig.updateAfterMisfire(cal);

    if (trig.getNextFireTime() == null) {
        storeTrigger(conn, ctxt, trig,
            null, true, STATE_COMPLETE, forceState, recovering);
    } else {
        storeTrigger(conn, ctxt, trig, null, true, newStateIfNotComplete,
                forceState, false);
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:19,代码来源:JobStoreSupport.java

示例12: jobWasExecuted

import org.quartz.Trigger; //导入方法依赖的package包/类
/** 
 * @see org.quartz.JobListener#jobWasExecuted(JobExecutionContext, JobExecutionException)
 */
public void jobWasExecuted(JobExecutionContext context,
        JobExecutionException jobException) {

    Trigger trigger = context.getTrigger();
    
    Object[] args = null;
    
    if (jobException != null) {
        if (!getLog().isWarnEnabled()) {
            return;
        } 
        
        String errMsg = jobException.getMessage();
        args = 
            new Object[] {
                context.getJobDetail().getName(),
                context.getJobDetail().getGroup(), new java.util.Date(),
                trigger.getName(), trigger.getGroup(),
                trigger.getPreviousFireTime(), trigger.getNextFireTime(),
                new Integer(context.getRefireCount()), errMsg
            };
        
        getLog().warn(MessageFormat.format(getJobFailedMessage(), args), jobException); 
    } else {
        if (!getLog().isInfoEnabled()) {
            return;
        } 
        
        String result = String.valueOf(context.getResult());
        args =
            new Object[] {
                context.getJobDetail().getName(),
                context.getJobDetail().getGroup(), new java.util.Date(),
                trigger.getName(), trigger.getGroup(),
                trigger.getPreviousFireTime(), trigger.getNextFireTime(),
                new Integer(context.getRefireCount()), result
            };
        
        getLog().info(MessageFormat.format(getJobSuccessMessage(), args));
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:45,代码来源:LoggingJobHistoryPlugin.java

示例13: triggerComplete

import org.quartz.Trigger; //导入方法依赖的package包/类
public void triggerComplete(Trigger trigger, JobExecutionContext context,
        int triggerInstructionCode) {
    if (!getLog().isInfoEnabled()) {
        return;
    } 
    
    String instrCode = "UNKNOWN";
    if (triggerInstructionCode == Trigger.INSTRUCTION_DELETE_TRIGGER) {
        instrCode = "DELETE TRIGGER";
    } else if (triggerInstructionCode == Trigger.INSTRUCTION_NOOP) {
        instrCode = "DO NOTHING";
    } else if (triggerInstructionCode == Trigger.INSTRUCTION_RE_EXECUTE_JOB) {
        instrCode = "RE-EXECUTE JOB";
    } else if (triggerInstructionCode == Trigger.INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE) {
        instrCode = "SET ALL OF JOB'S TRIGGERS COMPLETE";
    } else if (triggerInstructionCode == Trigger.INSTRUCTION_SET_TRIGGER_COMPLETE) {
        instrCode = "SET THIS TRIGGER COMPLETE";
    }

    Object[] args = {
        trigger.getName(), trigger.getGroup(),
        trigger.getPreviousFireTime(), trigger.getNextFireTime(),
        new java.util.Date(), context.getJobDetail().getName(),
        context.getJobDetail().getGroup(),
        new Integer(context.getRefireCount()),
        new Integer(triggerInstructionCode), instrCode
    };

    getLog().info(MessageFormat.format(getTriggerCompleteMessage(), args));
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:31,代码来源:LoggingTriggerHistoryPlugin.java

示例14: showScheduledEmails

import org.quartz.Trigger; //导入方法依赖的package包/类
/**
    * Renders a page listing all scheduled emails.
    */
   public ActionForward showScheduledEmails(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, ServletException, SchedulerException {
getUserManagementService();
Scheduler scheduler = getScheduler();
TreeSet<EmailScheduleMessageJobDTO> scheduleList = new TreeSet<EmailScheduleMessageJobDTO>();
Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID, true);
boolean isLessonNotifications = (lessonId != null);
Integer organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID, true);
if (isLessonNotifications) {
    if (!getSecurityService().isLessonMonitor(lessonId, getCurrentUser().getUserID(),
	    "show scheduled lesson email notifications", false)) {
	response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a monitor in the lesson");
	return null;
    }
} else {
    if (!getSecurityService().isGroupMonitor(organisationId, getCurrentUser().getUserID(),
	    "show scheduled course email notifications", false)) {
	response.sendError(HttpServletResponse.SC_FORBIDDEN, "The user is not a monitor in the organisation");
	return null;
    }
}

Set<TriggerKey> triggerKeys = scheduler
	.getTriggerKeys(GroupMatcher.triggerGroupEquals(Scheduler.DEFAULT_GROUP));
for (TriggerKey triggerKey : triggerKeys) {
    String triggerName = triggerKey.getName();
    if (triggerName.startsWith(EmailNotificationsAction.TRIGGER_PREFIX_NAME)) {
	Trigger trigger = scheduler.getTrigger(triggerKey);
	JobDetail jobDetail = scheduler.getJobDetail(trigger.getJobKey());
	JobDataMap jobDataMap = jobDetail.getJobDataMap();

	// filter triggers
	if (isLessonNotifications) {
	    Object jobLessonId = jobDataMap.get(AttributeNames.PARAM_LESSON_ID);
	    if ((jobLessonId == null) || (!lessonId.equals(jobLessonId))) {
		continue;
	    }
	} else {
	    Object jobOrganisationId = jobDataMap.get(AttributeNames.PARAM_ORGANISATION_ID);
	    if ((jobOrganisationId == null) || (!organisationId.equals(jobOrganisationId))) {
		continue;
	    }
	}

	Date triggerDate = trigger.getNextFireTime();
	String emailBody = WebUtil.convertNewlines((String) jobDataMap.get("emailBody"));
	int searchType = (Integer) jobDataMap.get("searchType");
	EmailScheduleMessageJobDTO emailScheduleJobDTO = new EmailScheduleMessageJobDTO();
	emailScheduleJobDTO.setTriggerName(triggerName);
	emailScheduleJobDTO.setTriggerDate(triggerDate);
	emailScheduleJobDTO.setEmailBody(emailBody);
	emailScheduleJobDTO.setSearchType(searchType);
	scheduleList.add(emailScheduleJobDTO);
    }
}

request.setAttribute("scheduleList", scheduleList);
request.setAttribute(AttributeNames.PARAM_LESSON_ID, lessonId);
request.setAttribute(AttributeNames.PARAM_ORGANISATION_ID, organisationId);

return mapping.findForward("scheduledEmailList");
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:66,代码来源:EmailNotificationsAction.java

示例15: getEmailProgressDates

import org.quartz.Trigger; //导入方法依赖的package包/类
/**
    * Gets learners or monitors of the lesson and organisation containing it.
    * 
    * @throws SchedulerException
    */
   public ActionForward getEmailProgressDates(ActionMapping mapping, ActionForm form, HttpServletRequest request,
    HttpServletResponse response) throws IOException, JSONException, SchedulerException {
Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID);
if (!getSecurityService().isLessonMonitor(lessonId, getCurrentUser().getUserID(), "get class members", false)) {
    response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson");
    return null;
}

HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);

JSONObject responseJSON = new JSONObject();
JSONArray datesJSON = new JSONArray();

// find all the current dates set up to send the emails
Scheduler scheduler = getScheduler();
String triggerPrefix = getTriggerPrefix(lessonId);
SortedSet<Date> currentDatesSet = new TreeSet<Date>();
Set<TriggerKey> triggerKeys = scheduler
	.getTriggerKeys(GroupMatcher.triggerGroupEquals(Scheduler.DEFAULT_GROUP));
for (TriggerKey triggerKey : triggerKeys) {
    String triggerName = triggerKey.getName();
    if (triggerName.startsWith(triggerPrefix)) {
	Trigger trigger = scheduler.getTrigger(triggerKey);
	JobDetail jobDetail = scheduler.getJobDetail(trigger.getJobKey());
	JobDataMap jobDataMap = jobDetail.getJobDataMap();

	// get only the trigger for the current lesson

	Object jobLessonId = jobDataMap.get(AttributeNames.PARAM_LESSON_ID);
	if (lessonId.equals(jobLessonId)) {

	    Date triggerDate = trigger.getNextFireTime();
	    currentDatesSet.add(triggerDate);
	}
    }
}

for (Date date : currentDatesSet) {
    datesJSON.put(createDateJSON(request.getLocale(), user, date, null));
}
responseJSON.put("dates", datesJSON);

response.setContentType("application/json;charset=utf-8");
response.getWriter().write(responseJSON.toString());
return null;
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:53,代码来源:EmailProgressAction.java


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