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


Java JobExecutionContext.getRefireCount方法代码示例

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


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

示例1: jobToBeExecuted

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

示例2: jobExecutionVetoed

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

示例3: toCompositeData

import org.quartz.JobExecutionContext; //导入方法依赖的package包/类
/**
 * @return composite data
 */
public static CompositeData toCompositeData(JobExecutionContext jec)
        throws SchedulerException {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        jec.getScheduler().getSchedulerName(),
                        jec.getTrigger().getKey().getName(),
                        jec.getTrigger().getKey().getGroup(),
                        jec.getJobDetail().getKey().getName(),
                        jec.getJobDetail().getKey().getGroup(),
                        JobDataMapSupport.toTabularData(jec
                                .getMergedJobDataMap()),
                        jec.getTrigger().getCalendarName(),
                        jec.isRecovering(),
                        jec.getRefireCount(),
                        jec.getFireTime(), jec.getScheduledFireTime(),
                        jec.getPreviousFireTime(), jec.getNextFireTime(),
                        jec.getJobRunTime(),
                        jec.getFireInstanceId() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:JobExecutionContextSupport.java

示例4: jobWasExecuted

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

示例5: triggerComplete

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

示例6: convert

import org.quartz.JobExecutionContext; //导入方法依赖的package包/类
public CronyxExecutionContext convert(JobExecutionContext context) {
    String contextKey = context.get(CONTEXT_KEY).toString();
    JobDefinition jobDef = (JobDefinition) context.getMergedJobDataMap().get(JOB_DEFINITION);
    TriggerDefinition triggerDef = quartzToCronyxSelector.convert(context.getTrigger());
    Instant scheduledTime = context.getScheduledFireTime().toInstant();
    Instant actualTime = context.getFireTime().toInstant();
    Map<String, Object> jobData = new HashMap<>(context.getMergedJobDataMap());
    Throwable jobException = (Throwable) context.get(JOB_EXCEPTION);
    Object jobResult = context.getResult();
    int attemptNumber = context.getRefireCount() + 1;
    return new CronyxExecutionContext(contextKey, jobDef, triggerDef, attemptNumber, scheduledTime,
            actualTime, jobData, jobResult, jobException, FIRED);
}
 
开发者ID:taboola,项目名称:taboola-cronyx,代码行数:14,代码来源:JobExecutionContextToFiringContext.java

示例7: triggerFired

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

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


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