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


Java SchedulerException.setErrorCode方法代码示例

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


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

示例1: getRemoteScheduler

import org.quartz.SchedulerException; //导入方法依赖的package包/类
protected RemotableQuartzScheduler getRemoteScheduler()
    throws SchedulerException {
    if (rsched != null) {
        return rsched;
    }

    try {
        Registry registry = LocateRegistry.getRegistry(rmiHost, rmiPort);

        rsched = (RemotableQuartzScheduler) registry.lookup(schedId);

    } catch (Exception e) {
        SchedulerException initException = new SchedulerException(
                "Could not get handle to remote scheduler: "
                        + e.getMessage(), e);
        initException
                .setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
        throw initException;
    }

    return rsched;
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:23,代码来源:RemoteScheduler.java

示例2: notifyTriggerListenersMisfired

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public void notifyTriggerListenersMisfired(Trigger trigger)
    throws SchedulerException {
    // build a list of all trigger listeners that are to be notified...
    List triggerListeners = buildTriggerListenerList(trigger
            .getTriggerListenerNames());

    // notify all trigger listeners in the list
    java.util.Iterator itr = triggerListeners.iterator();
    while (itr.hasNext()) {
        TriggerListener tl = (TriggerListener) itr.next();
        try {
            tl.triggerMisfired(trigger);
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "TriggerListener '" + tl.getName()
                            + "' threw exception: " + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_TRIGGER_LISTENER);
            throw se;
        }
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:QuartzScheduler.java

示例3: notifyTriggerListenersComplete

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public void notifyTriggerListenersComplete(JobExecutionContext jec,
        int instCode) throws SchedulerException {
    // build a list of all trigger listeners that are to be notified...
    List triggerListeners = buildTriggerListenerList(jec.getTrigger()
            .getTriggerListenerNames());

    // notify all trigger listeners in the list
    java.util.Iterator itr = triggerListeners.iterator();
    while (itr.hasNext()) {
        TriggerListener tl = (TriggerListener) itr.next();
        try {
            tl.triggerComplete(jec.getTrigger(), jec, instCode);
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "TriggerListener '" + tl.getName()
                            + "' threw exception: " + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_TRIGGER_LISTENER);
            throw se;
        }
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:QuartzScheduler.java

示例4: notifyJobListenersToBeExecuted

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public void notifyJobListenersToBeExecuted(JobExecutionContext jec)
    throws SchedulerException {
    // build a list of all job listeners that are to be notified...
    List jobListeners = buildJobListenerList(jec.getJobDetail()
            .getJobListenerNames());

    // notify all job listeners
    java.util.Iterator itr = jobListeners.iterator();
    while (itr.hasNext()) {
        JobListener jl = (JobListener) itr.next();
        try {
            jl.jobToBeExecuted(jec);
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "JobListener '" + jl.getName() + "' threw exception: "
                            + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
            throw se;
        }
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:QuartzScheduler.java

示例5: notifyJobListenersWasVetoed

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public void notifyJobListenersWasVetoed(JobExecutionContext jec)
    throws SchedulerException {
    // build a list of all job listeners that are to be notified...
    List jobListeners = buildJobListenerList(jec.getJobDetail()
            .getJobListenerNames());

    // notify all job listeners
    java.util.Iterator itr = jobListeners.iterator();
    while (itr.hasNext()) {
        JobListener jl = (JobListener) itr.next();
        try {
            jl.jobExecutionVetoed(jec);
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "JobListener '" + jl.getName() + "' threw exception: "
                    + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
            throw se;
        }
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:QuartzScheduler.java

示例6: notifyJobListenersWasExecuted

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public void notifyJobListenersWasExecuted(JobExecutionContext jec,
        JobExecutionException je) throws SchedulerException {
    // build a list of all job listeners that are to be notified...
    List jobListeners = buildJobListenerList(jec.getJobDetail()
            .getJobListenerNames());

    // notify all job listeners
    java.util.Iterator itr = jobListeners.iterator();
    while (itr.hasNext()) {
        JobListener jl = (JobListener) itr.next();
        try {
            jl.jobWasExecuted(jec, je);
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "JobListener '" + jl.getName() + "' threw exception: "
                            + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_JOB_LISTENER);
            throw se;
        }
    }
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:22,代码来源:QuartzScheduler.java

示例7: invalidateHandleCreateException

import org.quartz.SchedulerException; //导入方法依赖的package包/类
protected SchedulerException invalidateHandleCreateException(String msg,
        Exception cause) {
    rsched = null;
    SchedulerException ex = new SchedulerException(msg, cause);
    ex.setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
    return ex;
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:8,代码来源:RemoteScheduler.java

示例8: notifyTriggerListenersFired

import org.quartz.SchedulerException; //导入方法依赖的package包/类
public boolean notifyTriggerListenersFired(JobExecutionContext jec)
    throws SchedulerException {
    // build a list of all trigger listeners that are to be notified...
    List triggerListeners = buildTriggerListenerList(jec.getTrigger()
            .getTriggerListenerNames());

    boolean vetoedExecution = false;
    
    // notify all trigger listeners in the list
    java.util.Iterator itr = triggerListeners.iterator();
    while (itr.hasNext()) {
        TriggerListener tl = (TriggerListener) itr.next();
        try {
            tl.triggerFired(jec.getTrigger(), jec);
            
            if(tl.vetoJobExecution(jec.getTrigger(), jec)) {
                vetoedExecution = true;
            }
        } catch (Exception e) {
            SchedulerException se = new SchedulerException(
                    "TriggerListener '" + tl.getName()
                            + "' threw exception: " + e.getMessage(), e);
            se.setErrorCode(SchedulerException.ERR_TRIGGER_LISTENER);
            throw se;
        }
    }
    
    return vetoedExecution;
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:30,代码来源:QuartzScheduler.java


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