當前位置: 首頁>>代碼示例>>Java>>正文


Java Scheduler.DEFAULT_RECOVERY_GROUP屬性代碼示例

本文整理匯總了Java中org.quartz.Scheduler.DEFAULT_RECOVERY_GROUP屬性的典型用法代碼示例。如果您正苦於以下問題:Java Scheduler.DEFAULT_RECOVERY_GROUP屬性的具體用法?Java Scheduler.DEFAULT_RECOVERY_GROUP怎麽用?Java Scheduler.DEFAULT_RECOVERY_GROUP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.quartz.Scheduler的用法示例。


在下文中一共展示了Scheduler.DEFAULT_RECOVERY_GROUP屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createRecoveryTrigger

protected OperableTrigger createRecoveryTrigger(TriggerWrapper tw, JobWrapper jw,
                                                String name, FiredTrigger recovering) {
  final SimpleTriggerImpl recoveryTrigger = new SimpleTriggerImpl(name, Scheduler.DEFAULT_RECOVERY_GROUP, new Date(recovering.getScheduledFireTime()));
  recoveryTrigger.setJobName(jw.getKey().getName());
  recoveryTrigger.setJobGroup(jw.getKey().getGroup());
  recoveryTrigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY);
  recoveryTrigger.setPriority(tw.getPriority());
  return recoveryTrigger;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:DefaultClusteredJobStore.java

示例2: selectTriggersForRecoveringJobs

/**
 * <p>
 * Select all of the triggers for jobs that are requesting recovery. The
 * returned trigger objects will have unique "recoverXXX" trigger names and
 * will be in the <code>{@link
 * org.quartz.Scheduler}.DEFAULT_RECOVERY_GROUP</code>
 * trigger group.
 * </p>
 * 
 * <p>
 * In order to preserve the ordering of the triggers, the fire time will be
 * set from the <code>COL_FIRED_TIME</code> column in the <code>TABLE_FIRED_TRIGGERS</code>
 * table. The caller is responsible for calling <code>computeFirstFireTime</code>
 * on each returned trigger. It is also up to the caller to insert the
 * returned triggers to ensure that they are fired.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @return an array of <code>{@link org.quartz.Trigger}</code> objects
 */
public List<OperableTrigger> selectTriggersForRecoveringJobs(Connection conn)
    throws SQLException, IOException, ClassNotFoundException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn
                .prepareStatement(rtp(SELECT_INSTANCES_RECOVERABLE_FIRED_TRIGGERS));
        ps.setString(1, instanceId);
        setBoolean(ps, 2, true);
        rs = ps.executeQuery();

        long dumId = System.currentTimeMillis();
        LinkedList<OperableTrigger> list = new LinkedList<OperableTrigger>();
        while (rs.next()) {
            String jobName = rs.getString(COL_JOB_NAME);
            String jobGroup = rs.getString(COL_JOB_GROUP);
            String trigName = rs.getString(COL_TRIGGER_NAME);
            String trigGroup = rs.getString(COL_TRIGGER_GROUP);
            long firedTime = rs.getLong(COL_FIRED_TIME);
            long scheduledTime = rs.getLong(COL_SCHED_TIME);
            int priority = rs.getInt(COL_PRIORITY);
            @SuppressWarnings("deprecation")
            SimpleTriggerImpl rcvryTrig = new SimpleTriggerImpl("recover_"
                    + instanceId + "_" + String.valueOf(dumId++),
                    Scheduler.DEFAULT_RECOVERY_GROUP, new Date(scheduledTime));
            rcvryTrig.setJobName(jobName);
            rcvryTrig.setJobGroup(jobGroup);
            rcvryTrig.setPriority(priority);
            rcvryTrig.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY);

            JobDataMap jd = selectTriggerJobDataMap(conn, trigName, trigGroup);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_NAME, trigName);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_GROUP, trigGroup);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_FIRETIME_IN_MILLISECONDS, String.valueOf(firedTime));
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_SCHEDULED_FIRETIME_IN_MILLISECONDS, String.valueOf(scheduledTime));
            rcvryTrig.setJobDataMap(jd);
            
            list.add(rcvryTrig);
        }
        return list;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:67,代碼來源:StdJDBCDelegate.java

示例3: selectTriggersForRecoveringJobs

/**
 * <p>
 * Select all of the triggers for jobs that are requesting recovery. The
 * returned trigger objects will have unique "recoverXXX" trigger names and
 * will be in the <code>{@link
 * org.quartz.Scheduler}.DEFAULT_RECOVERY_GROUP</code>
 * trigger group.
 * </p>
 * 
 * <p>
 * In order to preserve the ordering of the triggers, the fire time will be
 * set from the <code>COL_FIRED_TIME</code> column in the <code>TABLE_FIRED_TRIGGERS</code>
 * table. The caller is responsible for calling <code>computeFirstFireTime</code>
 * on each returned trigger. It is also up to the caller to insert the
 * returned triggers to ensure that they are fired.
 * </p>
 * 
 * @param conn
 *          the DB Connection
 * @return an array of <code>{@link org.quartz.Trigger}</code> objects
 */
public Trigger[] selectTriggersForRecoveringJobs(Connection conn)
    throws SQLException, IOException, ClassNotFoundException {
    PreparedStatement ps = null;
    ResultSet rs = null;

    try {
        ps = conn
                .prepareStatement(rtp(SELECT_INSTANCES_RECOVERABLE_FIRED_TRIGGERS));
        ps.setString(1, instanceId);
        setBoolean(ps, 2, true);
        rs = ps.executeQuery();

        long dumId = System.currentTimeMillis();
        ArrayList list = new ArrayList();
        while (rs.next()) {
            String jobName = rs.getString(COL_JOB_NAME);
            String jobGroup = rs.getString(COL_JOB_GROUP);
            String trigName = rs.getString(COL_TRIGGER_NAME);
            String trigGroup = rs.getString(COL_TRIGGER_GROUP);
            long firedTime = rs.getLong(COL_FIRED_TIME);
            int priority = rs.getInt(COL_PRIORITY);
            SimpleTrigger rcvryTrig = new SimpleTrigger("recover_"
                    + instanceId + "_" + String.valueOf(dumId++),
                    Scheduler.DEFAULT_RECOVERY_GROUP, new Date(firedTime));
            rcvryTrig.setJobName(jobName);
            rcvryTrig.setJobGroup(jobGroup);
            rcvryTrig.setPriority(priority);
            rcvryTrig
                    .setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW);

            JobDataMap jd = selectTriggerJobDataMap(conn, trigName, trigGroup);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_NAME, trigName);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_GROUP, trigGroup);
            jd.put(Scheduler.FAILED_JOB_ORIGINAL_TRIGGER_FIRETIME_IN_MILLISECONDS, String.valueOf(firedTime));
            rcvryTrig.setJobDataMap(jd);
            
            list.add(rcvryTrig);
        }
        Object[] oArr = list.toArray();
        Trigger[] tArr = new Trigger[oArr.length];
        System.arraycopy(oArr, 0, tArr, 0, oArr.length);
        return tArr;
    } finally {
        closeResultSet(rs);
        closeStatement(ps);
    }
}
 
開發者ID:AsuraTeam,項目名稱:asura,代碼行數:68,代碼來源:StdJDBCDelegate.java


注:本文中的org.quartz.Scheduler.DEFAULT_RECOVERY_GROUP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。