本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}