本文整理汇总了Java中org.quartz.spi.OperableTrigger.getCalendarName方法的典型用法代码示例。如果您正苦于以下问题:Java OperableTrigger.getCalendarName方法的具体用法?Java OperableTrigger.getCalendarName怎么用?Java OperableTrigger.getCalendarName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.spi.OperableTrigger
的用法示例。
在下文中一共展示了OperableTrigger.getCalendarName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeCalendar
import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
/**
* <p>
* Remove (delete) the <code>{@link org.quartz.Calendar}</code> with the
* given name.
* </p>
*
* <p>
* If removal of the <code>Calendar</code> would result in
* <code>Trigger</code>s pointing to non-existent calendars, then a
* <code>JobPersistenceException</code> will be thrown.</p>
* *
* @param calName The name of the <code>Calendar</code> to be removed.
* @return <code>true</code> if a <code>Calendar</code> with the given name
* was found and removed from the store.
*/
public boolean removeCalendar(String calName)
throws JobPersistenceException {
int numRefs = 0;
synchronized (lock) {
for (TriggerWrapper trigger : triggers) {
OperableTrigger trigg = trigger.trigger;
if (trigg.getCalendarName() != null
&& trigg.getCalendarName().equals(calName)) {
numRefs++;
}
}
}
if (numRefs > 0) {
throw new JobPersistenceException(
"Calender cannot be removed if it referenced by a Trigger!");
}
return (calendarsByName.remove(calName) != null);
}
示例2: doUpdateOfMisfiredTrigger
import org.quartz.spi.OperableTrigger; //导入方法依赖的package包/类
private void doUpdateOfMisfiredTrigger(Connection conn, OperableTrigger trig, boolean forceState, String newStateIfNotComplete, boolean recovering) throws JobPersistenceException {
Calendar cal = null;
if (trig.getCalendarName() != null) {
cal = retrieveCalendar(conn, trig.getCalendarName());
}
schedSignaler.notifyTriggerListenersMisfired(trig);
trig.updateAfterMisfire(cal);
if (trig.getNextFireTime() == null) {
storeTrigger(conn, trig,
null, true, STATE_COMPLETE, forceState, recovering);
schedSignaler.notifySchedulerListenersFinalized(trig);
} else {
storeTrigger(conn, trig, null, true, newStateIfNotComplete,
forceState, false);
}
}